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
d4f99f4f
Commit
d4f99f4f
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 tests for IMediaStreamFilter::EnumPins().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aca1b2ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
144 additions
and
0 deletions
+144
-0
amstream.c
dlls/amstream/tests/amstream.c
+144
-0
No files found.
dlls/amstream/tests/amstream.c
View file @
d4f99f4f
...
...
@@ -96,6 +96,13 @@ static void release_directdraw(void)
IDirectDraw7_Release
(
pdd7
);
}
static
ULONG
get_refcount
(
void
*
iface
)
{
IUnknown
*
unknown
=
iface
;
IUnknown_AddRef
(
unknown
);
return
IUnknown_Release
(
unknown
);
}
#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
)
{
...
...
@@ -615,6 +622,142 @@ static void test_media_streams(void)
IAMMultiMediaStream_Release
(
pams
);
}
static
void
test_enum_pins
(
void
)
{
IAMMultiMediaStream
*
mmstream
=
create_ammultimediastream
();
IMediaStreamFilter
*
filter
;
IEnumPins
*
enum1
,
*
enum2
;
IMediaStream
*
stream
;
IPin
*
pins
[
3
],
*
pin
;
ULONG
ref
,
count
;
HRESULT
hr
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetFilter
(
mmstream
,
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
hr
=
IMediaStreamFilter_EnumPins
(
filter
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaStreamFilter_EnumPins
(
filter
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Skip
(
enum1
,
0
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_AddMediaStream
(
mmstream
,
NULL
,
&
MSPID_PrimaryVideo
,
0
,
&
stream
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaStream_QueryInterface
(
stream
,
&
IID_IPin
,
(
void
**
)
&
pin
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
/* Reset() isn't enough; we have to call EnumPins() again to see the updated
* pin count. */
hr
=
IEnumPins_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumPins_Release
(
enum1
);
hr
=
IMediaStreamFilter_EnumPins
(
filter
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
ok
(
ref
==
4
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
4
,
"Got unexpected refcount %d.
\n
"
,
ref
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pins
[
0
]
==
pin
,
"Expected pin %p, got %p.
\n
"
,
pin
,
pins
[
0
]);
ref
=
get_refcount
(
filter
);
ok
(
ref
==
4
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
pin
);
todo_wine
ok
(
ref
==
5
,
"Got unexpected refcount %d.
\n
"
,
ref
);
IPin_Release
(
pins
[
0
]);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
ok
(
pins
[
0
]
==
pin
,
"Expected pin %p, got %p.
\n
"
,
pin
,
pins
[
0
]);
IPin_Release
(
pins
[
0
]);
hr
=
IEnumPins_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
2
,
pins
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
2
,
pins
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
ok
(
pins
[
0
]
==
pin
,
"Expected pin %p, got %p.
\n
"
,
pin
,
pins
[
0
]);
IPin_Release
(
pins
[
0
]);
hr
=
IEnumPins_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Skip
(
enum1
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum1
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumPins_Next
(
enum2
,
1
,
pins
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
pins
[
0
]
==
pin
,
"Expected pin %p, got %p.
\n
"
,
pin
,
pins
[
0
]);
IPin_Release
(
pins
[
0
]);
IEnumPins_Release
(
enum2
);
IEnumPins_Release
(
enum1
);
IMediaStreamFilter_Release
(
filter
);
ref
=
IAMMultiMediaStream_Release
(
mmstream
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
IMediaStream_Release
(
stream
);
ref
=
IPin_Release
(
pin
);
todo_wine
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_IDirectDrawStreamSample
(
void
)
{
DDSURFACEDESC
desc
=
{
sizeof
(
desc
)
};
...
...
@@ -987,6 +1130,7 @@ START_TEST(amstream)
test_interfaces
();
test_media_streams
();
test_enum_pins
();
test_IDirectDrawStreamSample
();
file
=
CreateFileW
(
filenameW
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
...
...
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