Module: wine Branch: master Commit: 2f86a5d6cbb081fa2eabeb80ef5357d2fd4f87a0 URL: https://gitlab.winehq.org/wine/wine/-/commit/2f86a5d6cbb081fa2eabeb80ef5357d...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Dec 15 12:11:12 2023 +0100
dmime/tests: Allow small time variation in test_performance_time.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637
---
dlls/dmime/tests/dmime.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 5fff5ea02de..8f79511bf96 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -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);