dsound tests in use fix

Robert Reif reif at earthlink.net
Tue Oct 19 18:06:54 CDT 2004


Don't consider a device that is already in use a test failure.
-------------- next part --------------
Index: dlls/dsound/tests/ds3d.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d.c,v
retrieving revision 1.15
diff -u -r1.15 ds3d.c
--- dlls/dsound/tests/ds3d.c	19 Oct 2004 21:10:41 -0000	1.15
+++ dlls/dsound/tests/ds3d.c	19 Oct 2004 23:00:07 -0000
@@ -875,8 +875,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -1155,6 +1155,9 @@
     rc = test_for_driver(lpGuid);
     if (rc == DSERR_NODRIVER) {
         trace("  No Driver\n");
+        return 1;
+    } else if (rc == DSERR_ALLOCATED) {
+        trace("  Already In Use\n");
         return 1;
     }
 
Index: dlls/dsound/tests/ds3d8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d8.c,v
retrieving revision 1.9
diff -u -r1.9 ds3d8.c
--- dlls/dsound/tests/ds3d8.c	19 Oct 2004 21:10:41 -0000	1.9
+++ dlls/dsound/tests/ds3d8.c	19 Oct 2004 23:00:08 -0000
@@ -789,8 +789,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate8(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -1070,6 +1070,9 @@
     rc = test_for_driver8(lpGuid);
     if (rc == DSERR_NODRIVER) {
         trace("  No Driver\n");
+        return 1;
+    } else if (rc == DSERR_ALLOCATED) {
+        trace("  Already In Use\n");
         return 1;
     }
 
Index: dlls/dsound/tests/dsound.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound.c,v
retrieving revision 1.40
diff -u -r1.40 dsound.c
--- dlls/dsound/tests/dsound.c	19 Oct 2004 21:10:41 -0000	1.40
+++ dlls/dsound/tests/dsound.c	19 Oct 2004 23:00:09 -0000
@@ -249,8 +249,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -349,8 +349,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -491,8 +491,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -628,8 +628,8 @@
 
     /* Create the DirectSound object */
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -725,7 +725,9 @@
     trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
     rc = test_dsound(lpGuid);
     if (rc == DSERR_NODRIVER)
-        trace(" No Driver\n");
+        trace("  No Driver\n");
+    else if (rc == DSERR_ALLOCATED)
+        trace("  Already In Use\n");
     else {
         test_primary(lpGuid);
         test_primary_secondary(lpGuid);
Index: dlls/dsound/tests/dsound8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound8.c,v
retrieving revision 1.9
diff -u -r1.9 dsound8.c
--- dlls/dsound/tests/dsound8.c	19 Oct 2004 21:10:41 -0000	1.9
+++ dlls/dsound/tests/dsound8.c	19 Oct 2004 23:00:10 -0000
@@ -260,8 +260,8 @@
 
     /* Create the DirectSound8 object */
     rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -371,8 +371,8 @@
 
     /* Create the DirectSound object */
     rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -513,8 +513,8 @@
 
     /* Create the DirectSound object */
     rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -650,8 +650,8 @@
 
     /* Create the DirectSound object */
     rc=pDirectSoundCreate8(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK)
         return rc;
 
@@ -748,6 +748,8 @@
     rc = test_dsound8(lpGuid);
     if (rc == DSERR_NODRIVER)
         trace("  No Driver\n");
+    else if (rc == DSERR_ALLOCATED)
+        trace("  Already In Use\n");
     else {
         test_primary8(lpGuid);
         test_primary_secondary8(lpGuid);
Index: dlls/dsound/tests/propset.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/propset.c,v
retrieving revision 1.11
diff -u -r1.11 propset.c
--- dlls/dsound/tests/propset.c	19 Oct 2004 21:10:41 -0000	1.11
+++ dlls/dsound/tests/propset.c	19 Oct 2004 23:00:10 -0000
@@ -268,11 +268,13 @@
     trace("*** Testing %s - %s ***\n",lpcstrDescription,lpcstrModule);
 
     rc=DirectSoundCreate(lpGuid,&dso,NULL);
-    ok(rc==DS_OK||rc==DSERR_NODRIVER,"DirectSoundCreate() failed: %s\n",
-       DXGetErrorString8(rc));
+    ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+       "DirectSoundCreate() failed: %s\n",DXGetErrorString8(rc));
     if (rc!=DS_OK) {
         if (rc==DSERR_NODRIVER)
             trace("  No Driver\n");
+        else if (rc == DSERR_ALLOCATED)
+            trace("  Already In Use\n");
         goto EXIT;
     }
 


More information about the wine-patches mailing list