[PATCH 7/8] dsound/tests: Sanitize START_TEST() in capture.c
Michael Stefaniuc
mstefani at redhat.de
Wed Jan 11 17:36:08 CST 2012
---
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();
}
--
1.7.6.5
More information about the wine-patches
mailing list