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
f83b41ee
Commit
f83b41ee
authored
Dec 03, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Use wide string literals in some tests.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
14a04ecd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
73 deletions
+46
-73
vartest.c
dlls/oleaut32/tests/vartest.c
+46
-73
No files found.
dlls/oleaut32/tests/vartest.c
View file @
f83b41ee
...
@@ -3267,8 +3267,8 @@ static void test_VarSub(void)
...
@@ -3267,8 +3267,8 @@ static void test_VarSub(void)
CHECKPTR
(
VarSub
);
CHECKPTR
(
VarSub
);
lbstr
=
SysAllocString
(
sz12
);
lbstr
=
SysAllocString
(
L"12"
);
rbstr
=
SysAllocString
(
sz12
);
rbstr
=
SysAllocString
(
L"12"
);
VariantInit
(
&
left
);
VariantInit
(
&
left
);
VariantInit
(
&
right
);
VariantInit
(
&
right
);
...
@@ -3519,8 +3519,6 @@ static void test_VarMod(void)
...
@@ -3519,8 +3519,6 @@ static void test_VarMod(void)
VARIANT
v1
,
v2
,
vDst
,
left
,
right
,
exp
;
VARIANT
v1
,
v2
,
vDst
,
left
,
right
,
exp
;
HRESULT
hres
;
HRESULT
hres
;
HRESULT
hexpected
=
0
;
HRESULT
hexpected
=
0
;
static
const
WCHAR
szNum0
[]
=
{
'1'
,
'2'
,
'5'
,
'\0'
};
static
const
WCHAR
szNum1
[]
=
{
'1'
,
'0'
,
'\0'
};
int
l
,
r
;
int
l
,
r
;
BOOL
lFound
,
rFound
;
BOOL
lFound
,
rFound
;
BOOL
lValid
;
BOOL
lValid
;
...
@@ -3620,8 +3618,8 @@ static void test_VarMod(void)
...
@@ -3620,8 +3618,8 @@ static void test_VarMod(void)
VARMOD
(
DATE
,
R8
,
100
,
10
,
I4
,
0
);
VARMOD
(
DATE
,
R8
,
100
,
10
,
I4
,
0
);
VARMOD
(
DATE
,
DATE
,
100
,
10
,
I4
,
0
);
VARMOD
(
DATE
,
DATE
,
100
,
10
,
I4
,
0
);
strNum0
=
SysAllocString
(
szNum0
);
strNum0
=
SysAllocString
(
L"125"
);
strNum1
=
SysAllocString
(
szNum1
);
strNum1
=
SysAllocString
(
L"10"
);
VARMOD
(
BSTR
,
BSTR
,
strNum0
,
strNum1
,
I4
,
5
);
VARMOD
(
BSTR
,
BSTR
,
strNum0
,
strNum1
,
I4
,
5
);
VARMOD
(
BSTR
,
I1
,
strNum0
,
10
,
I4
,
5
);
VARMOD
(
BSTR
,
I1
,
strNum0
,
10
,
I4
,
5
);
VARMOD
(
BSTR
,
I2
,
strNum0
,
10
,
I4
,
5
);
VARMOD
(
BSTR
,
I2
,
strNum0
,
10
,
I4
,
5
);
...
@@ -4004,7 +4002,6 @@ static HRESULT (WINAPI *pVarFix)(LPVARIANT,LPVARIANT);
...
@@ -4004,7 +4002,6 @@ static HRESULT (WINAPI *pVarFix)(LPVARIANT,LPVARIANT);
static
void
test_VarFix
(
void
)
static
void
test_VarFix
(
void
)
{
{
static
const
WCHAR
szNumMinus1
[]
=
{
'-'
,
'1'
,
'\0'
};
HRESULT
hres
;
HRESULT
hres
;
VARIANT
v
,
exp
,
vDst
;
VARIANT
v
,
exp
,
vDst
;
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
...
@@ -4071,7 +4068,7 @@ static void test_VarFix(void)
...
@@ -4071,7 +4068,7 @@ static void test_VarFix(void)
/* DATE & R8 round as for R4 */
/* DATE & R8 round as for R4 */
VARFIX
(
DATE
,
-
1
,
DATE
,
-
1
);
VARFIX
(
DATE
,
-
1
,
DATE
,
-
1
);
VARFIX
(
R8
,
-
1
,
R8
,
-
1
);
VARFIX
(
R8
,
-
1
,
R8
,
-
1
);
VARFIX
(
BSTR
,(
BSTR
)
szNumMinus1
,
R8
,
-
1
);
VARFIX
(
BSTR
,(
BSTR
)
L"-1"
,
R8
,
-
1
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
pVarFix
(
&
v
,
&
vDst
);
hres
=
pVarFix
(
&
v
,
&
vDst
);
...
@@ -4119,7 +4116,6 @@ static HRESULT (WINAPI *pVarInt)(LPVARIANT,LPVARIANT);
...
@@ -4119,7 +4116,6 @@ static HRESULT (WINAPI *pVarInt)(LPVARIANT,LPVARIANT);
static
void
test_VarInt
(
void
)
static
void
test_VarInt
(
void
)
{
{
static
const
WCHAR
szNumMinus1
[]
=
{
'-'
,
'1'
,
'\0'
};
HRESULT
hres
;
HRESULT
hres
;
VARIANT
v
,
exp
,
vDst
;
VARIANT
v
,
exp
,
vDst
;
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
...
@@ -4186,7 +4182,7 @@ static void test_VarInt(void)
...
@@ -4186,7 +4182,7 @@ static void test_VarInt(void)
/* DATE & R8 round as for R4 */
/* DATE & R8 round as for R4 */
VARINT
(
DATE
,
-
1
,
DATE
,
-
1
);
VARINT
(
DATE
,
-
1
,
DATE
,
-
1
);
VARINT
(
R8
,
-
1
,
R8
,
-
1
);
VARINT
(
R8
,
-
1
,
R8
,
-
1
);
VARINT
(
BSTR
,(
BSTR
)
szNumMinus1
,
R8
,
-
1
);
VARINT
(
BSTR
,(
BSTR
)
L"-1"
,
R8
,
-
1
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
pVarInt
(
&
v
,
&
vDst
);
hres
=
pVarInt
(
&
v
,
&
vDst
);
...
@@ -4235,8 +4231,6 @@ static HRESULT (WINAPI *pVarNeg)(LPVARIANT,LPVARIANT);
...
@@ -4235,8 +4231,6 @@ static HRESULT (WINAPI *pVarNeg)(LPVARIANT,LPVARIANT);
static
void
test_VarNeg
(
void
)
static
void
test_VarNeg
(
void
)
{
{
static
const
WCHAR
szNumMinus1
[]
=
{
'-'
,
'1'
,
'\0'
};
static
const
WCHAR
szNum1
[]
=
{
'1'
,
'\0'
};
HRESULT
hres
;
HRESULT
hres
;
VARIANT
v
,
exp
,
vDst
;
VARIANT
v
,
exp
,
vDst
;
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
DECIMAL
*
pdec
=
&
V_DECIMAL
(
&
v
);
...
@@ -4310,8 +4304,8 @@ static void test_VarNeg(void)
...
@@ -4310,8 +4304,8 @@ static void test_VarNeg(void)
VARNEG
(
DATE
,
-
1
,
DATE
,
1
);
VARNEG
(
DATE
,
-
1
,
DATE
,
1
);
VARNEG
(
R8
,
1
,
R8
,
-
1
);
VARNEG
(
R8
,
1
,
R8
,
-
1
);
VARNEG
(
R8
,
-
1
,
R8
,
1
);
VARNEG
(
R8
,
-
1
,
R8
,
1
);
VARNEG
(
BSTR
,(
BSTR
)
szNumMinus1
,
R8
,
1
);
VARNEG
(
BSTR
,(
BSTR
)
L"-1"
,
R8
,
1
);
VARNEG
(
BSTR
,(
BSTR
)
szNum1
,
R8
,
-
1
);
VARNEG
(
BSTR
,(
BSTR
)
L"1"
,
R8
,
-
1
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
pVarNeg
(
&
v
,
&
vDst
);
hres
=
pVarNeg
(
&
v
,
&
vDst
);
...
@@ -6147,8 +6141,8 @@ static void test_VarMul(void)
...
@@ -6147,8 +6141,8 @@ static void test_VarMul(void)
CHECKPTR
(
VarMul
);
CHECKPTR
(
VarMul
);
lbstr
=
SysAllocString
(
sz12
);
lbstr
=
SysAllocString
(
L"12"
);
rbstr
=
SysAllocString
(
sz12
);
rbstr
=
SysAllocString
(
L"12"
);
/* Test all possible flag/vt combinations & the resulting vt type */
/* Test all possible flag/vt combinations & the resulting vt type */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
...
@@ -6318,8 +6312,8 @@ static void test_VarAdd(void)
...
@@ -6318,8 +6312,8 @@ static void test_VarAdd(void)
CHECKPTR
(
VarAdd
);
CHECKPTR
(
VarAdd
);
lbstr
=
SysAllocString
(
sz12
);
lbstr
=
SysAllocString
(
L"12"
);
rbstr
=
SysAllocString
(
sz12
);
rbstr
=
SysAllocString
(
L"12"
);
/* Test all possible flag/vt combinations & the resulting vt type */
/* Test all possible flag/vt combinations & the resulting vt type */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
...
@@ -6496,13 +6490,6 @@ static void test_VarCat(void)
...
@@ -6496,13 +6490,6 @@ static void test_VarCat(void)
{
{
LCID
lcid
;
LCID
lcid
;
VARIANT
left
,
right
,
result
,
expected
,
expected_broken
;
VARIANT
left
,
right
,
result
,
expected
,
expected_broken
;
static
const
WCHAR
sz34
[]
=
{
'3'
,
'4'
,
'\0'
};
static
const
WCHAR
sz1234
[]
=
{
'1'
,
'2'
,
'3'
,
'4'
,
'\0'
};
static
const
WCHAR
date_sz12
[]
=
{
'9'
,
'/'
,
'3'
,
'0'
,
'/'
,
'1'
,
'9'
,
'8'
,
'0'
,
'1'
,
'2'
,
'\0'
};
static
const
WCHAR
date_sz12_broken
[]
=
{
'9'
,
'/'
,
'3'
,
'0'
,
'/'
,
'8'
,
'0'
,
'1'
,
'2'
,
'\0'
};
static
const
WCHAR
sz12_date
[]
=
{
'1'
,
'2'
,
'9'
,
'/'
,
'3'
,
'0'
,
'/'
,
'1'
,
'9'
,
'8'
,
'0'
,
'\0'
};
static
const
WCHAR
sz12_date_broken
[]
=
{
'1'
,
'2'
,
'9'
,
'/'
,
'3'
,
'0'
,
'/'
,
'8'
,
'0'
,
'\0'
};
static
const
WCHAR
sz_empty
[]
=
{
'\0'
};
CHAR
orig_date_format
[
128
];
CHAR
orig_date_format
[
128
];
VARTYPE
leftvt
,
rightvt
,
resultvt
;
VARTYPE
leftvt
,
rightvt
,
resultvt
;
HRESULT
hres
;
HRESULT
hres
;
...
@@ -6606,7 +6593,7 @@ static void test_VarCat(void)
...
@@ -6606,7 +6593,7 @@ static void test_VarCat(void)
switch
(
leftvt
)
{
switch
(
leftvt
)
{
case
VT_BSTR
:
case
VT_BSTR
:
V_BSTR
(
&
left
)
=
SysAllocString
(
sz_empty
);
break
;
V_BSTR
(
&
left
)
=
SysAllocString
(
L""
);
break
;
case
VT_DATE
:
case
VT_DATE
:
V_DATE
(
&
left
)
=
0
.
0
;
break
;
V_DATE
(
&
left
)
=
0
.
0
;
break
;
case
VT_DECIMAL
:
case
VT_DECIMAL
:
...
@@ -6617,7 +6604,7 @@ static void test_VarCat(void)
...
@@ -6617,7 +6604,7 @@ static void test_VarCat(void)
switch
(
rightvt
)
{
switch
(
rightvt
)
{
case
VT_BSTR
:
case
VT_BSTR
:
V_BSTR
(
&
right
)
=
SysAllocString
(
sz_empty
);
break
;
V_BSTR
(
&
right
)
=
SysAllocString
(
L""
);
break
;
case
VT_DATE
:
case
VT_DATE
:
V_DATE
(
&
right
)
=
0
.
0
;
break
;
V_DATE
(
&
right
)
=
0
.
0
;
break
;
case
VT_DECIMAL
:
case
VT_DECIMAL
:
...
@@ -6650,9 +6637,9 @@ static void test_VarCat(void)
...
@@ -6650,9 +6637,9 @@ static void test_VarCat(void)
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz12
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L"12"
);
V_BSTR
(
&
right
)
=
SysAllocString
(
sz34
);
V_BSTR
(
&
right
)
=
SysAllocString
(
L"34"
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
sz1234
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
L"1234"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
...
@@ -6665,7 +6652,7 @@ static void test_VarCat(void)
...
@@ -6665,7 +6652,7 @@ static void test_VarCat(void)
/* Test if expression is VT_ERROR */
/* Test if expression is VT_ERROR */
V_VT
(
&
left
)
=
VT_ERROR
;
V_VT
(
&
left
)
=
VT_ERROR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_BSTR
(
&
right
)
=
SysAllocString
(
sz1234
);
V_BSTR
(
&
right
)
=
SysAllocString
(
L"1234"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
DISP_E_TYPEMISMATCH
,
"VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
DISP_E_TYPEMISMATCH
,
"VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx
\n
"
,
hres
);
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
...
@@ -6677,7 +6664,7 @@ static void test_VarCat(void)
...
@@ -6677,7 +6664,7 @@ static void test_VarCat(void)
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_ERROR
;
V_VT
(
&
right
)
=
VT_ERROR
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz1234
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L"1234"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
DISP_E_TYPEMISMATCH
,
"VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
DISP_E_TYPEMISMATCH
,
"VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx
\n
"
,
hres
);
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
...
@@ -6729,7 +6716,7 @@ static void test_VarCat(void)
...
@@ -6729,7 +6716,7 @@ static void test_VarCat(void)
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_INT
(
&
left
)
=
12
;
V_INT
(
&
left
)
=
12
;
V_INT
(
&
right
)
=
34
;
V_INT
(
&
right
)
=
34
;
V_BSTR
(
&
expected
)
=
SysAllocString
(
sz1234
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
L"1234"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
...
@@ -6743,7 +6730,7 @@ static void test_VarCat(void)
...
@@ -6743,7 +6730,7 @@ static void test_VarCat(void)
V_VT
(
&
left
)
=
VT_INT
;
V_VT
(
&
left
)
=
VT_INT
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_INT
(
&
left
)
=
12
;
V_INT
(
&
left
)
=
12
;
V_BSTR
(
&
right
)
=
SysAllocString
(
sz34
);
V_BSTR
(
&
right
)
=
SysAllocString
(
L"34"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
,
...
@@ -6755,7 +6742,7 @@ static void test_VarCat(void)
...
@@ -6755,7 +6742,7 @@ static void test_VarCat(void)
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_INT
;
V_VT
(
&
right
)
=
VT_INT
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz12
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L"12"
);
V_INT
(
&
right
)
=
34
;
V_INT
(
&
right
)
=
34
;
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
...
@@ -6772,10 +6759,10 @@ static void test_VarCat(void)
...
@@ -6772,10 +6759,10 @@ static void test_VarCat(void)
V_VT
(
&
right
)
=
VT_DATE
;
V_VT
(
&
right
)
=
VT_DATE
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected_broken
)
=
VT_BSTR
;
V_VT
(
&
expected_broken
)
=
VT_BSTR
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz12
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L"12"
);
V_DATE
(
&
right
)
=
29494
.
0
;
V_DATE
(
&
right
)
=
29494
.
0
;
V_BSTR
(
&
expected
)
=
SysAllocString
(
sz12_date
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
L"129/30/1980"
);
V_BSTR
(
&
expected_broken
)
=
SysAllocString
(
sz12_date_broken
);
V_BSTR
(
&
expected_broken
)
=
SysAllocString
(
L"129/30/80"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
||
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
||
...
@@ -6793,9 +6780,9 @@ static void test_VarCat(void)
...
@@ -6793,9 +6780,9 @@ static void test_VarCat(void)
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected_broken
)
=
VT_BSTR
;
V_VT
(
&
expected_broken
)
=
VT_BSTR
;
V_DATE
(
&
left
)
=
29494
.
0
;
V_DATE
(
&
left
)
=
29494
.
0
;
V_BSTR
(
&
right
)
=
SysAllocString
(
sz12
);
V_BSTR
(
&
right
)
=
SysAllocString
(
L"12"
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
date_sz12
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
L"9/30/198012"
);
V_BSTR
(
&
expected_broken
)
=
SysAllocString
(
date_sz12_broken
);
V_BSTR
(
&
expected_broken
)
=
SysAllocString
(
L"9/30/8012"
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
||
ok
(
VarCmp
(
&
result
,
&
expected
,
lcid
,
0
)
==
VARCMP_EQ
||
...
@@ -6812,9 +6799,9 @@ static void test_VarCat(void)
...
@@ -6812,9 +6799,9 @@ static void test_VarCat(void)
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
right
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_VT
(
&
expected
)
=
VT_BSTR
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz_empty
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L""
);
V_BSTR
(
&
right
)
=
SysAllocString
(
sz_empty
);
V_BSTR
(
&
right
)
=
SysAllocString
(
L""
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
sz_empty
);
V_BSTR
(
&
expected
)
=
SysAllocString
(
L""
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
VarCmp
(
&
result
,
&
left
,
lcid
,
0
)
==
VARCMP_EQ
,
ok
(
VarCmp
(
&
result
,
&
left
,
lcid
,
0
)
==
VARCMP_EQ
,
...
@@ -6864,7 +6851,7 @@ static void test_VarCat(void)
...
@@ -6864,7 +6851,7 @@ static void test_VarCat(void)
V_DISPATCH
(
&
right
)
=
&
dispatch
.
IDispatch_iface
;
V_DISPATCH
(
&
right
)
=
&
dispatch
.
IDispatch_iface
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_VT
(
&
left
)
=
VT_BSTR
;
V_BSTR
(
&
left
)
=
SysAllocString
(
sz12
);
V_BSTR
(
&
left
)
=
SysAllocString
(
L"12"
);
SET_EXPECT
(
dispatch_invoke
);
SET_EXPECT
(
dispatch_invoke
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
hres
=
VarCat
(
&
left
,
&
right
,
&
result
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"VarCat failed with error 0x%08lx
\n
"
,
hres
);
...
@@ -7654,30 +7641,20 @@ static void test_VarCmp(void)
...
@@ -7654,30 +7641,20 @@ static void test_VarCmp(void)
LCID
lcid
;
LCID
lcid
;
HRESULT
hres
;
HRESULT
hres
;
DECIMAL
dec
;
DECIMAL
dec
;
static
const
WCHAR
szhuh
[]
=
{
'h'
,
'u'
,
'h'
,
'?'
,
'\0'
};
static
const
WCHAR
sz2cents
[]
=
{
'2'
,
'c'
,
'e'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
szempty
[]
=
{
'\0'
};
static
const
WCHAR
sz0
[]
=
{
'0'
,
'\0'
};
static
const
WCHAR
sz1
[]
=
{
'1'
,
'\0'
};
static
const
WCHAR
sz7
[]
=
{
'7'
,
'\0'
};
static
const
WCHAR
sz42
[]
=
{
'4'
,
'2'
,
'\0'
};
static
const
WCHAR
sz1neg
[]
=
{
'-'
,
'1'
,
'\0'
};
static
const
WCHAR
sz666neg
[]
=
{
'-'
,
'6'
,
'6'
,
'6'
,
'\0'
};
static
const
WCHAR
sz1few
[]
=
{
'1'
,
'.'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
'\0'
};
BSTR
bstrhuh
,
bstrempty
,
bstr0
,
bstr1
,
bstr7
,
bstr42
,
bstr1neg
,
bstr666neg
;
BSTR
bstrhuh
,
bstrempty
,
bstr0
,
bstr1
,
bstr7
,
bstr42
,
bstr1neg
,
bstr666neg
;
BSTR
bstr2cents
,
bstr1few
;
BSTR
bstr2cents
,
bstr1few
;
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
bstrempty
=
SysAllocString
(
szempty
);
bstrempty
=
SysAllocString
(
L""
);
bstrhuh
=
SysAllocString
(
szhuh
);
bstrhuh
=
SysAllocString
(
L"huh?"
);
bstr2cents
=
SysAllocString
(
sz2cents
);
bstr2cents
=
SysAllocString
(
L"2cents"
);
bstr0
=
SysAllocString
(
sz0
);
bstr0
=
SysAllocString
(
L"0"
);
bstr1
=
SysAllocString
(
sz1
);
bstr1
=
SysAllocString
(
L"1"
);
bstr7
=
SysAllocString
(
sz7
);
bstr7
=
SysAllocString
(
L"7"
);
bstr42
=
SysAllocString
(
sz42
);
bstr42
=
SysAllocString
(
L"42"
);
bstr1neg
=
SysAllocString
(
sz1neg
);
bstr1neg
=
SysAllocString
(
L"-1"
);
bstr666neg
=
SysAllocString
(
sz666neg
);
bstr666neg
=
SysAllocString
(
L"-666"
);
bstr1few
=
SysAllocString
(
sz1few
);
bstr1few
=
SysAllocString
(
L"1.00000001"
);
/* Test all possible flag/vt combinations & the resulting vt type */
/* Test all possible flag/vt combinations & the resulting vt type */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
...
@@ -7903,8 +7880,6 @@ static HRESULT (WINAPI *pVarPow)(LPVARIANT,LPVARIANT,LPVARIANT);
...
@@ -7903,8 +7880,6 @@ static HRESULT (WINAPI *pVarPow)(LPVARIANT,LPVARIANT,LPVARIANT);
static
void
test_VarPow
(
void
)
static
void
test_VarPow
(
void
)
{
{
static
const
WCHAR
str2
[]
=
{
'2'
,
'\0'
};
static
const
WCHAR
str3
[]
=
{
'3'
,
'\0'
};
VARIANT
left
,
right
,
exp
,
result
,
cy
,
dec
;
VARIANT
left
,
right
,
exp
,
result
,
cy
,
dec
;
BSTR
num2_str
,
num3_str
;
BSTR
num2_str
,
num3_str
;
VARTYPE
i
;
VARTYPE
i
;
...
@@ -7912,8 +7887,8 @@ static void test_VarPow(void)
...
@@ -7912,8 +7887,8 @@ static void test_VarPow(void)
CHECKPTR
(
VarPow
);
CHECKPTR
(
VarPow
);
num2_str
=
SysAllocString
(
str2
);
num2_str
=
SysAllocString
(
L"2"
);
num3_str
=
SysAllocString
(
str3
);
num3_str
=
SysAllocString
(
L"3"
);
/* Test all possible flag/vt combinations & the resulting vt type */
/* Test all possible flag/vt combinations & the resulting vt type */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
...
@@ -8799,8 +8774,6 @@ static HRESULT (WINAPI *pVarIdiv)(LPVARIANT,LPVARIANT,LPVARIANT);
...
@@ -8799,8 +8774,6 @@ static HRESULT (WINAPI *pVarIdiv)(LPVARIANT,LPVARIANT,LPVARIANT);
static
void
test_VarIdiv
(
void
)
static
void
test_VarIdiv
(
void
)
{
{
static
const
WCHAR
str1
[]
=
{
'1'
,
'\0'
};
static
const
WCHAR
str2
[]
=
{
'2'
,
'\0'
};
VARIANT
left
,
right
,
exp
,
result
,
cy
,
dec
;
VARIANT
left
,
right
,
exp
,
result
,
cy
,
dec
;
BSTR
num1_str
,
num2_str
;
BSTR
num1_str
,
num2_str
;
VARTYPE
i
;
VARTYPE
i
;
...
@@ -8808,8 +8781,8 @@ static void test_VarIdiv(void)
...
@@ -8808,8 +8781,8 @@ static void test_VarIdiv(void)
CHECKPTR
(
VarIdiv
);
CHECKPTR
(
VarIdiv
);
num1_str
=
SysAllocString
(
str1
);
num1_str
=
SysAllocString
(
L"1"
);
num2_str
=
SysAllocString
(
str2
);
num2_str
=
SysAllocString
(
L"2"
);
/* Test all possible flag/vt combinations & the resulting vt type */
/* Test all possible flag/vt combinations & the resulting vt type */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ExtraFlags
);
i
++
)
...
...
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