Module: wine Branch: master Commit: 93bfa2b5be8aea6da5ba82526c7e6f2762250001 URL: http://source.winehq.org/git/wine.git/?a=commit;h=93bfa2b5be8aea6da5ba82526c...
Author: Michael Stefaniuc mstefani@redhat.de Date: Thu Jan 12 00:36:08 2012 +0100
dsound/tests: Sanitize START_TEST() in capture.c.
---
dlls/dsound/tests/capture.c | 34 +++++++++++++++------------------- 1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 760f0cc..02ef46a 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -177,7 +177,7 @@ EXIT: "should have 0\n", ref); }
-static void IDirectSoundCapture_tests(void) +static void test_capture(void) { HRESULT rc; LPDIRECTSOUNDCAPTURE dsco=NULL; @@ -659,7 +659,7 @@ EXIT: return TRUE; }
-static void capture_tests(void) +static void test_enumerate(void) { HRESULT rc; rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL); @@ -673,25 +673,21 @@ START_TEST(capture) CoInitialize(NULL);
hDsound = LoadLibrary("dsound.dll"); - if (hDsound) - { - - pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound, - "DirectSoundCaptureCreate"); - pDirectSoundCaptureEnumerateA=(void*)GetProcAddress(hDsound, - "DirectSoundCaptureEnumerateA"); - if (pDirectSoundCaptureCreate && pDirectSoundCaptureEnumerateA) - { - IDirectSoundCapture_tests(); - capture_tests(); - } - else - skip("capture test skipped\n"); + if (!hDsound) { + skip("dsound.dll not found!\n"); + return; + }
- FreeLibrary(hDsound); + pDirectSoundCaptureCreate = (void*)GetProcAddress(hDsound, "DirectSoundCaptureCreate"); + pDirectSoundCaptureEnumerateA = (void*)GetProcAddress(hDsound, "DirectSoundCaptureEnumerateA"); + if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA) { + skip("capture test skipped\n"); + return; } - else - skip("dsound.dll not found!\n");
+ test_capture(); + test_enumerate(); + + FreeLibrary(hDsound); CoUninitialize(); }