Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0053ab28
Commit
0053ab28
authored
Jan 26, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Get rid of strcmpW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0f15851e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
varformat.c
dlls/oleaut32/tests/varformat.c
+9
-15
No files found.
dlls/oleaut32/tests/varformat.c
View file @
0053ab28
...
@@ -50,18 +50,12 @@ static BOOL has_i8;
...
@@ -50,18 +50,12 @@ static BOOL has_i8;
#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \
#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \
if (!p##func) { win_skip("function " # func " not available, not testing it\n"); return; }
if (!p##func) { win_skip("function " # func " not available, not testing it\n"); return; }
static
inline
int
strcmpW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
)
{
while
(
*
str1
&&
(
*
str1
==
*
str2
))
{
str1
++
;
str2
++
;
}
return
*
str1
-
*
str2
;
}
#define FMT_NUMBER(vt,val) \
#define FMT_NUMBER(vt,val) \
VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \
VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \
hres = pVarFormatNumber(&v,2,0,0,0,0,&str); \
hres = pVarFormatNumber(&v,2,0,0,0,0,&str); \
ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8x\n", vt, hres); \
ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8x\n", vt, hres); \
if (hres == S_OK) { \
if (hres == S_OK) { \
ok(str &&
strcmpW
(str,szResult1) == 0, \
ok(str &&
wcscmp
(str,szResult1) == 0, \
"VarFormatNumber (vt %d): string different\n", vt); \
"VarFormatNumber (vt %d): string different\n", vt); \
SysFreeString(str); \
SysFreeString(str); \
}
}
...
@@ -107,7 +101,7 @@ static void test_VarFormatNumber(void)
...
@@ -107,7 +101,7 @@ static void test_VarFormatNumber(void)
hres
=
pVarFormatNumber
(
&
v
,
2
,
0
,
0
,
0
,
0
,
&
str
);
hres
=
pVarFormatNumber
(
&
v
,
2
,
0
,
0
,
0
,
0
,
&
str
);
ok
(
hres
==
S_OK
,
"VarFormatNumber (bstr): returned %8x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatNumber (bstr): returned %8x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
ok
(
str
&&
strcmpW
(
str
,
szResult1
)
==
0
,
"VarFormatNumber (bstr): string different
\n
"
);
ok
(
str
&&
wcscmp
(
str
,
szResult1
)
==
0
,
"VarFormatNumber (bstr): string different
\n
"
);
SysFreeString
(
V_BSTR
(
&
v
));
SysFreeString
(
V_BSTR
(
&
v
));
SysFreeString
(
str
);
SysFreeString
(
str
);
...
@@ -115,7 +109,7 @@ static void test_VarFormatNumber(void)
...
@@ -115,7 +109,7 @@ static void test_VarFormatNumber(void)
hres
=
pVarFormatNumber
(
&
v
,
2
,
0
,
-
1
,
0
,
0
,
&
str
);
hres
=
pVarFormatNumber
(
&
v
,
2
,
0
,
-
1
,
0
,
0
,
&
str
);
ok
(
hres
==
S_OK
,
"VarFormatNumber (bstr): returned %8x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatNumber (bstr): returned %8x
\n
"
,
hres
);
if
(
hres
==
S_OK
)
if
(
hres
==
S_OK
)
ok
(
str
&&
strcmpW
(
str
,
szResult2
)
==
0
,
"VarFormatNumber (-bstr): string different
\n
"
);
ok
(
str
&&
wcscmp
(
str
,
szResult2
)
==
0
,
"VarFormatNumber (-bstr): string different
\n
"
);
SysFreeString
(
V_BSTR
(
&
v
));
SysFreeString
(
V_BSTR
(
&
v
));
SysFreeString
(
str
);
SysFreeString
(
str
);
}
}
...
@@ -582,7 +576,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -582,7 +576,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
number_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
number_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
number_us
),
"incorrectly formatted number: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
number_us
),
"incorrectly formatted number: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
...
@@ -590,7 +584,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -590,7 +584,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
number_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
number_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
number
),
"incorrectly formatted number: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
number
),
"incorrectly formatted number: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
VariantClear
(
&
var
);
VariantClear
(
&
var
);
...
@@ -603,7 +597,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -603,7 +597,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
date_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
date_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
date_us
),
"incorrectly formatted date: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
date_us
),
"incorrectly formatted date: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
...
@@ -611,7 +605,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -611,7 +605,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
date_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
date_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
date
),
"incorrectly formatted date: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
date
),
"incorrectly formatted date: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
VariantClear
(
&
var
);
VariantClear
(
&
var
);
...
@@ -624,7 +618,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -624,7 +618,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
string_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
string_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
string_us
),
"incorrectly formatted string: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
string_us
),
"incorrectly formatted string: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
...
@@ -632,7 +626,7 @@ static void test_VarFormatFromTokens(void)
...
@@ -632,7 +626,7 @@ static void test_VarFormatFromTokens(void)
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarTokenizeFormatString failed: %x
\n
"
,
hres
);
hres
=
VarFormatFromTokens
(
&
var
,
string_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
hres
=
VarFormatFromTokens
(
&
var
,
string_fmt
,
buff
,
0
,
&
bstr
,
lcid
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarFormatFromTokens failed: %x
\n
"
,
hres
);
ok
(
!
strcmpW
(
bstr
,
string_de
),
"incorrectly formatted string: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
ok
(
!
wcscmp
(
bstr
,
string_de
),
"incorrectly formatted string: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
bstr
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment