dsound/tests: Sanitize START_TEST() in capture.c.

This commit is contained in:
Michael Stefaniuc 2012-01-12 00:36:08 +01:00 committed by Alexandre Julliard
parent 4ac20cbc0f
commit 93bfa2b5be
1 changed files with 16 additions and 20 deletions

View File

@ -177,7 +177,7 @@ EXIT:
"should have 0\n", ref); "should have 0\n", ref);
} }
static void IDirectSoundCapture_tests(void) static void test_capture(void)
{ {
HRESULT rc; HRESULT rc;
LPDIRECTSOUNDCAPTURE dsco=NULL; LPDIRECTSOUNDCAPTURE dsco=NULL;
@ -659,7 +659,7 @@ EXIT:
return TRUE; return TRUE;
} }
static void capture_tests(void) static void test_enumerate(void)
{ {
HRESULT rc; HRESULT rc;
rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL); rc=pDirectSoundCaptureEnumerateA(&dscenum_callback,NULL);
@ -673,25 +673,21 @@ START_TEST(capture)
CoInitialize(NULL); CoInitialize(NULL);
hDsound = LoadLibrary("dsound.dll"); hDsound = LoadLibrary("dsound.dll");
if (hDsound) if (!hDsound) {
{ skip("dsound.dll not found!\n");
return;
pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,
"DirectSoundCaptureCreate");
pDirectSoundCaptureEnumerateA=(void*)GetProcAddress(hDsound,
"DirectSoundCaptureEnumerateA");
if (pDirectSoundCaptureCreate && pDirectSoundCaptureEnumerateA)
{
IDirectSoundCapture_tests();
capture_tests();
} }
else
pDirectSoundCaptureCreate = (void*)GetProcAddress(hDsound, "DirectSoundCaptureCreate");
pDirectSoundCaptureEnumerateA = (void*)GetProcAddress(hDsound, "DirectSoundCaptureEnumerateA");
if (!pDirectSoundCaptureCreate || !pDirectSoundCaptureEnumerateA) {
skip("capture test skipped\n"); skip("capture test skipped\n");
return;
}
test_capture();
test_enumerate();
FreeLibrary(hDsound); FreeLibrary(hDsound);
}
else
skip("dsound.dll not found!\n");
CoUninitialize(); CoUninitialize();
} }