mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-07 10:04:07 +00:00
dmime/tests: Allow small time variation in test_performance_time.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
This commit is contained in:
parent
6447b11b17
commit
2f86a5d6cb
|
@ -65,6 +65,11 @@ static double scale_music_time(MUSIC_TIME time, double tempo)
|
|||
return (600000000.0 * time) / (tempo * DMUS_PPQ);
|
||||
}
|
||||
|
||||
static MUSIC_TIME music_time_from_reference(REFERENCE_TIME time, double tempo)
|
||||
{
|
||||
return (time * tempo * DMUS_PPQ) / 600000000;
|
||||
}
|
||||
|
||||
#define check_dmus_note_pmsg(a, b, c, d, e, f, g) check_dmus_note_pmsg_(__LINE__, a, b, c, d, e, f, g)
|
||||
static void check_dmus_note_pmsg_(int line, DMUS_NOTE_PMSG *msg, MUSIC_TIME time, UINT chan,
|
||||
UINT duration, UINT key, UINT vel, UINT flags)
|
||||
|
@ -2896,7 +2901,7 @@ static void test_performance_time(void)
|
|||
hr = IDirectMusicPerformance_GetTime(performance, &time, &music_time);
|
||||
ok(hr == S_OK, "got %#lx\n", hr);
|
||||
ok(time - init_time <= 200 * 10000, "got %I64d\n", time - init_time);
|
||||
ok(music_time == (time - init_time) / 6510, "got %ld\n", music_time);
|
||||
ok(abs(music_time - music_time_from_reference(time - init_time, 120)) <= 1, "got %ld\n", music_time);
|
||||
|
||||
|
||||
hr = IDirectMusicPerformance_CloseDown(performance);
|
||||
|
|
Loading…
Reference in a new issue