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
85d631cf
Commit
85d631cf
authored
Jun 27, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Add some tests for IEnumMediaTypes().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f8b6b55c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
226 additions
and
0 deletions
+226
-0
avico.c
dlls/qcap/tests/avico.c
+72
-0
avimux.c
dlls/qcap/tests/avimux.c
+109
-0
smartteefilter.c
dlls/qcap/tests/smartteefilter.c
+45
-0
No files found.
dlls/qcap/tests/avico.c
View file @
85d631cf
...
...
@@ -584,6 +584,77 @@ static void test_media_types(IBaseFilter *filter)
IPin_Release
(
pin
);
}
static
void
test_enum_media_types
(
IBaseFilter
*
filter
)
{
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
source_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
}
START_TEST
(
avico
)
{
static
const
WCHAR
test_display_name
[]
=
{
'@'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
':'
,
...
...
@@ -625,6 +696,7 @@ START_TEST(avico)
test_find_pin
(
filter
);
test_pin_info
(
filter
);
test_media_types
(
filter
);
test_enum_media_types
(
filter
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
...
...
dlls/qcap/tests/avimux.c
View file @
85d631cf
...
...
@@ -556,6 +556,114 @@ static void test_media_types(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_enum_media_types
(
void
)
{
IBaseFilter
*
filter
=
create_avi_mux
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
source_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
2
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
1
,
"Got count %u.
\n
"
,
count
);
CoTaskMemFree
(
mts
[
0
]);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
2
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
mts
[
0
]);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
sink0_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_seeking
(
void
)
{
IBaseFilter
*
filter
=
create_avi_mux
();
...
...
@@ -700,6 +808,7 @@ START_TEST(avimux)
test_find_pin
();
test_pin_info
();
test_media_types
();
test_enum_media_types
();
test_seeking
();
CoUninitialize
();
...
...
dlls/qcap/tests/smartteefilter.c
View file @
85d631cf
...
...
@@ -418,6 +418,50 @@ static void test_pin_info(void)
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
static
void
test_enum_media_types
(
void
)
{
IBaseFilter
*
filter
=
create_smart_tee
();
IEnumMediaTypes
*
enum1
,
*
enum2
;
AM_MEDIA_TYPE
*
mts
[
2
];
ULONG
ref
,
count
;
HRESULT
hr
;
IPin
*
pin
;
IBaseFilter_FindPin
(
filter
,
sink_id
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
&
count
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
count
,
"Got count %u.
\n
"
,
count
);
hr
=
IEnumMediaTypes_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum1
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Clone
(
enum1
,
&
enum2
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enum2
,
1
,
mts
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enum1
);
IEnumMediaTypes_Release
(
enum2
);
IPin_Release
(
pin
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
typedef
struct
{
IBaseFilter
IBaseFilter_iface
;
LONG
ref
;
...
...
@@ -2336,6 +2380,7 @@ START_TEST(smartteefilter)
test_enum_pins
();
test_find_pin
();
test_pin_info
();
test_enum_media_types
();
test_smart_tee_filter_aggregation
();
test_smart_tee_filter
();
...
...
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