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
130c9b34
Commit
130c9b34
authored
Mar 05, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add some tests for WAVE parser media types.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2b23682d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
0 deletions
+120
-0
waveparser.c
dlls/quartz/tests/waveparser.c
+120
-0
No files found.
dlls/quartz/tests/waveparser.c
View file @
130c9b34
...
@@ -432,6 +432,125 @@ todo_wine
...
@@ -432,6 +432,125 @@ todo_wine
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
}
static
void
test_media_types
(
void
)
{
static
const
WAVEFORMATEX
expect_wfx
=
{
WAVE_FORMAT_PCM
,
1
,
44100
,
44100
,
1
,
8
,
0
};
const
WCHAR
*
filename
=
load_resource
(
wavefile
);
IBaseFilter
*
filter
=
create_wave_parser
();
AM_MEDIA_TYPE
mt
=
{{
0
}},
*
pmt
;
IEnumMediaTypes
*
enummt
;
IFilterGraph2
*
graph
;
HRESULT
hr
;
ULONG
ref
;
IPin
*
pin
;
BOOL
ret
;
IBaseFilter_FindPin
(
filter
,
sink_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enummt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
pmt
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enummt
);
mt
.
majortype
=
MEDIATYPE_Stream
;
mt
.
subtype
=
MEDIASUBTYPE_WAVE
;
hr
=
IPin_QueryAccept
(
pin
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
mt
.
bFixedSizeSamples
=
TRUE
;
mt
.
bTemporalCompression
=
TRUE
;
mt
.
lSampleSize
=
123
;
mt
.
formattype
=
FORMAT_VideoInfo
;
hr
=
IPin_QueryAccept
(
pin
,
&
mt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
mt
.
majortype
=
GUID_NULL
;
hr
=
IPin_QueryAccept
(
pin
,
&
mt
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
mt
.
majortype
=
MEDIATYPE_Stream
;
mt
.
subtype
=
GUID_NULL
;
hr
=
IPin_QueryAccept
(
pin
,
&
mt
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
mt
.
subtype
=
MEDIASUBTYPE_WAVE
;
graph
=
connect_input
(
filter
,
filename
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enummt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
pmt
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enummt
);
IPin_Release
(
pin
);
IBaseFilter_FindPin
(
filter
,
source_name
,
&
pin
);
hr
=
IPin_EnumMediaTypes
(
pin
,
&
enummt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
pmt
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
pmt
->
majortype
,
&
MEDIATYPE_Audio
),
"Got major type %s.
\n
"
,
wine_dbgstr_guid
(
&
pmt
->
majortype
));
ok
(
IsEqualGUID
(
&
pmt
->
subtype
,
&
MEDIASUBTYPE_PCM
),
"Got subtype %s
\n
"
,
wine_dbgstr_guid
(
&
pmt
->
subtype
));
ok
(
pmt
->
bFixedSizeSamples
==
TRUE
,
"Got fixed size %d.
\n
"
,
pmt
->
bFixedSizeSamples
);
ok
(
!
pmt
->
bTemporalCompression
,
"Got temporal compression %d.
\n
"
,
pmt
->
bTemporalCompression
);
ok
(
pmt
->
lSampleSize
==
1
,
"Got sample size %u.
\n
"
,
pmt
->
lSampleSize
);
ok
(
IsEqualGUID
(
&
pmt
->
formattype
,
&
FORMAT_WaveFormatEx
),
"Got format type %s.
\n
"
,
wine_dbgstr_guid
(
&
pmt
->
formattype
));
ok
(
!
pmt
->
pUnk
,
"Got pUnk %p.
\n
"
,
pmt
->
pUnk
);
ok
(
pmt
->
cbFormat
==
sizeof
(
WAVEFORMATEX
),
"Got format size %u.
\n
"
,
pmt
->
cbFormat
);
ok
(
!
memcmp
(
pmt
->
pbFormat
,
&
expect_wfx
,
sizeof
(
WAVEFORMATEX
)),
"Format blocks didn't match.
\n
"
);
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
pmt
->
bFixedSizeSamples
=
FALSE
;
pmt
->
bTemporalCompression
=
TRUE
;
pmt
->
lSampleSize
=
123
;
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
pmt
->
majortype
=
GUID_NULL
;
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
pmt
->
majortype
=
MEDIATYPE_Audio
;
pmt
->
subtype
=
GUID_NULL
;
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
pmt
->
subtype
=
MEDIASUBTYPE_WAVE
;
pmt
->
formattype
=
GUID_NULL
;
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
pmt
->
formattype
=
FORMAT_None
;
hr
=
IPin_QueryAccept
(
pin
,
pmt
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
CoTaskMemFree
(
pmt
->
pbFormat
);
CoTaskMemFree
(
pmt
);
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
pmt
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enummt
);
IPin_Release
(
pin
);
IFilterGraph2_Release
(
graph
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete file, error %u.
\n
"
,
GetLastError
());
}
START_TEST
(
waveparser
)
START_TEST
(
waveparser
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -440,6 +559,7 @@ START_TEST(waveparser)
...
@@ -440,6 +559,7 @@ START_TEST(waveparser)
test_enum_pins
();
test_enum_pins
();
test_find_pin
();
test_find_pin
();
test_pin_info
();
test_pin_info
();
test_media_types
();
CoUninitialize
();
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