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
2e2fc550
Commit
2e2fc550
authored
Feb 07, 2019
by
Jactry Zeng
Committed by
Alexandre Julliard
Feb 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys/tests: Add tests of IPropertyStore interface.
Signed-off-by:
Jactry Zeng
<
jzeng@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
906f91db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
propstore.c
dlls/propsys/tests/propstore.c
+60
-0
No files found.
dlls/propsys/tests/propstore.c
View file @
2e2fc550
...
...
@@ -34,6 +34,7 @@
#include "initguid.h"
DEFINE_GUID
(
PKEY_WineTest
,
0x7b317433
,
0xdfa3
,
0x4c44
,
0xad
,
0x3e
,
0x2f
,
0x80
,
0x4b
,
0x90
,
0xdb
,
0xf4
);
DEFINE_GUID
(
DUMMY_GUID1
,
0x12345678
,
0x1234
,
0x1234
,
0x12
,
0x13
,
0x14
,
0x15
,
0x16
,
0x17
,
0x18
,
0x19
);
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown *)obj, ref, __LINE__)
static
void
_expect_ref
(
IUnknown
*
obj
,
ULONG
ref
,
int
line
)
...
...
@@ -302,6 +303,64 @@ static void test_PSCreateMemoryPropertyStore(void)
IPropertyStoreCache_Release
(
propstorecache
);
}
static
void
test_propertystore
(
void
)
{
IPropertyStore
*
propstore
;
HRESULT
hr
;
PROPVARIANT
propvar
,
ret_propvar
;
PROPERTYKEY
propkey
;
DWORD
count
=
0
;
hr
=
PSCreateMemoryPropertyStore
(
&
IID_IPropertyStore
,
(
void
**
)
&
propstore
);
ok
(
hr
==
S_OK
,
"PSCreateMemoryPropertyStore failed: 0x%08x.
\n
"
,
hr
);
ok
(
propstore
!=
NULL
,
"got %p.
\n
"
,
propstore
);
hr
=
IPropertyStore_GetCount
(
propstore
,
&
count
);
ok
(
hr
==
S_OK
,
"IPropertyStore_GetCount failed: 0x%08x.
\n
"
,
hr
);
ok
(
!
count
,
"got wrong property count: %d, expected 0.
\n
"
,
count
);
PropVariantInit
(
&
propvar
);
propvar
.
vt
=
VT_I4
;
U
(
propvar
).
lVal
=
123
;
propkey
.
fmtid
=
DUMMY_GUID1
;
propkey
.
pid
=
PID_FIRST_USABLE
;
hr
=
IPropertyStore_SetValue
(
propstore
,
&
propkey
,
&
propvar
);
ok
(
hr
==
S_OK
,
"IPropertyStore_SetValue failed: 0x%08x.
\n
"
,
hr
);
hr
=
IPropertyStore_Commit
(
propstore
);
ok
(
hr
==
S_OK
,
"IPropertyStore_Commit failed: 0x%08x.
\n
"
,
hr
);
hr
=
IPropertyStore_GetCount
(
propstore
,
&
count
);
ok
(
hr
==
S_OK
,
"IPropertyStore_GetCount failed: 0x%08x.
\n
"
,
hr
);
ok
(
count
==
1
,
"got wrong property count: %d, expected 1.
\n
"
,
count
);
PropVariantInit
(
&
ret_propvar
);
ret_propvar
.
vt
=
VT_I4
;
hr
=
IPropertyStore_GetValue
(
propstore
,
&
propkey
,
&
ret_propvar
);
ok
(
hr
==
S_OK
,
"IPropertyStore_GetValue failed: 0x%08x.
\n
"
,
hr
);
ok
(
ret_propvar
.
vt
==
VT_I4
,
"got wrong property type: %x.
\n
"
,
ret_propvar
.
vt
);
ok
(
U
(
ret_propvar
).
lVal
==
123
,
"got wrong value: %d, expected 123.
\n
"
,
U
(
ret_propvar
).
lVal
);
PropVariantClear
(
&
propvar
);
PropVariantClear
(
&
ret_propvar
);
PropVariantInit
(
&
propvar
);
propkey
.
fmtid
=
DUMMY_GUID1
;
propkey
.
pid
=
PID_FIRST_USABLE
;
hr
=
IPropertyStore_SetValue
(
propstore
,
&
propkey
,
&
propvar
);
ok
(
hr
==
S_OK
,
"IPropertyStore_SetValue failed: 0x%08x.
\n
"
,
hr
);
hr
=
IPropertyStore_Commit
(
propstore
);
ok
(
hr
==
S_OK
,
"IPropertyStore_Commit failed: 0x%08x.
\n
"
,
hr
);
hr
=
IPropertyStore_GetCount
(
propstore
,
&
count
);
ok
(
hr
==
S_OK
,
"IPropertyStore_GetCount failed: 0x%08x.
\n
"
,
hr
);
ok
(
count
==
1
,
"got wrong property count: %d, expected 1.
\n
"
,
count
);
PropVariantInit
(
&
ret_propvar
);
hr
=
IPropertyStore_GetValue
(
propstore
,
&
propkey
,
&
ret_propvar
);
ok
(
hr
==
S_OK
,
"IPropertyStore_GetValue failed: 0x%08x.
\n
"
,
hr
);
ok
(
ret_propvar
.
vt
==
VT_EMPTY
,
"got wrong property type: %x.
\n
"
,
ret_propvar
.
vt
);
ok
(
!
U
(
ret_propvar
).
lVal
,
"got wrong value: %d, expected 0.
\n
"
,
U
(
ret_propvar
).
lVal
);
PropVariantClear
(
&
propvar
);
PropVariantClear
(
&
ret_propvar
);
IPropertyStore_Release
(
propstore
);
}
START_TEST
(
propstore
)
{
CoInitialize
(
NULL
);
...
...
@@ -309,6 +368,7 @@ START_TEST(propstore)
test_inmemorystore
();
test_persistserialized
();
test_PSCreateMemoryPropertyStore
();
test_propertystore
();
CoUninitialize
();
}
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