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
c97b8a8f
Commit
c97b8a8f
authored
Dec 02, 2022
by
Shaun Ren
Committed by
Alexandre Julliard
Jan 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplay/tests: Add tests for MF_SD_LANGUAGE.
parent
2eecb04c
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
97 additions
and
0 deletions
+97
-0
mfplay.c
dlls/mfplay/tests/mfplay.c
+70
-0
resource.rc
dlls/mfplay/tests/resource.rc
+27
-0
test-ang.mp4
dlls/mfplay/tests/test-ang.mp4
+0
-0
test-ang.wma
dlls/mfplay/tests/test-ang.wma
+0
-0
test-en-US.mp4
dlls/mfplay/tests/test-en-US.mp4
+0
-0
test-en-US.wma
dlls/mfplay/tests/test-en-US.wma
+0
-0
test-en.wma
dlls/mfplay/tests/test-en.wma
+0
-0
test-eng.mp4
dlls/mfplay/tests/test-eng.mp4
+0
-0
test-eng.wma
dlls/mfplay/tests/test-eng.wma
+0
-0
test-und.mp4
dlls/mfplay/tests/test-und.mp4
+0
-0
test-und.wma
dlls/mfplay/tests/test-und.wma
+0
-0
No files found.
dlls/mfplay/tests/mfplay.c
View file @
c97b8a8f
...
...
@@ -437,6 +437,75 @@ static void test_media_item(void)
IMFPMediaPlayer_Release
(
player
);
}
#define check_media_language(player, resource_name, expected_lang) \
_check_media_language(__LINE__, FALSE, player, resource_name, expected_lang)
#define todo_check_media_language(player, resource_name, expected_lang) \
_check_media_language(__LINE__, TRUE, player, resource_name, expected_lang)
static
void
_check_media_language
(
unsigned
line
,
BOOL
todo
,
IMFPMediaPlayer
*
player
,
const
WCHAR
*
resource_name
,
const
WCHAR
*
expected_lang
)
{
WCHAR
*
filename
;
IMFPMediaItem
*
item
;
PROPVARIANT
propvar
;
const
WCHAR
*
lang
=
NULL
;
HRESULT
hr
;
filename
=
load_resource
(
resource_name
);
hr
=
IMFPMediaPlayer_CreateMediaItemFromURL
(
player
,
filename
,
TRUE
,
123
,
&
item
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
||
broken
(
hr
==
MF_E_UNSUPPORTED_BYTESTREAM_TYPE
)
/* win8 - win10 1507 */
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
DeleteFileW
(
filename
);
return
;
}
hr
=
IMFPMediaItem_GetStreamAttribute
(
item
,
0
,
&
MF_SD_LANGUAGE
,
&
propvar
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
||
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok_
(
__FILE__
,
line
)(
propvar
.
vt
==
VT_LPWSTR
,
"Unexpected vt %u.
\n
"
,
propvar
.
vt
);
if
(
propvar
.
vt
==
VT_LPWSTR
)
lang
=
propvar
.
pwszVal
;
}
todo_wine_if
(
todo
)
{
if
(
expected_lang
)
ok_
(
__FILE__
,
line
)(
lang
&&
!
wcscmp
(
lang
,
expected_lang
),
"Unexpected value %s.
\n
"
,
debugstr_w
(
lang
));
else
ok_
(
__FILE__
,
line
)(
!
lang
,
"Unexpected value %s.
\n
"
,
debugstr_w
(
lang
));
}
PropVariantClear
(
&
propvar
);
IMFPMediaItem_Release
(
item
);
DeleteFileW
(
filename
);
}
static
void
test_media_language
(
void
)
{
IMFPMediaPlayer
*
player
;
HRESULT
hr
;
hr
=
MFPCreateMediaPlayer
(
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
player
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
check_media_language
(
player
,
L"test-eng.mp4"
,
L"en"
);
check_media_language
(
player
,
L"test-ang.mp4"
,
NULL
);
check_media_language
(
player
,
L"test-und.mp4"
,
NULL
);
check_media_language
(
player
,
L"test-en-US.mp4"
,
L"en"
);
check_media_language
(
player
,
L"test-en.wma"
,
L"en"
);
check_media_language
(
player
,
L"test-eng.wma"
,
L"eng"
);
check_media_language
(
player
,
L"test-ang.wma"
,
L"ang"
);
check_media_language
(
player
,
L"test-und.wma"
,
L"und"
);
todo_check_media_language
(
player
,
L"test-en-US.wma"
,
L"en-US"
);
IMFPMediaPlayer_Release
(
player
);
}
static
void
test_video_control
(
void
)
{
MFVideoNormalizedRect
rect
;
...
...
@@ -599,6 +668,7 @@ START_TEST(mfplay)
test_create_player
();
test_shutdown
();
test_media_item
();
test_media_language
();
test_video_control
();
test_duration
();
test_playback_rate
();
...
...
dlls/mfplay/tests/resource.rc
View file @
c97b8a8f
...
...
@@ -20,3 +20,30 @@
/* @makedep: test.mp4 */
test.mp4 RCDATA test.mp4
/* @makedep: test-eng.mp4 */
test-eng.mp4 RCDATA test-eng.mp4
/* @makedep: test-ang.mp4 */
test-ang.mp4 RCDATA test-ang.mp4
/* @makedep: test-und.mp4 */
test-und.mp4 RCDATA test-und.mp4
/* @makedep: test-en-US.mp4 */
test-en-US.mp4 RCDATA test-en-US.mp4
/* @makedep: test-en.wma */
test-en.wma RCDATA test-en.wma
/* @makedep: test-eng.wma */
test-eng.wma RCDATA test-eng.wma
/* @makedep: test-ang.wma */
test-ang.wma RCDATA test-ang.wma
/* @makedep: test-und.wma */
test-und.wma RCDATA test-und.wma
/* @makedep: test-en-US.wma */
test-en-US.wma RCDATA test-en-US.wma
dlls/mfplay/tests/test-ang.mp4
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-ang.wma
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-en-US.mp4
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-en-US.wma
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-en.wma
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-eng.mp4
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-eng.wma
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-und.mp4
0 → 100644
View file @
c97b8a8f
File added
dlls/mfplay/tests/test-und.wma
0 → 100644
View file @
c97b8a8f
File added
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