Jörg Höhle : winmm/tests: Fix MCI test failure on Win9x/WinME.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 09:39:15 CST 2009


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

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Sat Nov  7 23:57:24 2009 +0100

winmm/tests: Fix MCI test failure on Win9x/WinME.

---

 dlls/winmm/tests/mci.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index f783cd6..e5c7815 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <stdio.h>
 #include "windows.h"
 #include "mmsystem.h"
 #include "mmreg.h"
@@ -523,8 +524,8 @@ static void test_AutoOpenWAVE(HWND hwnd)
      * fixme:winmm:MMDRV_Exit Closing while ll-driver open
      */
     MCIERROR err;
-    char buf[1024];
-    memset(buf, 0, sizeof(buf));
+    char buf[512], path[300], command[330];
+    memset(buf, 0, sizeof(buf)); memset(path, 0, sizeof(path));
 
     /* Do not crash on NULL buffer pointer */
     err = mciSendString("sysinfo waveaudio quantity open", NULL, 0, NULL);
@@ -559,9 +560,18 @@ static void test_AutoOpenWAVE(HWND hwnd)
     /* This is the alias, not necessarily a file name. */
     if(!err) ok(!strcmp(buf,"tempfile.wav"), "sysinfo name 1 open returned: %s\n", buf);
 
+    /* Save the full pathname to the file. */
+    err = mciSendString("info tempfile.wav file", path, sizeof(path), NULL);
+    ok(!err,"mci info tempfile.wav file returned error: %d\n", err);
+    if(err) strcpy(path,"tempfile.wav");
+
     err = mciSendString("status tempfile.wav mode", NULL, 0, hwnd);
     ok(!err,"mci status tempfile.wav mode without buffer returned error: %d\n", err);
 
+    sprintf(command,"status \"%s\" mode",path);
+    err = mciSendString(command, buf, sizeof(buf), hwnd);
+    ok(!err,"mci status full-path-to-tempfile.wav mode returned error: %d\n", err);
+
     buf[0]=0;
     err = mciSendString("status tempfile.wav mode", buf, sizeof(buf), hwnd);
     ok(!err,"mci status tempfile.wav mode returned error: %d\n", err);
@@ -613,7 +623,11 @@ static void test_AutoOpenWAVE(HWND hwnd)
     ok(!err,"mci sysinfo waveaudio quantity open after close returned error: %d\n", err);
     if(!err) todo_wine ok(!strcmp(buf,"0"), "sysinfo quantity open expected 0 after auto-close, got: %s\n", buf);
 
-    err = mciSendString("status tempfile.wav mode wait", buf, sizeof(buf), hwnd);
+    /* w95-WinME (not w2k/XP) switch to C:\ after auto-playing once.  Prevent
+     * MCIERR_FILE_NOT_FOUND by using the full path name from the Info file command.
+     */
+    sprintf(command,"status \"%s\" mode wait",path);
+    err = mciSendString(command, buf, sizeof(buf), hwnd);
     ok(!err,"mci re-auto-open status mode returned error: %d\n", err);
     if(!err) ok(!strcmp(buf,"stopped"), "mci re-auto-open status mode, got: %s\n", buf);
 
@@ -622,7 +636,8 @@ static void test_AutoOpenWAVE(HWND hwnd)
     if(!err) ok(!strcmp(buf,"waveaudio"), "mci capability device type response: %s\n", buf);
 
     /* waveaudio forbids Pause without Play. */
-    err = mciSendString("pause tempfile.wav", NULL, 0, hwnd);
+    sprintf(command,"pause \"%s\"",path);
+    err = mciSendString(command, NULL, 0, hwnd);
     ok(err==MCIERR_NONAPPLICABLE_FUNCTION,"mci auto-open pause returned error: %d\n", err);
 }
 




More information about the wine-cvs mailing list