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
766046d4
Commit
766046d4
authored
Dec 13, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Dec 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Add videorenderer aggregation test.
parent
4f6f1bcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
0 deletions
+103
-0
videorenderer.c
dlls/quartz/tests/videorenderer.c
+103
-0
No files found.
dlls/quartz/tests/videorenderer.c
View file @
766046d4
...
...
@@ -27,6 +27,10 @@
ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \
ok(ppv != NULL, "Pointer is NULL\n");
#define QI_FAIL(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface returned %x\n", hr); \
ok(ppv == NULL, "Pointer is %p\n", ppv);
#define ADDREF_EXPECT(iface, num) if (iface) { \
hr = IUnknown_AddRef(iface); \
ok(hr == num, "IUnknown_AddRef should return %d, got %d\n", num, hr); \
...
...
@@ -39,6 +43,104 @@
static
IUnknown
*
pVideoRenderer
=
NULL
;
static
void
test_aggregation
(
void
)
{
HRESULT
hr
;
IUnknown
*
pUnkOuter
=
NULL
;
IUnknown
*
pUnkInner
=
NULL
;
IVideoWindow
*
pVideoWindowInner
=
NULL
;
IUnknown
*
pUnkOuterTest
=
NULL
;
IUnknown
*
pUnkInnerTest
=
NULL
;
IVideoWindow
*
pVideoWindowTest
=
NULL
;
IReferenceClock
*
pReferenceClockTest
=
NULL
;
IUnknown
*
pUnkTest
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_SystemClock
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkOuter
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with %x
\n
"
,
hr
);
ok
(
pUnkOuter
!=
NULL
,
"pUnkOuter is NULL
\n
"
);
if
(
!
pUnkOuter
)
{
skip
(
"pUnkOuter is NULL
\n
"
);
return
;
}
/* for aggregation, we should only be able to request IUnknown */
hr
=
CoCreateInstance
(
&
CLSID_VideoRenderer
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
&
IID_IVideoWindow
,
(
LPVOID
*
)
&
pVideoWindowInner
);
todo_wine
{
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstance returned %x
\n
"
,
hr
);
}
ok
(
pVideoWindowInner
==
NULL
,
"pVideoWindowInner is not NULL
\n
"
);
/* aggregation, request IUnknown */
hr
=
CoCreateInstance
(
&
CLSID_VideoRenderer
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkInner
);
todo_wine
{
ok
(
hr
==
S_OK
,
"CoCreateInstance returned %x
\n
"
,
hr
);
ok
(
pUnkInner
!=
NULL
,
"pUnkInner is NULL
\n
"
);
}
if
(
!
pUnkInner
)
{
skip
(
"pUnkInner is NULL
\n
"
);
return
;
}
ADDREF_EXPECT
(
pUnkOuter
,
2
);
ADDREF_EXPECT
(
pUnkInner
,
2
);
RELEASE_EXPECT
(
pUnkOuter
,
1
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
QI_FAIL
(
pUnkOuter
,
IID_IVideoWindow
,
pVideoWindowTest
);
QI_FAIL
(
pUnkInner
,
IID_IReferenceClock
,
pReferenceClockTest
);
/* these QueryInterface calls should work */
QI_SUCCEED
(
pUnkOuter
,
IID_IReferenceClock
,
pReferenceClockTest
);
QI_SUCCEED
(
pUnkOuter
,
IID_IUnknown
,
pUnkOuterTest
);
QI_SUCCEED
(
pUnkInner
,
IID_IVideoWindow
,
pVideoWindowTest
);
QI_SUCCEED
(
pUnkInner
,
IID_IUnknown
,
pUnkInnerTest
);
if
(
!
pReferenceClockTest
||
!
pUnkOuterTest
||
!
pVideoWindowTest
\
||
!
pUnkInnerTest
)
{
skip
(
"One of the required interfaces is NULL
\n
"
);
return
;
}
ADDREF_EXPECT
(
pReferenceClockTest
,
5
);
ADDREF_EXPECT
(
pUnkOuterTest
,
6
);
ADDREF_EXPECT
(
pVideoWindowTest
,
7
);
ADDREF_EXPECT
(
pUnkInnerTest
,
3
);
RELEASE_EXPECT
(
pReferenceClockTest
,
6
);
RELEASE_EXPECT
(
pUnkOuterTest
,
5
);
RELEASE_EXPECT
(
pVideoWindowTest
,
4
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
QI_SUCCEED
(
pReferenceClockTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pVideoWindowTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
IID_IUnknown
,
pUnkTest
);
QI_FAIL
(
pReferenceClockTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_FAIL
(
pUnkOuterTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_FAIL
(
pVideoWindowTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_SUCCEED
(
pReferenceClockTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_SUCCEED
(
pVideoWindowTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_FAIL
(
pUnkInnerTest
,
IID_IReferenceClock
,
pUnkTest
);
RELEASE_EXPECT
(
pReferenceClockTest
,
10
);
RELEASE_EXPECT
(
pUnkOuterTest
,
9
);
RELEASE_EXPECT
(
pVideoWindowTest
,
8
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
RELEASE_EXPECT
(
pUnkOuter
,
7
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
}
static
int
create_video_renderer
(
void
)
{
HRESULT
hr
;
...
...
@@ -98,6 +200,7 @@ START_TEST(videorenderer)
return
;
test_query_interface
();
test_aggregation
();
release_video_renderer
();
}
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