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
27f13b2b
Commit
27f13b2b
authored
Apr 14, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum/tests: Add more tests for IPropertyBag methods.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
208bc5d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
4 deletions
+124
-4
devenum.c
dlls/devenum/tests/devenum.c
+124
-4
No files found.
dlls/devenum/tests/devenum.c
View file @
27f13b2b
...
@@ -310,8 +310,10 @@ static IMoniker *check_display_name_(int line, IParseDisplayName *parser, WCHAR
...
@@ -310,8 +310,10 @@ static IMoniker *check_display_name_(int line, IParseDisplayName *parser, WCHAR
static
void
test_directshow_filter
(
void
)
static
void
test_directshow_filter
(
void
)
{
{
SAFEARRAYBOUND
bound
=
{.
cElements
=
10
};
IParseDisplayName
*
parser
;
IParseDisplayName
*
parser
;
IPropertyBag
*
prop_bag
;
IPropertyBag
*
prop_bag
;
void
*
array_data
;
IMoniker
*
mon
;
IMoniker
*
mon
;
WCHAR
buffer
[
200
];
WCHAR
buffer
[
200
];
LRESULT
res
;
LRESULT
res
;
...
@@ -348,9 +350,72 @@ static void test_directshow_filter(void)
...
@@ -348,9 +350,72 @@ static void test_directshow_filter(void)
ok
(
find_moniker
(
&
CLSID_AudioRendererCategory
,
mon
),
"filter should be registered
\n
"
);
ok
(
find_moniker
(
&
CLSID_AudioRendererCategory
,
mon
),
"filter should be registered
\n
"
);
VariantClear
(
&
var
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Read failed: %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"Got name %s.
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_LPWSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_BSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"Got name %s.
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
V_VT
(
&
var
)
=
VT_LPWSTR
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"FriendlyName"
,
&
var
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0xdeadbeef
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_I4
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
V_I4
(
&
var
)
==
0xdeadbeef
,
"Got value %#x.
\n
"
,
V_I4
(
&
var
));
V_VT
(
&
var
)
=
VT_UI4
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_BSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_I4
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_I4
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
V_I4
(
&
var
)
==
0xdeadbeef
,
"Got value %#x.
\n
"
,
V_I4
(
&
var
));
V_VT
(
&
var
)
=
VT_UI4
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_ARRAY
|
VT_UI1
;
V_ARRAY
(
&
var
)
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
bound
);
SafeArrayAccessData
(
V_ARRAY
(
&
var
),
&
array_data
);
memcpy
(
array_data
,
"test data"
,
10
);
SafeArrayUnaccessData
(
V_ARRAY
(
&
var
));
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
(
VT_ARRAY
|
VT_UI1
),
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
SafeArrayAccessData
(
V_ARRAY
(
&
var
),
&
array_data
);
ok
(
!
memcmp
(
array_data
,
"test data"
,
10
),
"Got wrong data.
\n
"
);
SafeArrayUnaccessData
(
V_ARRAY
(
&
var
));
IMoniker_Release
(
mon
);
IMoniker_Release
(
mon
);
...
@@ -405,8 +470,10 @@ static void test_directshow_filter(void)
...
@@ -405,8 +470,10 @@ static void test_directshow_filter(void)
static
void
test_codec
(
void
)
static
void
test_codec
(
void
)
{
{
SAFEARRAYBOUND
bound
=
{.
cElements
=
10
};
IParseDisplayName
*
parser
;
IParseDisplayName
*
parser
;
IPropertyBag
*
prop_bag
;
IPropertyBag
*
prop_bag
;
void
*
array_data
;
IMoniker
*
mon
;
IMoniker
*
mon
;
WCHAR
buffer
[
200
];
WCHAR
buffer
[
200
];
VARIANT
var
;
VARIANT
var
;
...
@@ -436,10 +503,63 @@ static void test_codec(void)
...
@@ -436,10 +503,63 @@ static void test_codec(void)
hr
=
IPropertyBag_Write
(
prop_bag
,
L"FriendlyName"
,
&
var
);
hr
=
IPropertyBag_Write
(
prop_bag
,
L"FriendlyName"
,
&
var
);
ok
(
hr
==
S_OK
,
"Write failed: %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Write failed: %#x
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_LPWSTR
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"FriendlyName"
,
&
var
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
VariantClear
(
&
var
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Read failed: %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"Got name %s.
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_LPWSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_BSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
L"test"
),
"Got name %s.
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0xdeadbeef
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_I4
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
V_I4
(
&
var
)
==
0xdeadbeef
,
"Got value %#x.
\n
"
,
V_I4
(
&
var
));
V_VT
(
&
var
)
=
VT_UI4
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_BSTR
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_I4
;
hr
=
IPropertyBag_Read
(
prop_bag
,
L"foobar"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
V_VT
(
&
var
)
==
VT_I4
,
"Got type %#x.
\n
"
,
V_VT
(
&
var
));
ok
(
V_I4
(
&
var
)
==
0xdeadbeef
,
"Got value %#x.
\n
"
,
V_I4
(
&
var
));
V_VT
(
&
var
)
=
VT_UI4
;
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_ARRAY
|
VT_UI1
;
V_ARRAY
(
&
var
)
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
bound
);
SafeArrayAccessData
(
V_ARRAY
(
&
var
),
&
array_data
);
memcpy
(
array_data
,
"test data"
,
10
);
SafeArrayUnaccessData
(
V_ARRAY
(
&
var
));
hr
=
IPropertyBag_Write
(
prop_bag
,
L"foobar"
,
&
var
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* unlike DirectShow filters, these are automatically generated, so
/* unlike DirectShow filters, these are automatically generated, so
* enumerating them will destroy the key */
* enumerating them will destroy the key */
...
...
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