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
5e68fa63
Commit
5e68fa63
authored
Sep 07, 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 IDirectMusicTool message reception delay.
parent
2ac84e2b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
dmime.c
dlls/dmime/tests/dmime.c
+46
-0
No files found.
dlls/dmime/tests/dmime.c
View file @
5e68fa63
...
...
@@ -1733,6 +1733,7 @@ static void test_performance_time(void)
static
void
test_performance_pmsg
(
void
)
{
static
const
DWORD
delivery_flags
[]
=
{
DMUS_PMSGF_TOOL_IMMEDIATE
,
DMUS_PMSGF_TOOL_QUEUE
,
DMUS_PMSGF_TOOL_ATTIME
};
static
const
DWORD
message_types
[]
=
{
DMUS_PMSGT_MIDI
,
DMUS_PMSGT_USER
};
IDirectMusicPerformance
*
performance
;
IDirectMusicGraph
*
graph
;
...
...
@@ -1741,6 +1742,7 @@ static void test_performance_pmsg(void)
REFERENCE_TIME
time
;
HRESULT
hr
;
DWORD
ret
;
UINT
i
;
hr
=
test_tool_create
(
message_types
,
ARRAY_SIZE
(
message_types
),
&
tool
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -1890,6 +1892,50 @@ static void test_performance_pmsg(void)
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
delivery_flags
);
i
++
)
{
DWORD
duration
=
0
;
hr
=
IDirectMusicPerformance_GetTime
(
performance
,
&
time
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
IDirectMusicPerformance_AllocPMsg
(
performance
,
sizeof
(
DMUS_PMSG
),
&
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
ok
(
msg
->
dwSize
==
sizeof
(
DMUS_PMSG
),
"got %ld
\n
"
,
msg
->
dwSize
);
msg
->
rtTime
=
time
+
150
*
10000
;
msg
->
dwFlags
=
DMUS_PMSGF_REFTIME
;
msg
->
dwType
=
DMUS_PMSGT_USER
;
hr
=
IDirectMusicPerformance_QueryInterface
(
performance
,
&
IID_IDirectMusicGraph
,
(
void
**
)
&
graph
);
todo_wine
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
!
graph
)
hr
=
S_OK
;
else
hr
=
IDirectMusicGraph_StampPMsg
(
graph
,
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
if
(
graph
)
IDirectMusicGraph_Release
(
graph
);
msg
->
dwFlags
&=
~
(
DMUS_PMSGF_TOOL_IMMEDIATE
|
DMUS_PMSGF_TOOL_QUEUE
|
DMUS_PMSGF_TOOL_ATTIME
);
msg
->
dwFlags
|=
delivery_flags
[
i
];
duration
-=
GetTickCount
();
hr
=
IDirectMusicPerformance_SendPMsg
(
performance
,
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
msg
=
NULL
;
ret
=
test_tool_wait_message
(
tool
,
1000
,
&
msg
);
todo_wine
ok
(
!
ret
,
"got %#lx
\n
"
,
ret
);
todo_wine
ok
(
msg
!=
NULL
,
"got %p
\n
"
,
msg
);
duration
+=
GetTickCount
();
if
(
msg
)
hr
=
IDirectMusicPerformance_FreePMsg
(
performance
,
msg
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
switch
(
delivery_flags
[
i
])
{
case
DMUS_PMSGF_TOOL_IMMEDIATE
:
todo_wine
ok
(
duration
<=
50
,
"got %lu
\n
"
,
duration
);
break
;
case
DMUS_PMSGF_TOOL_QUEUE
:
todo_wine
ok
(
duration
>=
50
&&
duration
<=
100
,
"got %lu
\n
"
,
duration
);
break
;
case
DMUS_PMSGF_TOOL_ATTIME
:
todo_wine
ok
(
duration
>=
150
&&
duration
<=
500
,
"got %lu
\n
"
,
duration
);
break
;
}
}
hr
=
IDirectMusicPerformance_CloseDown
(
performance
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
...
...
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