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
a874f60c
Commit
a874f60c
authored
Sep 05, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime/tests: Test IDirectMusicPerformance time conversion.
parent
cd5c9b80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
dmime.c
dlls/dmime/tests/dmime.c
+91
-0
No files found.
dlls/dmime/tests/dmime.c
View file @
a874f60c
...
...
@@ -1601,6 +1601,96 @@ skip_graph2:
IDirectMusicTool_Release
(
tool
);
}
static
void
test_performance_time
(
void
)
{
IDirectMusicPerformance
*
performance
;
REFERENCE_TIME
init_time
,
time
;
IReferenceClock
*
clock
;
MUSIC_TIME
music_time
;
IDirectMusic
*
dmusic
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicPerformance
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicPerformance
,
(
void
**
)
&
performance
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
0
,
&
time
);
todo_wine
ok
(
hr
==
DMUS_E_NO_MASTER_CLOCK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
==
0
,
"got %I64d
\n
"
,
time
);
hr
=
IDirectMusicPerformance_ReferenceToMusicTime
(
performance
,
0
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %#lx
\n
"
,
hr
);
music_time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_ReferenceToMusicTime
(
performance
,
0
,
&
music_time
);
todo_wine
ok
(
hr
==
DMUS_E_NO_MASTER_CLOCK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
music_time
==
0
,
"got %ld
\n
"
,
music_time
);
dmusic
=
NULL
;
hr
=
IDirectMusicPerformance_Init
(
performance
,
&
dmusic
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusic_GetMasterClock
(
dmusic
,
NULL
,
&
clock
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
IDirectMusic_Release
(
dmusic
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
init_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
IReferenceClock_Release
(
clock
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
0
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
time
-
init_time
<=
100
*
10000
,
"got %I64d
\n
"
,
time
-
init_time
);
init_time
=
time
;
time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
1
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
-
init_time
>=
6505
,
"got %I64d
\n
"
,
time
-
init_time
);
ok
(
time
-
init_time
<=
6515
,
"got %I64d
\n
"
,
time
-
init_time
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
1000
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
-
init_time
>=
1000
*
6505
,
"got %I64d
\n
"
,
time
-
init_time
);
ok
(
time
-
init_time
<=
1000
*
6515
,
"got %I64d
\n
"
,
time
-
init_time
);
time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_MusicToReferenceTime
(
performance
,
2000
,
&
time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
-
init_time
>=
2000
*
6505
,
"got %I64d
\n
"
,
time
-
init_time
);
ok
(
time
-
init_time
<=
2000
*
6515
,
"got %I64d
\n
"
,
time
-
init_time
);
music_time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_ReferenceToMusicTime
(
performance
,
init_time
,
&
music_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
music_time
==
0
,
"got %ld
\n
"
,
music_time
);
music_time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_ReferenceToMusicTime
(
performance
,
init_time
+
1000
*
6510
,
&
music_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
music_time
==
1000
,
"got %ld
\n
"
,
music_time
);
music_time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_ReferenceToMusicTime
(
performance
,
init_time
+
2000
*
6510
,
&
music_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
music_time
==
2000
,
"got %ld
\n
"
,
music_time
);
time
=
0xdeadbeef
;
music_time
=
0xdeadbeef
;
hr
=
IDirectMusicPerformance_GetTime
(
performance
,
&
time
,
&
music_time
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
todo_wine
ok
(
time
-
init_time
<=
200
*
10000
,
"got %I64d
\n
"
,
time
-
init_time
);
todo_wine
ok
(
music_time
==
(
time
-
init_time
)
/
6510
,
"got %ld
\n
"
,
music_time
);
hr
=
IDirectMusicPerformance_CloseDown
(
performance
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
IDirectMusicPerformance_Release
(
performance
);
}
START_TEST
(
dmime
)
{
CoInitialize
(
NULL
);
...
...
@@ -1626,6 +1716,7 @@ START_TEST(dmime)
test_parsedescriptor
();
test_performance_tool
();
test_performance_graph
();
test_performance_time
();
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