[DSOUND] fix capture test on windows 95

Robert Reif reif at earthlink.net
Thu Nov 17 06:25:32 CST 2005


Robert Reif wrote:

> Changelog:
> - Handle failure on Windows 95 properly.
> - Make two functions available to all files.

- Make format_string() const correct.
-------------- next part --------------
Index: dlls/dsound/tests/capture.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/capture.c,v
retrieving revision 1.25
diff -p -u -r1.25 capture.c
--- dlls/dsound/tests/capture.c	23 Sep 2005 10:05:40 -0000	1.25
+++ dlls/dsound/tests/capture.c	17 Nov 2005 12:21:18 -0000
@@ -38,7 +38,7 @@
 static HRESULT (WINAPI *pDirectSoundCaptureCreate)(LPCGUID,LPDIRECTSOUNDCAPTURE*,LPUNKNOWN)=NULL;
 static HRESULT (WINAPI *pDirectSoundCaptureEnumerateA)(LPDSENUMCALLBACKA,LPVOID)=NULL;
 
-static const char * get_format_str(WORD format)
+const char * get_format_str(WORD format)
 {
     static char msg[32];
 #define WAVE_FORMAT(f) case f: return #f
@@ -91,7 +91,7 @@ static const char * get_format_str(WORD 
     return msg;
 }
 
-static char * format_string(WAVEFORMATEX* wfx)
+const char * format_string(const WAVEFORMATEX* wfx)
 {
     static char str[64];
 
@@ -129,8 +129,9 @@ static void IDirectSoundCapture_test(LPD
     if (initialized == FALSE) {
         /* try unitialized object */
         rc=IDirectSoundCapture_GetCaps(dsco,0);
-        ok(rc==DSERR_UNINITIALIZED, "IDirectSoundCapture_GetCaps(NULL) "
-           "should have returned DSERR_UNINITIALIZED, returned: %s\n",
+        ok(rc==DSERR_UNINITIALIZED||rc==E_INVALIDARG,
+           "IDirectSoundCapture_GetCaps(NULL) should have returned "
+           "DSERR_UNINITIALIZED or E_INVALIDARG, returned: %s\n",
            DXGetErrorString8(rc));
 
         rc=IDirectSoundCapture_GetCaps(dsco, &dsccaps);
@@ -139,10 +140,11 @@ static void IDirectSoundCapture_test(LPD
            DXGetErrorString8(rc));
 
         rc=IDirectSoundCapture_Initialize(dsco, lpGuid);
-        ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||rc==E_FAIL,
+        ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED||
+           rc==E_FAIL||rc==E_INVALIDARG,
            "IDirectSoundCapture_Initialize() failed: %s\n",
            DXGetErrorString8(rc));
-        if (rc==DSERR_NODRIVER) {
+        if (rc==DSERR_NODRIVER||rc==E_INVALIDARG) {
             trace("  No Driver\n");
             goto EXIT;
         } else if (rc==E_FAIL) {
Index: dlls/dsound/tests/dsound_test.h
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound_test.h,v
retrieving revision 1.9
diff -p -u -r1.9 dsound_test.h
--- dlls/dsound/tests/dsound_test.h	5 Mar 2005 10:49:08 -0000	1.9
+++ dlls/dsound/tests/dsound_test.h	17 Nov 2005 12:21:18 -0000
@@ -62,3 +62,5 @@ extern void test_buffer8(LPDIRECTSOUND8,
 extern const char * getDSBCAPS(DWORD xmask);
 extern int align(int length, int align);
 extern const char * get_file_version(const char * file_name);
+extern const char * get_format_str(WORD format);
+extern const char * format_string(const WAVEFORMATEX* wfx);


More information about the wine-patches mailing list