Francois Gouget : dsound/tests: The tests link with dsound. dll so use GetModuleHandle() instead of LoadLibrary().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 12 05:39:05 CST 2007


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

Author: Francois Gouget <fgouget at free.fr>
Date:   Thu Jan 11 15:40:08 2007 +0100

dsound/tests: The tests link with dsound.dll so use GetModuleHandle() instead of LoadLibrary().

---

 dlls/dsound/tests/capture.c |   12 ++++--------
 dlls/dsound/tests/ds3d8.c   |    8 ++------
 dlls/dsound/tests/dsound8.c |    8 ++------
 dlls/dsound/tests/duplex.c  |    8 ++------
 dlls/dsound/tests/propset.c |    8 ++------
 5 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c
index e409aee..2fb46b7 100644
--- a/dlls/dsound/tests/capture.c
+++ b/dlls/dsound/tests/capture.c
@@ -645,9 +645,7 @@ static BOOL WINAPI dscenum_callback(LPGU
     }
 
     /* try a non PCM format */
-    if (0)
-    {
-    /* FIXME: Why is this commented out? */
+#if 0
     init_format(&wfx,WAVE_FORMAT_MULAW,8000,8,1);
     ZeroMemory(&bufdesc, sizeof(bufdesc));
     bufdesc.dwSize=sizeof(bufdesc);
@@ -666,12 +664,10 @@ static BOOL WINAPI dscenum_callback(LPGU
 	ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, "
            "should have 0\n",ref);
     }
-    }
+#endif
 
     /* Try an invalid format to test error handling */
-    if (0)
-    {
-    /* FIXME: Remove this test altogether? */
+#if 0
     init_format(&wfx,WAVE_FORMAT_PCM,2000000,16,2);
     ZeroMemory(&bufdesc, sizeof(bufdesc));
     bufdesc.dwSize=sizeof(bufdesc);
@@ -684,7 +680,7 @@ static BOOL WINAPI dscenum_callback(LPGU
     rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL);
     ok(rc!=DS_OK,"IDirectSoundCapture_CreateCaptureBuffer() should have failed "
        "at 2 MHz %s\n",DXGetErrorString8(rc));
-    }
+#endif
 
 EXIT:
     if (dsco!=NULL) {
diff --git a/dlls/dsound/tests/ds3d8.c b/dlls/dsound/tests/ds3d8.c
index 15f8780..0a45a7d 100644
--- a/dlls/dsound/tests/ds3d8.c
+++ b/dlls/dsound/tests/ds3d8.c
@@ -1162,12 +1162,8 @@ START_TEST(ds3d8)
 
     CoInitialize(NULL);
 
-    hDsound = LoadLibraryA("dsound.dll");
-    if (!hDsound) {
-        trace("dsound.dll not found\n");
-        return;
-    }
-
+    hDsound = GetModuleHandleA("dsound.dll");
+    ok(hDsound != NULL, "dsound.dll not loaded!\n");
     trace("DLL Version: %s\n", get_file_version("dsound.dll"));
 
     pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c
index 5391345..02373f5 100644
--- a/dlls/dsound/tests/dsound8.c
+++ b/dlls/dsound/tests/dsound8.c
@@ -852,12 +852,8 @@ START_TEST(dsound8)
 
     CoInitialize(NULL);
 
-    hDsound = LoadLibraryA("dsound.dll");
-    if (!hDsound) {
-        trace("dsound.dll not found\n");
-        return;
-    }
-
+    hDsound = GetModuleHandleA("dsound.dll");
+    ok(hDsound != NULL, "dsound.dll not loaded!\n");
     trace("DLL Version: %s\n", get_file_version("dsound.dll"));
 
     pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");
diff --git a/dlls/dsound/tests/duplex.c b/dlls/dsound/tests/duplex.c
index dda7e47..d0be144 100644
--- a/dlls/dsound/tests/duplex.c
+++ b/dlls/dsound/tests/duplex.c
@@ -237,12 +237,8 @@ START_TEST(duplex)
 
     CoInitialize(NULL);
 
-    hDsound = LoadLibraryA("dsound.dll");
-    if (!hDsound) {
-        trace("dsound.dll not found\n");
-        goto done;
-    }
-
+    hDsound = GetModuleHandleA("dsound.dll");
+    ok(hDsound != NULL, "dsound.dll not loaded!\n");
     trace("DLL Version: %s\n", get_file_version("dsound.dll"));
 
     pDirectSoundFullDuplexCreate=(void*)GetProcAddress(hDsound,"DirectSoundFullDuplexCreate");
diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c
index 3c9a3d4..21e91df 100644
--- a/dlls/dsound/tests/propset.c
+++ b/dlls/dsound/tests/propset.c
@@ -722,12 +722,8 @@ START_TEST(propset)
 
     CoInitialize(NULL);
 
-    hDsound = LoadLibraryA("dsound.dll");
-    if (!hDsound) {
-        trace("dsound.dll not found\n");
-        return;
-    }
-
+    hDsound = GetModuleHandleA("dsound.dll");
+    ok(hDsound != NULL, "dsound.dll not loaded!\n");
     trace("DLL Version: %s\n", get_file_version("dsound.dll"));
 
     pDirectSoundCreate8 = (void*)GetProcAddress(hDsound, "DirectSoundCreate8");




More information about the wine-cvs mailing list