Paul Vriens : winmm/tests: Fix the failures on Win9x and WinMe.

Alexandre Julliard julliard at winehq.org
Fri Oct 10 08:06:33 CDT 2008


Module: wine
Branch: master
Commit: 6c0467c18c63956d09260642e5f26ff1dc84853b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6c0467c18c63956d09260642e5f26ff1dc84853b

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Thu Oct  9 16:51:44 2008 +0200

winmm/tests: Fix the failures on Win9x and WinMe.

---

 dlls/winmm/tests/mci.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index 90a185f..9138b60 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -31,15 +31,19 @@ START_TEST(mci)
     const char command_sysinfo[] = "sysinfo waveaudio quantity open";
     MSG msg;
     char buf[1024];
+    HWND hwnd;
+
+    hwnd = CreateWindowExA(0, "winmm test", "", WS_POPUP, 0,0,100,100,
+                           0, 0, 0, NULL);
 
     err = mciSendString(command_open, NULL, 0, NULL);
     ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_open, err);
 
-    err = mciSendString(command_close_my, NULL, 0, NULL);
+    err = mciSendString(command_close_my, NULL, 0, hwnd);
     ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_close_my, err);
 
-    ok(PeekMessageW( &msg, (HWND)-1, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
-    ok(msg.hwnd == NULL, "got %p instead of NULL\n", msg.hwnd);
+    ok(PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
+    ok(msg.hwnd == hwnd, "Didn't get the handle to our test window\n");
     ok(msg.message == MM_MCINOTIFY, "got %04x instead of MM_MCINOTIFY\n", msg.message);
     ok(msg.wParam == MCI_NOTIFY_SUCCESSFUL, "got %08lx instead of MCI_NOTIFY_SUCCESSFUL\n", msg.wParam);
 
@@ -47,7 +51,7 @@ START_TEST(mci)
     todo_wine ok(!err,"mciSendString(%s, NULL, 0 , NULL) returned error: %d\n", command_close_all, err);
 
     memset(buf, 0, sizeof(buf));
-    err = mciSendString(command_close_all, buf, sizeof(buf), NULL);
+    err = mciSendString(command_close_all, buf, sizeof(buf), hwnd);
     todo_wine ok(!err,"mciSendString(%s, buf, sizeof(buf) , NULL) returned error: %d\n", command_close_all, err);
     todo_wine ok(buf[0] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL) changed output buffer: %s\n", command_close_all, buf);
 
@@ -57,7 +61,10 @@ START_TEST(mci)
     todo_wine ok(buf[0] == '0' && buf[1] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL), expected output buffer '0', got: '%s'\n", command_sysinfo, buf);
 
     err = mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, 0);
-    todo_wine ok(err == MCIERR_INVALID_DEVICE_ID,
+    todo_wine ok(err == MCIERR_INVALID_DEVICE_ID ||
+        broken(!err), /* Win9x and WinMe */
         "mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, NULL) returned %d instead of %d\n",
         err, MCIERR_INVALID_DEVICE_ID);
+
+    DestroyWindow(hwnd);
 }




More information about the wine-cvs mailing list