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
aca1b2ea
Commit
aca1b2ea
authored
Apr 21, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream/tests: Add some test for supported interfaces.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eec4a05e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
2 deletions
+110
-2
amstream.c
dlls/amstream/tests/amstream.c
+110
-2
No files found.
dlls/amstream/tests/amstream.c
View file @
aca1b2ea
...
...
@@ -46,8 +46,9 @@ static IDirectDrawSurface7* pdds7;
static
IAMMultiMediaStream
*
create_ammultimediastream
(
void
)
{
IAMMultiMediaStream
*
stream
=
NULL
;
CoCreateInstance
(
&
CLSID_AMMultiMediaStream
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IAMMultiMediaStream
,
(
void
**
)
&
stream
);
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_AMMultiMediaStream
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IAMMultiMediaStream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
return
stream
;
}
...
...
@@ -95,6 +96,112 @@ static void release_directdraw(void)
IDirectDraw7_Release
(
pdd7
);
}
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static
void
check_interface_
(
unsigned
int
line
,
void
*
iface_ptr
,
REFIID
iid
,
BOOL
supported
)
{
IUnknown
*
iface
=
iface_ptr
;
HRESULT
hr
,
expected_hr
;
IUnknown
*
unk
;
expected_hr
=
supported
?
S_OK
:
E_NOINTERFACE
;
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
expected_hr
,
"Got hr %#x, expected %#x.
\n
"
,
hr
,
expected_hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
}
static
void
test_interfaces
(
void
)
{
IAMMultiMediaStream
*
mmstream
=
create_ammultimediastream
();
IMediaStreamFilter
*
filter
;
IMediaStream
*
stream
;
HRESULT
hr
;
ULONG
ref
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_interface
(
mmstream
,
&
IID_IAMMultiMediaStream
,
TRUE
);
check_interface
(
mmstream
,
&
IID_IMultiMediaStream
,
TRUE
);
check_interface
(
mmstream
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
mmstream
,
&
IID_IAMMediaStream
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IAMMediaTypeStream
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IAudioMediaStream
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IBaseFilter
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IDirectDrawMediaStream
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IMediaFilter
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IMediaStream
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IMediaStreamFilter
,
FALSE
);
check_interface
(
mmstream
,
&
IID_IPin
,
FALSE
);
hr
=
IAMMultiMediaStream_GetFilter
(
mmstream
,
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_interface
(
filter
,
&
IID_IBaseFilter
,
TRUE
);
check_interface
(
filter
,
&
IID_IMediaFilter
,
TRUE
);
check_interface
(
filter
,
&
IID_IMediaStreamFilter
,
TRUE
);
check_interface
(
filter
,
&
IID_IPersist
,
TRUE
);
check_interface
(
filter
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
filter
,
&
IID_IAMMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IAMMediaTypeStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IAMMultiMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IAudioMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IDirectDrawMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IMultiMediaStream
,
FALSE
);
check_interface
(
filter
,
&
IID_IPin
,
FALSE
);
IMediaStreamFilter_Release
(
filter
);
hr
=
IAMMultiMediaStream_AddMediaStream
(
mmstream
,
NULL
,
&
MSPID_PrimaryAudio
,
0
,
&
stream
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_interface
(
stream
,
&
IID_IAMMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IAudioMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IPin
,
TRUE
);
check_interface
(
stream
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
stream
,
&
IID_IAMMediaTypeStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IAMMultiMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IBaseFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IDirectDrawMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IMediaFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IMediaStreamFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IMultiMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IPersist
,
FALSE
);
IMediaStream_Release
(
stream
);
hr
=
IAMMultiMediaStream_AddMediaStream
(
mmstream
,
NULL
,
&
MSPID_PrimaryVideo
,
0
,
&
stream
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_interface
(
stream
,
&
IID_IAMMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IDirectDrawMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IPin
,
TRUE
);
check_interface
(
stream
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
stream
,
&
IID_IAMMediaTypeStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IAMMultiMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IAudioMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IBaseFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IDirectDraw
,
FALSE
);
check_interface
(
stream
,
&
IID_IMediaFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IMediaStreamFilter
,
FALSE
);
check_interface
(
stream
,
&
IID_IMultiMediaStream
,
FALSE
);
check_interface
(
stream
,
&
IID_IPersist
,
FALSE
);
IMediaStream_Release
(
stream
);
ref
=
IAMMultiMediaStream_Release
(
mmstream
);
ok
(
!
ref
,
"Got outstanding refcount %u.
\n
"
,
ref
);
}
static
void
test_openfile
(
void
)
{
IAMMultiMediaStream
*
pams
;
...
...
@@ -878,6 +985,7 @@ START_TEST(amstream)
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
test_interfaces
();
test_media_streams
();
test_IDirectDrawStreamSample
();
...
...
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