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

Alexandre Julliard julliard at winehq.org
Thu Jan 12 13:19:22 CST 2012


Module: wine
Branch: master
Commit: 93bfa2b5be8aea6da5ba82526c7e6f2762250001
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=93bfa2b5be8aea6da5ba82526c7e6f2762250001

Author: Michael Stefaniuc <mstefani at 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();
 }




More information about the wine-cvs mailing list