From efff88b8340b8d0194fec8a217a3634150c56576 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Fri, 18 Nov 2005 12:04:36 +0000 Subject: [PATCH] Handle failure on Windows 95 properly. Make two functions available to all files. Make format_string() const correct. --- dlls/dsound/tests/capture.c | 14 ++++++++------ dlls/dsound/tests/dsound_test.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index d2cb51cc87b..4443a38e803 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -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 format) 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(LPDIRECTSOUNDCAPTURE dsco, 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(LPDIRECTSOUNDCAPTURE dsco, 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) { diff --git a/dlls/dsound/tests/dsound_test.h b/dlls/dsound/tests/dsound_test.h index 9c84de44871..afb35bb2b20 100644 --- a/dlls/dsound/tests/dsound_test.h +++ b/dlls/dsound/tests/dsound_test.h @@ -62,3 +62,5 @@ extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER, 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);