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
208de163
Commit
208de163
authored
Sep 19, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys/tests: Added PropVariantToGUID tests.
parent
4646ed19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
propsys.c
dlls/propsys/tests/propsys.c
+72
-0
propvarutil.h
include/propvarutil.h
+2
-0
No files found.
dlls/propsys/tests/propsys.c
View file @
208de163
...
...
@@ -40,6 +40,11 @@ DEFINE_GUID(expect_guid, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x5
static
char
*
show_guid
(
const
GUID
*
guid
,
char
*
buf
)
{
static
char
static_buf
[
40
];
if
(
!
buf
)
buf
=
static_buf
;
sprintf
(
buf
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
...
...
@@ -562,6 +567,72 @@ static void test_InitPropVariantFromBuffer(void)
VariantClear
(
&
var
);
}
static
void
test_PropVariantToGUID
(
void
)
{
PROPVARIANT
propvar
;
VARIANT
var
;
GUID
guid
;
HRESULT
hres
;
hres
=
InitPropVariantFromGUIDAsString
(
&
IID_NULL
,
&
propvar
);
ok
(
hres
==
S_OK
,
"InitPropVariantFromGUIDAsString failed %x
\n
"
,
hres
);
hres
=
PropVariantToGUID
(
&
propvar
,
&
guid
);
ok
(
hres
==
S_OK
,
"PropVariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
IID_NULL
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
PropVariantClear
(
&
propvar
);
hres
=
InitPropVariantFromGUIDAsString
(
&
dummy_guid
,
&
propvar
);
ok
(
hres
==
S_OK
,
"InitPropVariantFromGUIDAsString failed %x
\n
"
,
hres
);
hres
=
PropVariantToGUID
(
&
propvar
,
&
guid
);
ok
(
hres
==
S_OK
,
"PropVariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
dummy_guid
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
ok
(
propvar
.
vt
==
VT_LPWSTR
,
"incorrect PROPVARIANT type: %d
\n
"
,
propvar
.
vt
);
propvar
.
u
.
pwszVal
[
1
]
=
'd'
;
propvar
.
u
.
pwszVal
[
2
]
=
'E'
;
propvar
.
u
.
pwszVal
[
3
]
=
'a'
;
hres
=
PropVariantToGUID
(
&
propvar
,
&
guid
);
ok
(
hres
==
S_OK
,
"PropVariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
dummy_guid
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
propvar
.
u
.
pwszVal
[
1
]
=
'z'
;
hres
=
PropVariantToGUID
(
&
propvar
,
&
guid
);
ok
(
hres
==
E_INVALIDARG
,
"PropVariantToGUID returned %x
\n
"
,
hres
);
PropVariantClear
(
&
propvar
);
hres
=
InitVariantFromGUIDAsString
(
&
IID_NULL
,
&
var
);
ok
(
hres
==
S_OK
,
"InitVariantFromGUIDAsString failed %x
\n
"
,
hres
);
hres
=
VariantToGUID
(
&
var
,
&
guid
);
ok
(
hres
==
S_OK
,
"VariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
IID_NULL
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
VariantClear
(
&
var
);
hres
=
InitVariantFromGUIDAsString
(
&
dummy_guid
,
&
var
);
ok
(
hres
==
S_OK
,
"InitVariantFromGUIDAsString failed %x
\n
"
,
hres
);
hres
=
VariantToGUID
(
&
var
,
&
guid
);
ok
(
hres
==
S_OK
,
"VariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
dummy_guid
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"incorrect VARIANT type: %d
\n
"
,
V_VT
(
&
var
));
V_BSTR
(
&
var
)[
1
]
=
'z'
;
hres
=
VariantToGUID
(
&
var
,
&
guid
);
ok
(
hres
==
E_FAIL
,
"VariantToGUID returned %x
\n
"
,
hres
);
V_BSTR
(
&
var
)[
1
]
=
'd'
;
propvar
.
vt
=
V_VT
(
&
var
);
propvar
.
u
.
bstrVal
=
V_BSTR
(
&
var
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hres
=
PropVariantToGUID
(
&
propvar
,
&
guid
);
ok
(
hres
==
S_OK
,
"PropVariantToGUID failed %x
\n
"
,
hres
);
ok
(
!
memcmp
(
&
dummy_guid
,
&
guid
,
sizeof
(
GUID
)),
"incorrect GUID created: %s
\n
"
,
show_guid
(
&
guid
,
NULL
));
PropVariantClear
(
&
propvar
);
}
START_TEST
(
propsys
)
{
test_PSStringFromPropertyKey
();
...
...
@@ -569,4 +640,5 @@ START_TEST(propsys)
test_PSRefreshPropertySchema
();
test_InitPropVariantFromGUIDAsString
();
test_InitPropVariantFromBuffer
();
test_PropVariantToGUID
();
}
include/propvarutil.h
View file @
208de163
...
...
@@ -41,6 +41,8 @@ HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropv
HRESULT
WINAPI
InitVariantFromGUIDAsString
(
REFGUID
guid
,
VARIANT
*
pvar
);
HRESULT
WINAPI
InitPropVariantFromBuffer
(
const
VOID
*
pv
,
UINT
cb
,
PROPVARIANT
*
ppropvar
);
HRESULT
WINAPI
InitVariantFromBuffer
(
const
VOID
*
pv
,
UINT
cb
,
VARIANT
*
pvar
);
HRESULT
WINAPI
PropVariantToGUID
(
const
PROPVARIANT
*
ppropvar
,
GUID
*
guid
);
HRESULT
WINAPI
VariantToGUID
(
const
VARIANT
*
pvar
,
GUID
*
guid
);
#ifdef __cplusplus
...
...
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