dsound capture test patch
Robert Reif
reif at earthlink.net
Thu Oct 21 17:56:19 CDT 2004
Don't consider a bad format an error unless the capabilities say it
should be supported.
Don't consider a device already in use an error.
-------------- next part --------------
Index: dlls/dsound/tests/capture.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/capture.c,v
retrieving revision 1.11
diff -u -r1.11 capture.c
--- dlls/dsound/tests/capture.c 19 Oct 2004 21:10:41 -0000 1.11
+++ dlls/dsound/tests/capture.c 21 Oct 2004 22:46:21 -0000
@@ -435,7 +435,7 @@
if (winetest_interactive)
trace(" Testing the capture buffer at %s\n", format_string(&wfx));
rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL);
- ok((rc==DS_OK)&&(dscbo!=NULL),
+ ok(((rc==DS_OK)&&(dscbo!=NULL))||(rc==DSERR_BADFORMAT)||(rc==DSERR_ALLOCATED),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"capture buffer: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) {
@@ -443,7 +443,14 @@
ref=IDirectSoundCaptureBuffer_Release(dscbo);
ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, "
"should have 0\n",ref);
- }
+ } 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]))
+ trace(" Format not supported: %s\n", format_string(&wfx));
+ } else if (rc==DSERR_ALLOCATED)
+ trace(" Already In Use\n");
}
/* try a non PCM format */
Index: dlls/dsound/tests/dsound_test.h
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound_test.h,v
retrieving revision 1.4
diff -u -r1.4 dsound_test.h
--- dlls/dsound/tests/dsound_test.h 25 Aug 2004 02:09:00 -0000 1.4
+++ dlls/dsound/tests/dsound_test.h 21 Oct 2004 22:46:24 -0000
@@ -18,31 +18,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-static const unsigned int formats[][3]={
- { 8000, 8, 1},
- { 8000, 8, 2},
- { 8000, 16, 1},
- { 8000, 16, 2},
- {11025, 8, 1},
- {11025, 8, 2},
- {11025, 16, 1},
- {11025, 16, 2},
- {22050, 8, 1},
- {22050, 8, 2},
- {22050, 16, 1},
- {22050, 16, 2},
- {44100, 8, 1},
- {44100, 8, 2},
- {44100, 16, 1},
- {44100, 16, 2},
- {48000, 8, 1},
- {48000, 8, 2},
- {48000, 16, 1},
- {48000, 16, 2},
- {96000, 8, 1},
- {96000, 8, 2},
- {96000, 16, 1},
- {96000, 16, 2}
+static const unsigned int formats[][4]={
+ { 8000, 8, 1, 0 },
+ { 8000, 8, 2, 0 },
+ { 8000, 16, 1, 0 },
+ { 8000, 16, 2, 0 },
+ {11025, 8, 1, WAVE_FORMAT_1M08 },
+ {11025, 8, 2, WAVE_FORMAT_1S08 },
+ {11025, 16, 1, WAVE_FORMAT_1M16 },
+ {11025, 16, 2, WAVE_FORMAT_1S16 },
+ {22050, 8, 1, WAVE_FORMAT_2M08 },
+ {22050, 8, 2, WAVE_FORMAT_2S08 },
+ {22050, 16, 1, WAVE_FORMAT_2M16 },
+ {22050, 16, 2, WAVE_FORMAT_2S16 },
+ {44100, 8, 1, WAVE_FORMAT_4M08 },
+ {44100, 8, 2, WAVE_FORMAT_4S08 },
+ {44100, 16, 1, WAVE_FORMAT_4M16 },
+ {44100, 16, 2, WAVE_FORMAT_4S16 },
+ {48000, 8, 1, WAVE_FORMAT_48M08 },
+ {48000, 8, 2, WAVE_FORMAT_48S08 },
+ {48000, 16, 1, WAVE_FORMAT_48M16 },
+ {48000, 16, 2, WAVE_FORMAT_48S16 },
+ {96000, 8, 1, WAVE_FORMAT_96M08 },
+ {96000, 8, 2, WAVE_FORMAT_96S08 },
+ {96000, 16, 1, WAVE_FORMAT_96M16 },
+ {96000, 16, 2, WAVE_FORMAT_96S16 }
};
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
More information about the wine-patches
mailing list