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
fd3607ed
Commit
fd3607ed
authored
Nov 22, 2023
by
Anton Baskanov
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime/tests: Move scale_music_time() and check_dmus_note_pmsg() up.
parent
00a77f01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
dmime.c
dlls/dmime/tests/dmime.c
+35
-35
No files found.
dlls/dmime/tests/dmime.c
View file @
fd3607ed
...
...
@@ -59,6 +59,41 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
}
}
static
double
scale_music_time
(
MUSIC_TIME
time
,
double
tempo
)
{
return
(
600000000
.
0
*
time
)
/
(
tempo
*
768
.
0
);
}
#define check_dmus_note_pmsg(a, b, c, d, e, f) check_dmus_note_pmsg_(__LINE__, a, b, c, d, e, f)
static
void
check_dmus_note_pmsg_
(
int
line
,
DMUS_NOTE_PMSG
*
msg
,
MUSIC_TIME
time
,
UINT
chan
,
UINT
duration
,
UINT
key
,
UINT
vel
)
{
ok_
(
__FILE__
,
line
)(
msg
->
dwSize
==
sizeof
(
*
msg
),
"got dwSize %lu
\n
"
,
msg
->
dwSize
);
ok_
(
__FILE__
,
line
)(
!!
msg
->
rtTime
,
"got rtTime %I64u
\n
"
,
msg
->
rtTime
);
ok_
(
__FILE__
,
line
)(
abs
(
msg
->
mtTime
-
time
)
<
10
,
"got mtTime %lu
\n
"
,
msg
->
mtTime
);
ok_
(
__FILE__
,
line
)(
msg
->
dwPChannel
==
chan
,
"got dwPChannel %lu
\n
"
,
msg
->
dwPChannel
);
ok_
(
__FILE__
,
line
)(
!!
msg
->
dwVirtualTrackID
,
"got dwVirtualTrackID %lu
\n
"
,
msg
->
dwVirtualTrackID
);
ok_
(
__FILE__
,
line
)(
msg
->
dwType
==
DMUS_PMSGT_NOTE
,
"got %#lx
\n
"
,
msg
->
dwType
);
ok_
(
__FILE__
,
line
)(
!
msg
->
dwVoiceID
,
"got dwVoiceID %lu
\n
"
,
msg
->
dwVoiceID
);
ok_
(
__FILE__
,
line
)(
msg
->
dwGroupID
==
1
,
"got dwGroupID %lu
\n
"
,
msg
->
dwGroupID
);
ok_
(
__FILE__
,
line
)(
!
msg
->
punkUser
,
"got punkUser %p
\n
"
,
msg
->
punkUser
);
ok_
(
__FILE__
,
line
)(
msg
->
mtDuration
==
duration
,
"got mtDuration %lu
\n
"
,
msg
->
mtDuration
);
ok_
(
__FILE__
,
line
)(
msg
->
wMusicValue
==
key
,
"got wMusicValue %u
\n
"
,
msg
->
wMusicValue
);
ok_
(
__FILE__
,
line
)(
!
msg
->
wMeasure
,
"got wMeasure %u
\n
"
,
msg
->
wMeasure
);
/* FIXME: ok_(__FILE__, line)(!msg->nOffset, "got nOffset %u\n", msg->nOffset); */
/* FIXME: ok_(__FILE__, line)(!msg->bBeat, "got bBeat %u\n", msg->bBeat); */
/* FIXME: ok_(__FILE__, line)(!msg->bGrid, "got bGrid %u\n", msg->bGrid); */
ok_
(
__FILE__
,
line
)(
msg
->
bVelocity
==
vel
,
"got bVelocity %u
\n
"
,
msg
->
bVelocity
);
ok_
(
__FILE__
,
line
)(
msg
->
bFlags
==
1
,
"got bFlags %#x
\n
"
,
msg
->
bFlags
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bTimeRange
,
"got bTimeRange %u
\n
"
,
msg
->
bTimeRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bDurRange
,
"got bDurRange %u
\n
"
,
msg
->
bDurRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bVelRange
,
"got bVelRange %u
\n
"
,
msg
->
bVelRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bPlayModeFlags
,
"got bPlayModeFlags %#x
\n
"
,
msg
->
bPlayModeFlags
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bSubChordLevel
,
"got bSubChordLevel %u
\n
"
,
msg
->
bSubChordLevel
);
ok_
(
__FILE__
,
line
)(
msg
->
bMidiValue
==
key
,
"got bMidiValue %u
\n
"
,
msg
->
bMidiValue
);
ok_
(
__FILE__
,
line
)(
!
msg
->
cTranspose
,
"got cTranspose %u
\n
"
,
msg
->
cTranspose
);
}
static
void
load_resource
(
const
WCHAR
*
name
,
WCHAR
*
filename
)
{
static
WCHAR
path
[
MAX_PATH
];
...
...
@@ -2671,11 +2706,6 @@ static void test_performance_graph(void)
IDirectMusicTool_Release
(
tool
);
}
static
double
scale_music_time
(
MUSIC_TIME
time
,
double
tempo
)
{
return
(
600000000
.
0
*
time
)
/
(
tempo
*
768
.
0
);
}
#define check_music_time(a, b) check_music_time_(__LINE__, a, b)
static
void
check_music_time_
(
int
line
,
MUSIC_TIME
time
,
MUSIC_TIME
expect
)
{
...
...
@@ -3510,36 +3540,6 @@ static void test_wave_pmsg(void)
IDirectMusicTool_Release
(
tool
);
}
#define check_dmus_note_pmsg(a, b, c, d, e, f) check_dmus_note_pmsg_(__LINE__, a, b, c, d, e, f)
static
void
check_dmus_note_pmsg_
(
int
line
,
DMUS_NOTE_PMSG
*
msg
,
MUSIC_TIME
time
,
UINT
chan
,
UINT
duration
,
UINT
key
,
UINT
vel
)
{
ok_
(
__FILE__
,
line
)(
msg
->
dwSize
==
sizeof
(
*
msg
),
"got dwSize %lu
\n
"
,
msg
->
dwSize
);
ok_
(
__FILE__
,
line
)(
!!
msg
->
rtTime
,
"got rtTime %I64u
\n
"
,
msg
->
rtTime
);
ok_
(
__FILE__
,
line
)(
abs
(
msg
->
mtTime
-
time
)
<
10
,
"got mtTime %lu
\n
"
,
msg
->
mtTime
);
ok_
(
__FILE__
,
line
)(
msg
->
dwPChannel
==
chan
,
"got dwPChannel %lu
\n
"
,
msg
->
dwPChannel
);
ok_
(
__FILE__
,
line
)(
!!
msg
->
dwVirtualTrackID
,
"got dwVirtualTrackID %lu
\n
"
,
msg
->
dwVirtualTrackID
);
ok_
(
__FILE__
,
line
)(
msg
->
dwType
==
DMUS_PMSGT_NOTE
,
"got %#lx
\n
"
,
msg
->
dwType
);
ok_
(
__FILE__
,
line
)(
!
msg
->
dwVoiceID
,
"got dwVoiceID %lu
\n
"
,
msg
->
dwVoiceID
);
ok_
(
__FILE__
,
line
)(
msg
->
dwGroupID
==
1
,
"got dwGroupID %lu
\n
"
,
msg
->
dwGroupID
);
ok_
(
__FILE__
,
line
)(
!
msg
->
punkUser
,
"got punkUser %p
\n
"
,
msg
->
punkUser
);
ok_
(
__FILE__
,
line
)(
msg
->
mtDuration
==
duration
,
"got mtDuration %lu
\n
"
,
msg
->
mtDuration
);
ok_
(
__FILE__
,
line
)(
msg
->
wMusicValue
==
key
,
"got wMusicValue %u
\n
"
,
msg
->
wMusicValue
);
ok_
(
__FILE__
,
line
)(
!
msg
->
wMeasure
,
"got wMeasure %u
\n
"
,
msg
->
wMeasure
);
/* FIXME: ok_(__FILE__, line)(!msg->nOffset, "got nOffset %u\n", msg->nOffset); */
/* FIXME: ok_(__FILE__, line)(!msg->bBeat, "got bBeat %u\n", msg->bBeat); */
/* FIXME: ok_(__FILE__, line)(!msg->bGrid, "got bGrid %u\n", msg->bGrid); */
ok_
(
__FILE__
,
line
)(
msg
->
bVelocity
==
vel
,
"got bVelocity %u
\n
"
,
msg
->
bVelocity
);
ok_
(
__FILE__
,
line
)(
msg
->
bFlags
==
1
,
"got bFlags %#x
\n
"
,
msg
->
bFlags
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bTimeRange
,
"got bTimeRange %u
\n
"
,
msg
->
bTimeRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bDurRange
,
"got bDurRange %u
\n
"
,
msg
->
bDurRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bVelRange
,
"got bVelRange %u
\n
"
,
msg
->
bVelRange
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bPlayModeFlags
,
"got bPlayModeFlags %#x
\n
"
,
msg
->
bPlayModeFlags
);
ok_
(
__FILE__
,
line
)(
!
msg
->
bSubChordLevel
,
"got bSubChordLevel %u
\n
"
,
msg
->
bSubChordLevel
);
ok_
(
__FILE__
,
line
)(
msg
->
bMidiValue
==
key
,
"got bMidiValue %u
\n
"
,
msg
->
bMidiValue
);
ok_
(
__FILE__
,
line
)(
!
msg
->
cTranspose
,
"got cTranspose %u
\n
"
,
msg
->
cTranspose
);
}
static
void
test_sequence_track
(
void
)
{
static
const
DWORD
message_types
[]
=
...
...
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