From: Rémi Bernon rbernon@codeweavers.com
Renaming check_music_time to check_reference_time, as it's truly reference time values that are passed.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637 --- dlls/dmime/tests/dmime.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index b4b6d848fdc..5fff5ea02de 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -62,7 +62,7 @@ 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); + return (600000000.0 * time) / (tempo * DMUS_PPQ); }
#define check_dmus_note_pmsg(a, b, c, d, e, f, g) check_dmus_note_pmsg_(__LINE__, a, b, c, d, e, f, g) @@ -2812,10 +2812,11 @@ static void test_performance_graph(void) IDirectMusicTool_Release(tool); }
-#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) +#define check_reference_time(a, b) check_reference_time_(__LINE__, a, b) +static void check_reference_time_(int line, REFERENCE_TIME time, double expect) { - ok_(__FILE__, line)(abs(time - expect) <= 1, "got %ld, expected %ld\n", time, expect); + ok_(__FILE__, line)(llabs(time - (REFERENCE_TIME)expect) <= scale_music_time(1, 120) / 2.0, + "got %I64u, expected %f\n", time, expect); }
static void test_performance_time(void) @@ -2867,15 +2868,15 @@ static void test_performance_time(void) time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 1, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(1, 120)); + check_reference_time(time - init_time, scale_music_time(1, 120)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 1000, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(1000, 120)); + check_reference_time(time - init_time, scale_music_time(1000, 120)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 2000, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(2000, 120)); + check_reference_time(time - init_time, scale_music_time(2000, 120));
music_time = 0xdeadbeef; hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, init_time, &music_time); @@ -4250,23 +4251,23 @@ static void test_tempo_track_play(void) time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 1, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(1, 120)); + check_reference_time(time - init_time, scale_music_time(1, 120)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 100, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(100, 120)); + check_reference_time(time - init_time, scale_music_time(100, 120)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 150, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(100, 120) + scale_music_time(50, 80)); + check_reference_time(time - init_time, scale_music_time(100, 120) + scale_music_time(50, 80)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 200, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(100, 120) + scale_music_time(100, 80)); + check_reference_time(time - init_time, scale_music_time(100, 120) + scale_music_time(100, 80)); time = 0xdeadbeef; hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 400, &time); ok(hr == S_OK, "got %#lx\n", hr); - check_music_time(time - init_time, scale_music_time(100, 120) + scale_music_time(200, 80) + scale_music_time(100, 20)); + check_reference_time(time - init_time, scale_music_time(100, 120) + scale_music_time(200, 80) + scale_music_time(100, 20));
music_time = 0xdeadbeef; hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, init_time, &music_time);
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637 --- dlls/dmime/tests/dmime.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 8f79511bf96..81d8f1a1277 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -4503,17 +4503,17 @@ static void test_segment_state(void)
tmp_state = (void *)0xdeadbeef; hr = IDirectMusicPerformance_GetSegmentState(performance, &tmp_state, 0); - ok(hr == S_OK, "got %#lx\n", hr); - ok(state == tmp_state, "got %p\n", state); + ok(hr == S_OK || broken(hr == DMUS_E_NOT_FOUND) /* sometimes on Windows */, "got %#lx\n", hr); + ok(state == tmp_state, "got %p\n", tmp_state); IDirectMusicSegmentState_Release(tmp_state);
tmp_state = (void *)0xdeadbeef; hr = IDirectMusicPerformance_GetSegmentState(performance, &tmp_state, 69); ok(hr == S_OK, "got %#lx\n", hr); - ok(state == tmp_state, "got %p\n", state); + ok(state == tmp_state, "got %p\n", tmp_state); IDirectMusicSegmentState_Release(tmp_state);
- hr = IDirectMusicPerformance_GetSegmentState(performance, &tmp_state, 70); + hr = IDirectMusicPerformance_GetSegmentState(performance, &tmp_state, 71); todo_wine ok(hr == DMUS_E_NOT_FOUND, "got %#lx\n", hr);
From: Rémi Bernon rbernon@codeweavers.com
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);
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637 --- dlls/dmime/tests/dmime.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 81d8f1a1277..47a22441dde 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3465,6 +3465,29 @@ static void test_notification_pmsg(void)
ret = test_tool_wait_message(tool, 50, (DMUS_PMSG **)¬if); ok(!ret, "got %#lx\n", ret); + if (notif->dwNotificationOption == DMUS_NOTIFICATION_SEGALMOSTEND) + { + check_dmus_notification_pmsg(notif, music_time + length - 1450, DMUS_PMSGF_TOOL_IMMEDIATE, + &GUID_NOTIFICATION_SEGMENT, DMUS_NOTIFICATION_SEGALMOSTEND, state); + hr = IDirectMusicPerformance_FreePMsg(performance, (DMUS_PMSG *)notif); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 50, (DMUS_PMSG **)¬if); + ok(!ret, "got %#lx\n", ret); + check_dmus_notification_pmsg(notif, music_time + length, DMUS_PMSGF_TOOL_IMMEDIATE, + &GUID_NOTIFICATION_SEGMENT, DMUS_NOTIFICATION_SEGEND, state); + hr = IDirectMusicPerformance_FreePMsg(performance, (DMUS_PMSG *)notif); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 50, &msg); + ok(!ret, "got %#lx\n", ret); + check_dmus_dirty_pmsg(msg, music_time + length); + hr = IDirectMusicPerformance_FreePMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 50, (DMUS_PMSG **)¬if); + ok(!ret, "got %#lx\n", ret); + } check_dmus_notification_pmsg(notif, music_time, DMUS_PMSGF_TOOL_IMMEDIATE, &GUID_NOTIFICATION_SEGMENT, DMUS_NOTIFICATION_SEGABORT, state); hr = IDirectMusicPerformance_FreePMsg(performance, (DMUS_PMSG *)notif);
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55637 --- dlls/dmime/tests/dmime.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 47a22441dde..bce82e26a59 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3296,8 +3296,6 @@ static void test_notification_pmsg(void) hr = IDirectMusicPerformance_FreePMsg(performance, msg); ok(hr == S_OK, "got %#lx\n", hr);
- ret = test_tool_wait_message(tool, 50, &msg); - ok(ret == WAIT_TIMEOUT, "got %#lx\n", ret); ret = test_tool_wait_message(tool, 500, &msg); ok(!ret, "got %#lx\n", ret); check_dmus_dirty_pmsg(msg, music_time + length); @@ -3534,9 +3532,6 @@ static void test_notification_pmsg(void) hr = IDirectMusicPerformance_FreePMsg(performance, msg); ok(hr == S_OK, "got %#lx\n", hr);
- ret = test_tool_wait_message(tool, 500, &msg); - ok(ret == WAIT_TIMEOUT, "got %#lx\n", ret); - IDirectMusicSegmentState_Release(state); IDirectMusicSegment_Release(segment);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=141286
Your paranoid android.
=== w8 (32 bit report) ===
dmime: dmime.c:4525: Test failed: got DEADBEEF