Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
718f0956
Commit
718f0956
authored
Oct 04, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add tests for StgConvertVariantToProperty.
parent
04eaae5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
+93
-0
propvariant.c
dlls/ole32/tests/propvariant.c
+93
-0
No files found.
dlls/ole32/tests/propvariant.c
View file @
718f0956
...
...
@@ -408,9 +408,102 @@ static void test_propertytovariant(void)
PropVariantClear
(
&
propvar
);
}
static
void
test_varianttoproperty
(
void
)
{
HANDLE
hole32
;
PROPVARIANT
propvar
;
SERIALIZEDPROPERTYVALUE
*
propvalue
,
*
own_propvalue
;
SERIALIZEDPROPERTYVALUE
*
(
__stdcall
*
pStgConvertVariantToProperty
)(
const
PROPVARIANT
*
,
USHORT
,
SERIALIZEDPROPERTYVALUE
*
,
ULONG
*
,
PROPID
,
BOOLEAN
,
ULONG
*
);
ULONG
len
;
static
const
WCHAR
test_string
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
BSTR
test_string_bstr
;
hole32
=
GetModuleHandleA
(
"ole32"
);
pStgConvertVariantToProperty
=
(
void
*
)
GetProcAddress
(
hole32
,
"StgConvertVariantToProperty"
);
if
(
!
pStgConvertVariantToProperty
)
{
win_skip
(
"StgConvertVariantToProperty not available
\n
"
);
return
;
}
own_propvalue
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SERIALIZEDPROPERTYVALUE
)
+
20
);
PropVariantInit
(
&
propvar
);
propvar
.
vt
=
VT_I4
;
U
(
propvar
).
lVal
=
0xfeabcdef
;
len
=
0xdeadbeef
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_WINUNICODE
,
NULL
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
NULL
,
"got nonnull propvalue
\n
"
);
todo_wine
ok
(
len
==
8
,
"unexpected length %d
\n
"
,
len
);
if
(
len
==
0xdeadbeef
)
{
return
;
}
len
=
20
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_WINUNICODE
,
own_propvalue
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
own_propvalue
,
"unexpected propvalue %p
\n
"
,
propvalue
);
ok
(
len
==
8
,
"unexpected length %d
\n
"
,
len
);
ok
(
!
memcmp
(
propvalue
,
serialized_i4
,
8
),
"got wrong data
\n
"
);
propvar
.
vt
=
VT_EMPTY
;
len
=
20
;
own_propvalue
->
dwType
=
0xdeadbeef
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_WINUNICODE
,
own_propvalue
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
own_propvalue
,
"unexpected propvalue %p
\n
"
,
propvalue
);
ok
(
len
==
0
,
"unexpected length %d
\n
"
,
len
);
ok
(
propvalue
->
dwType
==
0xdeadbeef
,
"unexpected type %d
\n
"
,
propvalue
->
dwType
);
propvar
.
vt
=
VT_NULL
;
len
=
20
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_WINUNICODE
,
own_propvalue
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
own_propvalue
,
"unexpected propvalue %p
\n
"
,
propvalue
);
ok
(
len
==
4
,
"unexpected length %d
\n
"
,
len
);
ok
(
!
memcmp
(
propvalue
,
serialized_null
,
4
),
"got wrong data
\n
"
);
test_string_bstr
=
SysAllocString
(
test_string
);
propvar
.
vt
=
VT_BSTR
;
U
(
propvar
).
bstrVal
=
test_string_bstr
;
len
=
20
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_WINUNICODE
,
own_propvalue
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
own_propvalue
,
"unexpected propvalue %p
\n
"
,
propvalue
);
ok
(
len
==
20
,
"unexpected length %d
\n
"
,
len
);
ok
(
!
memcmp
(
propvalue
,
serialized_bstr_wc
,
20
),
"got wrong data
\n
"
);
len
=
20
;
propvalue
=
pStgConvertVariantToProperty
(
&
propvar
,
CP_UTF8
,
own_propvalue
,
&
len
,
0
,
FALSE
,
0
);
ok
(
propvalue
==
own_propvalue
,
"unexpected propvalue %p
\n
"
,
propvalue
);
ok
(
len
==
16
,
"unexpected length %d
\n
"
,
len
);
ok
(
!
memcmp
(
propvalue
,
serialized_bstr_mb
,
16
),
"got wrong data
\n
"
);
SysFreeString
(
test_string_bstr
);
HeapFree
(
GetProcessHeap
(),
0
,
own_propvalue
);
}
START_TEST
(
propvariant
)
{
test_validtypes
();
test_copy
();
test_propertytovariant
();
test_varianttoproperty
();
}
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