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
bf20ca1d
Commit
bf20ca1d
authored
Dec 13, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Dec 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Make aggregation test generic.
parent
1733875f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
31 deletions
+33
-31
videorenderer.c
dlls/quartz/tests/videorenderer.c
+33
-31
No files found.
dlls/quartz/tests/videorenderer.c
View file @
bf20ca1d
...
@@ -43,19 +43,20 @@
...
@@ -43,19 +43,20 @@
static
IUnknown
*
pVideoRenderer
=
NULL
;
static
IUnknown
*
pVideoRenderer
=
NULL
;
static
void
test_aggregation
(
void
)
static
void
test_aggregation
(
const
CLSID
clsidOuter
,
const
CLSID
clsidInner
,
const
IID
iidOuter
,
const
IID
iidInner
)
{
{
HRESULT
hr
;
HRESULT
hr
;
IUnknown
*
pUnkOuter
=
NULL
;
IUnknown
*
pUnkOuter
=
NULL
;
IUnknown
*
pUnkInner
=
NULL
;
IUnknown
*
pUnkInner
=
NULL
;
I
VideoWindow
*
pVideoWindowInner
=
NULL
;
I
Unknown
*
pUnkInnerFail
=
NULL
;
IUnknown
*
pUnkOuterTest
=
NULL
;
IUnknown
*
pUnkOuterTest
=
NULL
;
IUnknown
*
pUnkInnerTest
=
NULL
;
IUnknown
*
pUnkInnerTest
=
NULL
;
I
VideoWindow
*
pVideoWindowTest
=
NULL
;
I
Unknown
*
pUnkAggregatee
=
NULL
;
I
ReferenceClock
*
pReferenceClockTest
=
NULL
;
I
Unknown
*
pUnkAggregator
=
NULL
;
IUnknown
*
pUnkTest
=
NULL
;
IUnknown
*
pUnkTest
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_SystemClock
,
NULL
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
&
clsidOuter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkOuter
);
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkOuter
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with %x
\n
"
,
hr
);
ok
(
pUnkOuter
!=
NULL
,
"pUnkOuter is NULL
\n
"
);
ok
(
pUnkOuter
!=
NULL
,
"pUnkOuter is NULL
\n
"
);
...
@@ -67,13 +68,13 @@ static void test_aggregation(void)
...
@@ -67,13 +68,13 @@ static void test_aggregation(void)
}
}
/* for aggregation, we should only be able to request IUnknown */
/* for aggregation, we should only be able to request IUnknown */
hr
=
CoCreateInstance
(
&
CLSID_VideoRender
er
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
&
clsidInn
er
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
&
IID_IVideoWindow
,
(
LPVOID
*
)
&
pVideoWindowInner
);
&
iidInner
,
(
LPVOID
*
)
&
pUnkInnerFail
);
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstance returned %x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"CoCreateInstance returned %x
\n
"
,
hr
);
ok
(
p
VideoWindowInner
==
NULL
,
"pVideoWindowInner
is not NULL
\n
"
);
ok
(
p
UnkInnerFail
==
NULL
,
"pUnkInnerFail
is not NULL
\n
"
);
/* aggregation, request IUnknown */
/* aggregation, request IUnknown */
hr
=
CoCreateInstance
(
&
CLSID_VideoRender
er
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
hr
=
CoCreateInstance
(
&
clsidInn
er
,
pUnkOuter
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkInner
);
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnkInner
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned %x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CoCreateInstance returned %x
\n
"
,
hr
);
ok
(
pUnkInner
!=
NULL
,
"pUnkInner is NULL
\n
"
);
ok
(
pUnkInner
!=
NULL
,
"pUnkInner is NULL
\n
"
);
...
@@ -89,49 +90,49 @@ static void test_aggregation(void)
...
@@ -89,49 +90,49 @@ static void test_aggregation(void)
RELEASE_EXPECT
(
pUnkOuter
,
1
);
RELEASE_EXPECT
(
pUnkOuter
,
1
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
QI_FAIL
(
pUnkOuter
,
IID_IVideoWindow
,
pVideoWindowTest
);
QI_FAIL
(
pUnkOuter
,
iidInner
,
pUnkAggregatee
);
QI_FAIL
(
pUnkInner
,
IID_IReferenceClock
,
pReferenceClockTest
);
QI_FAIL
(
pUnkInner
,
iidOuter
,
pUnkAggregator
);
/* these QueryInterface calls should work */
/* these QueryInterface calls should work */
QI_SUCCEED
(
pUnkOuter
,
IID_IReferenceClock
,
pReferenceClockTest
);
QI_SUCCEED
(
pUnkOuter
,
iidOuter
,
pUnkAggregator
);
QI_SUCCEED
(
pUnkOuter
,
IID_IUnknown
,
pUnkOuterTest
);
QI_SUCCEED
(
pUnkOuter
,
IID_IUnknown
,
pUnkOuterTest
);
QI_SUCCEED
(
pUnkInner
,
IID_IVideoWindow
,
pVideoWindowTest
);
QI_SUCCEED
(
pUnkInner
,
iidInner
,
pUnkAggregatee
);
QI_SUCCEED
(
pUnkInner
,
IID_IUnknown
,
pUnkInnerTest
);
QI_SUCCEED
(
pUnkInner
,
IID_IUnknown
,
pUnkInnerTest
);
if
(
!
p
ReferenceClockTest
||
!
pUnkOuterTest
||
!
pVideoWindowTest
\
if
(
!
p
UnkAggregator
||
!
pUnkOuterTest
||
!
pUnkAggregatee
\
||
!
pUnkInnerTest
)
||
!
pUnkInnerTest
)
{
{
skip
(
"One of the required interfaces is NULL
\n
"
);
skip
(
"One of the required interfaces is NULL
\n
"
);
return
;
return
;
}
}
ADDREF_EXPECT
(
p
ReferenceClockTest
,
5
);
ADDREF_EXPECT
(
p
UnkAggregator
,
5
);
ADDREF_EXPECT
(
pUnkOuterTest
,
6
);
ADDREF_EXPECT
(
pUnkOuterTest
,
6
);
ADDREF_EXPECT
(
p
VideoWindowTest
,
7
);
ADDREF_EXPECT
(
p
UnkAggregatee
,
7
);
ADDREF_EXPECT
(
pUnkInnerTest
,
3
);
ADDREF_EXPECT
(
pUnkInnerTest
,
3
);
RELEASE_EXPECT
(
p
ReferenceClockTest
,
6
);
RELEASE_EXPECT
(
p
UnkAggregator
,
6
);
RELEASE_EXPECT
(
pUnkOuterTest
,
5
);
RELEASE_EXPECT
(
pUnkOuterTest
,
5
);
RELEASE_EXPECT
(
p
VideoWindowTest
,
4
);
RELEASE_EXPECT
(
p
UnkAggregatee
,
4
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
QI_SUCCEED
(
p
ReferenceClockTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
p
UnkAggregator
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
p
VideoWindowTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
p
UnkAggregatee
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
IID_IUnknown
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
IID_IUnknown
,
pUnkTest
);
QI_FAIL
(
p
ReferenceClockTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_FAIL
(
p
UnkAggregator
,
iidInner
,
pUnkTest
);
QI_FAIL
(
pUnkOuterTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_FAIL
(
pUnkOuterTest
,
iidInner
,
pUnkTest
);
QI_FAIL
(
p
VideoWindowTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_FAIL
(
p
UnkAggregatee
,
iidInner
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
IID_IVideoWindow
,
pUnkTest
);
QI_SUCCEED
(
pUnkInnerTest
,
iidInner
,
pUnkTest
);
QI_SUCCEED
(
p
ReferenceClockTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_SUCCEED
(
p
UnkAggregator
,
iidOuter
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_SUCCEED
(
pUnkOuterTest
,
iidOuter
,
pUnkTest
);
QI_SUCCEED
(
p
VideoWindowTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_SUCCEED
(
p
UnkAggregatee
,
iidOuter
,
pUnkTest
);
QI_FAIL
(
pUnkInnerTest
,
IID_IReferenceClock
,
pUnkTest
);
QI_FAIL
(
pUnkInnerTest
,
iidOuter
,
pUnkTest
);
RELEASE_EXPECT
(
p
ReferenceClockTest
,
10
);
RELEASE_EXPECT
(
p
UnkAggregator
,
10
);
RELEASE_EXPECT
(
pUnkOuterTest
,
9
);
RELEASE_EXPECT
(
pUnkOuterTest
,
9
);
RELEASE_EXPECT
(
p
VideoWindowTest
,
8
);
RELEASE_EXPECT
(
p
UnkAggregatee
,
8
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
RELEASE_EXPECT
(
pUnkInnerTest
,
2
);
RELEASE_EXPECT
(
pUnkOuter
,
7
);
RELEASE_EXPECT
(
pUnkOuter
,
7
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
RELEASE_EXPECT
(
pUnkInner
,
1
);
...
@@ -196,7 +197,8 @@ START_TEST(videorenderer)
...
@@ -196,7 +197,8 @@ START_TEST(videorenderer)
return
;
return
;
test_query_interface
();
test_query_interface
();
test_aggregation
();
test_aggregation
(
CLSID_SystemClock
,
CLSID_VideoRenderer
,
IID_IReferenceClock
,
IID_IVideoWindow
);
release_video_renderer
();
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