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
59376f12
Commit
59376f12
authored
Oct 31, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit/tests: Test receiving EC_COMPLETE when not connected.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
74b59516
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
+104
-0
nullrenderer.c
dlls/qedit/tests/nullrenderer.c
+104
-0
No files found.
dlls/qedit/tests/nullrenderer.c
View file @
59376f12
...
...
@@ -32,6 +32,15 @@ static IBaseFilter *create_null_renderer(void)
return
filter
;
}
static
IFilterGraph2
*
create_graph
(
void
)
{
IFilterGraph2
*
ret
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_FilterGraph
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFilterGraph2
,
(
void
**
)
&
ret
);
ok
(
hr
==
S_OK
,
"Failed to create FilterGraph: %#x
\n
"
,
hr
);
return
ret
;
}
static
ULONG
get_refcount
(
void
*
iface
)
{
IUnknown
*
unknown
=
iface
;
...
...
@@ -791,6 +800,34 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
IMediaControl_Release
(
control
);
}
static
unsigned
int
check_event_code
(
IMediaEvent
*
eventsrc
,
DWORD
timeout
,
LONG
expected_code
,
LONG_PTR
expected1
,
LONG_PTR
expected2
)
{
LONG_PTR
param1
,
param2
;
unsigned
int
ret
=
0
;
HRESULT
hr
;
LONG
code
;
while
((
hr
=
IMediaEvent_GetEvent
(
eventsrc
,
&
code
,
&
param1
,
&
param2
,
timeout
))
==
S_OK
)
{
if
(
code
==
expected_code
)
{
ok
(
param1
==
expected1
,
"Got param1 %#lx.
\n
"
,
param1
);
ok
(
param2
==
expected2
,
"Got param2 %#lx.
\n
"
,
param2
);
ret
++
;
}
IMediaEvent_FreeEventParams
(
eventsrc
,
code
,
param1
,
param2
);
timeout
=
0
;
}
ok
(
hr
==
E_ABORT
,
"Got hr %#x.
\n
"
,
hr
);
return
ret
;
}
static
unsigned
int
check_ec_complete
(
IMediaEvent
*
eventsrc
,
DWORD
timeout
)
{
return
check_event_code
(
eventsrc
,
timeout
,
EC_COMPLETE
,
S_OK
,
0
);
}
static
void
test_connect_pin
(
void
)
{
static
const
AM_MEDIA_TYPE
req_mt
=
...
...
@@ -900,6 +937,72 @@ static void test_connect_pin(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_unconnected_eos
(
void
)
{
IBaseFilter
*
filter
=
create_null_renderer
();
IFilterGraph2
*
graph
=
create_graph
();
IMediaControl
*
control
;
IMediaEvent
*
eventsrc
;
unsigned
int
ret
;
HRESULT
hr
;
ULONG
ref
;
hr
=
IFilterGraph2_AddFilter
(
graph
,
filter
,
L"renderer"
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaControl
,
(
void
**
)
&
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IFilterGraph2_QueryInterface
(
graph
,
&
IID_IMediaEvent
,
(
void
**
)
&
eventsrc
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Pause
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Stop
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
ok
(
!
ret
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
hr
=
IMediaControl_Run
(
control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret
=
check_ec_complete
(
eventsrc
,
0
);
todo_wine
ok
(
ret
==
1
,
"Got %u EC_COMPLETE events.
\n
"
,
ret
);
IMediaControl_Release
(
control
);
IMediaEvent_Release
(
eventsrc
);
ref
=
IFilterGraph2_Release
(
graph
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
START_TEST
(
nullrenderer
)
{
IBaseFilter
*
filter
;
...
...
@@ -924,6 +1027,7 @@ START_TEST(nullrenderer)
test_media_types
();
test_enum_media_types
();
test_connect_pin
();
test_unconnected_eos
();
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