Module: wine Branch: master Commit: b201cf1bcaa30cb0019023316607e72e8bd66ad2 URL: https://gitlab.winehq.org/wine/wine/-/commit/b201cf1bcaa30cb0019023316607e72...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Oct 6 16:15:08 2023 +0200
dmime/tests: Tests interaction between CloseDown and notifications.
---
dlls/dmime/tests/dmime.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 87d938a9015..c892f25c884 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3107,6 +3107,8 @@ static void test_notification_pmsg(void) ok(hr == S_OK, "got %#lx\n", hr); hr = IDirectMusicPerformance_AddNotificationType(performance, &GUID_NOTIFICATION_SEGMENT); ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_AddNotificationType(performance, &GUID_NOTIFICATION_SEGMENT); + todo_wine ok(hr == S_FALSE, "got %#lx\n", hr);
hr = IDirectMusicPerformance_PlaySegment(performance, segment, 0, 0, NULL); ok(hr == S_OK, "got %#lx\n", hr); @@ -3178,8 +3180,6 @@ static void test_notification_pmsg(void) ok(ret == WAIT_TIMEOUT, "got %#lx\n", ret); ok(!msg, "got %p\n", msg);
- IDirectMusicSegment_Release(segment); - hr = IDirectMusicPerformance_RemoveNotificationType(performance, &GUID_NOTIFICATION_PERFORMANCE); ok(hr == S_OK, "got %#lx\n", hr); hr = IDirectMusicPerformance_RemoveNotificationType(performance, &GUID_NOTIFICATION_SEGMENT); @@ -3237,8 +3237,34 @@ static void test_notification_pmsg(void) ok(hr == S_FALSE, "got %#lx\n", hr);
+ /* RemoveNotificationType returns S_FALSE if already removed */ + + hr = IDirectMusicPerformance_RemoveNotificationType(performance, &GUID_NOTIFICATION_PERFORMANCE); + todo_wine ok(hr == S_FALSE, "got %#lx\n", hr); + + + /* CloseDown removes all notifications and notification messages */ + + hr = IDirectMusicPerformance_AddNotificationType(performance, &GUID_NOTIFICATION_SEGMENT); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_PlaySegment(performance, segment, 0, 0, NULL); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 500, (DMUS_PMSG **)¬if); + todo_wine ok(!ret, "got %#lx\n", ret); + if (!ret) + { + check_dmus_notification_pmsg(notif, &GUID_NOTIFICATION_SEGMENT, DMUS_NOTIFICATION_SEGSTART); + hr = IDirectMusicPerformance_FreePMsg(performance, (DMUS_PMSG *)notif); + ok(hr == S_OK, "got %#lx\n", hr); + } + hr = IDirectMusicPerformance_CloseDown(performance); ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_RemoveNotificationType(performance, &GUID_NOTIFICATION_SEGMENT); + todo_wine ok(hr == S_FALSE, "got %#lx\n", hr); + IDirectMusicSegment_Release(segment); +
IDirectMusicPerformance_Release(performance); IDirectMusicTool_Release(tool);