dsound: tests fix for DSERR_ALLOCATED
Robert Reif
reif at earthlink.net
Sat Oct 23 09:44:29 CDT 2004
Don't consider a device in use a failure.
-------------- next part --------------
Index: dlls/dsound/tests/capture.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/capture.c,v
retrieving revision 1.12
diff -u -r1.12 capture.c
--- dlls/dsound/tests/capture.c 22 Oct 2004 19:51:54 -0000 1.12
+++ dlls/dsound/tests/capture.c 23 Oct 2004 14:32:16 -0000
@@ -446,8 +446,8 @@
} else if (rc==DSERR_BADFORMAT) {
ok(!(dsccaps.dwFormats & formats[f][3]),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
- "capture buffer: format listed as supported but using it failed\n");
- if (!(dsccaps.dwFormats & formats[f][3]))
+ "capture buffer: format listed as supported but using it failed\n");
+ if (!(dsccaps.dwFormats & formats[f][3]))
trace(" Format not supported: %s\n", format_string(&wfx));
} else if (rc==DSERR_ALLOCATED)
trace(" Already In Use\n");
Index: dlls/dsound/tests/dsound.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound.c,v
retrieving revision 1.41
diff -u -r1.41 dsound.c
--- dlls/dsound/tests/dsound.c 21 Oct 2004 19:51:10 -0000 1.41
+++ dlls/dsound/tests/dsound.c 23 Oct 2004 14:32:16 -0000
@@ -94,10 +94,15 @@
DXGetErrorString8(rc));
rc=IDirectSound_Initialize(dso,lpGuid);
- ok(rc==DS_OK||rc==DSERR_NODRIVER,"IDirectSound_Initialize() failed: %s\n",
- DXGetErrorString8(rc));
- if (rc==DSERR_NODRIVER)
+ ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "IDirectSound_Initialize() failed: %s\n",DXGetErrorString8(rc));
+ if (rc==DSERR_NODRIVER) {
+ trace(" No Driver\n");
+ return;
+ } else if (rc==DSERR_ALLOCATED) {
+ trace(" Already Allocated\n");
return;
+ }
}
/* DSOUND: Error: Invalid caps buffer */
@@ -210,21 +215,22 @@
/* try with no device specified */
rc=DirectSoundCreate(NULL,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate(NULL) failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "DirectSoundCreate(NULL) failed: %s\n",DXGetErrorString8(rc));
if (rc==S_OK && dso)
IDirectSound_test(dso, TRUE, NULL);
/* try with default playback device specified */
rc=DirectSoundCreate(&DSDEVID_DefaultPlayback,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate(DSDEVID_DefaultPlayback)"
- " failed: %s\n", DXGetErrorString8(rc));
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "DirectSoundCreate(DSDEVID_DefaultPlayback) failed: %s\n",
+ DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound_test(dso, TRUE, NULL);
/* try with default voice playback device specified */
rc=DirectSoundCreate(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
"DirectSoundCreate(DSDEVID_DefaultVoicePlayback) failed: %s\n",
DXGetErrorString8(rc));
if (rc==DS_OK && dso)
Index: dlls/dsound/tests/dsound8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound8.c,v
retrieving revision 1.10
diff -u -r1.10 dsound8.c
--- dlls/dsound/tests/dsound8.c 21 Oct 2004 19:51:10 -0000 1.10
+++ dlls/dsound/tests/dsound8.c 23 Oct 2004 14:32:17 -0000
@@ -103,10 +103,15 @@
DXGetErrorString8(rc));
rc=IDirectSound8_Initialize(dso,lpGuid);
- ok(rc==DS_OK||rc==DSERR_NODRIVER,"IDirectSound8_Initialize() failed: %s\n",
- DXGetErrorString8(rc));
- if (rc==DSERR_NODRIVER)
+ ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "IDirectSound8_Initialize() failed: %s\n",DXGetErrorString8(rc));
+ if (rc==DSERR_NODRIVER) {
+ trace(" No Driver\n");
+ return;
+ } else if (rc==DSERR_ALLOCATED) {
+ trace(" Already In Use\n");
return;
+ }
}
/* DSOUND: Error: Invalid caps buffer */
@@ -222,22 +227,22 @@
/* try with no device specified */
rc=pDirectSoundCreate8(NULL,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultPlayback,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
/* try with default voice playback device specified */
rc=pDirectSoundCreate8(&DSDEVID_DefaultVoicePlayback,&dso,NULL);
- ok(rc==S_OK||rc==DSERR_NODRIVER,"DirectSoundCreate8() failed: %s\n",
- DXGetErrorString8(rc));
+ ok(rc==S_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED,
+ "DirectSoundCreate8() failed: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK && dso)
IDirectSound8_test(dso, TRUE, NULL);
More information about the wine-patches
mailing list