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
2384e497
Commit
2384e497
authored
Aug 03, 2019
by
Gijs Vermeulen
Committed by
Alexandre Julliard
Aug 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmp/tests: Add some IWMPPlaylist tests.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3fe1f20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
media.c
dlls/wmp/tests/media.c
+73
-0
No files found.
dlls/wmp/tests/media.c
View file @
2384e497
...
...
@@ -666,6 +666,78 @@ static void test_player_url(void)
IWMPPlayer4_Release
(
player
);
}
static
void
test_playlist
(
void
)
{
IWMPPlayer4
*
player
;
IWMPPlaylist
*
playlist
,
*
playlist2
;
HRESULT
hr
;
BSTR
str
,
str2
;
LONG
count
;
static
const
WCHAR
nameW
[]
=
{
'P'
,
'l'
,
'a'
,
'y'
,
'l'
,
'i'
,
's'
,
't'
,
'1'
,
0
};
hr
=
CoCreateInstance
(
&
CLSID_WindowsMediaPlayer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWMPPlayer4
,
(
void
**
)
&
player
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
win_skip
(
"CLSID_WindowsMediaPlayer is not registered.
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"Failed to create media player instance, hr %#x.
\n
"
,
hr
);
playlist
=
NULL
;
hr
=
IWMPPlayer4_get_currentPlaylist
(
player
,
&
playlist
);
ok
(
hr
==
S_OK
,
"IWMPPlayer4_get_currentPlaylist failed: %08x
\n
"
,
hr
);
ok
(
playlist
!=
NULL
,
"playlist == NULL
\n
"
);
if
(
0
)
/* fails on non-English locales */
{
hr
=
IWMPPlaylist_get_name
(
playlist
,
&
str
);
ok
(
hr
==
S_OK
,
"Failed to get playlist name, hr %#x.
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
nameW
),
"Expected %s, got %s
\n
"
,
wine_dbgstr_w
(
nameW
),
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
}
hr
=
IWMPPlaylist_get_count
(
playlist
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Failed to get count, hr %#x.
\n
"
,
hr
);
count
=
-
1
;
hr
=
IWMPPlaylist_get_count
(
playlist
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Expected 0, got %d
\n
"
,
count
);
IWMPPlaylist_Release
(
playlist
);
/* newPlaylist doesn't change current playlist */
hr
=
IWMPPlayer4_newPlaylist
(
player
,
NULL
,
NULL
,
&
playlist
);
ok
(
hr
==
S_OK
,
"Failed to create a playlist, hr %#x.
\n
"
,
hr
);
playlist2
=
NULL
;
hr
=
IWMPPlayer4_get_currentPlaylist
(
player
,
&
playlist2
);
ok
(
hr
==
S_OK
,
"IWMPPlayer4_get_currentPlaylist failed: %08x
\n
"
,
hr
);
ok
(
playlist2
!=
NULL
&&
playlist2
!=
playlist
,
"Unexpected playlist instance
\n
"
);
IWMPPlaylist_Release
(
playlist2
);
/* different playlists can have the same name */
str
=
SysAllocString
(
nameW
);
hr
=
IWMPPlaylist_put_name
(
playlist
,
str
);
ok
(
hr
==
S_OK
,
"Failed to get playlist name, hr %#x.
\n
"
,
hr
);
playlist2
=
NULL
;
hr
=
IWMPPlayer4_newPlaylist
(
player
,
str
,
NULL
,
&
playlist2
);
ok
(
hr
==
S_OK
,
"Failed to create a playlist, hr %#x.
\n
"
,
hr
);
hr
=
IWMPPlaylist_get_name
(
playlist2
,
&
str2
);
ok
(
hr
==
S_OK
,
"Failed to get playlist name, hr %#x.
\n
"
,
hr
);
ok
(
playlist
!=
playlist2
,
"Expected playlists to be different"
);
ok
(
!
lstrcmpW
(
str
,
str2
),
"Expected names to be the same
\n
"
);
SysFreeString
(
str
);
SysFreeString
(
str2
);
IWMPPlaylist_Release
(
playlist2
);
IWMPPlaylist_Release
(
playlist
);
IWMPPlayer4_Release
(
player
);
}
START_TEST
(
media
)
{
CoInitialize
(
NULL
);
...
...
@@ -674,6 +746,7 @@ START_TEST(media)
playing_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
completed_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
test_playlist
();
test_media_item
();
test_player_url
();
if
(
test_wmp
())
{
...
...
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