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

Francois Gouget fgouget at free.fr
Thu Jan 11 08:40:08 CST 2007


---

This is a NOP, it just seems a bit cleaner to me.

 dlls/dsound/tests/capture.c |    8 ++------
 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, 10 insertions(+), 30 deletions(-)

diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c
index b78541f..7d33627 100644
--- a/dlls/dsound/tests/capture.c
+++ b/dlls/dsound/tests/capture.c
@@ -706,12 +706,8 @@ START_TEST(capture)
 
     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"));
 
     pDirectSoundCaptureCreate=(void*)GetProcAddress(hDsound,"DirectSoundCaptureCreate");
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");
-- 
1.4.4.2




More information about the wine-patches mailing list