d3d8/tests: Warn that tests were skipped if we could not load d3d8.dll.

Francois Gouget fgouget at codeweavers.com
Thu Jan 11 08:38:11 CST 2007


But report a failed test if a mandatory function is missing from it.
---

Note: This depends on the patch that adds the skip() function.

 dlls/d3d8/tests/d3d8_main.c |    4 ++++
 dlls/d3d8/tests/device.c    |    6 ++++++
 dlls/d3d8/tests/surface.c   |    2 +-
 dlls/d3d8/tests/texture.c   |    2 +-
 dlls/d3d8/tests/volume.c    |    2 +-
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d8/tests/d3d8_main.c b/dlls/d3d8/tests/d3d8_main.c
index a001f31..aee7625 100644
--- a/dlls/d3d8/tests/d3d8_main.c
+++ b/dlls/d3d8/tests/d3d8_main.c
@@ -107,7 +107,11 @@ START_TEST(d3d8_main)
 {
     HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" );
     if (!d3d8_handle)
+    {
+        skip("Could not load d3d8.dll\n");
         return;
+    }
+
     ValidateVertexShader = (void*)GetProcAddress (d3d8_handle, "ValidateVertexShader" );
     ValidatePixelShader = (void*)GetProcAddress (d3d8_handle, "ValidatePixelShader" );
     test_ValidateVertexShader();
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index b9ed2c5..8ec237e 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -763,8 +763,14 @@ static void test_display_modes(void)
 START_TEST(device)
 {
     HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" );
+    if (!d3d8_handle)
+    {
+        skip("Could not load d3d8.dll\n");
+        return;
+    }
 
     pDirect3DCreate8 = (void *)GetProcAddress( d3d8_handle, "Direct3DCreate8" );
+    ok(pDirect3DCreate8 != NULL, "Failed to get address of Direct3DCreate8\n");
     if (pDirect3DCreate8)
     {
         test_display_modes();
diff --git a/dlls/d3d8/tests/surface.c b/dlls/d3d8/tests/surface.c
index 393223c..21f9dfe 100644
--- a/dlls/d3d8/tests/surface.c
+++ b/dlls/d3d8/tests/surface.c
@@ -129,7 +129,7 @@ START_TEST(surface)
     d3d8_handle = LoadLibraryA("d3d8.dll");
     if (!d3d8_handle)
     {
-        trace("Could not load d3d8.dll, skipping tests\n");
+        skip("Could not load d3d8.dll\n");
         return;
     }
 
diff --git a/dlls/d3d8/tests/texture.c b/dlls/d3d8/tests/texture.c
index 500b3c8..3e0b805 100644
--- a/dlls/d3d8/tests/texture.c
+++ b/dlls/d3d8/tests/texture.c
@@ -110,7 +110,7 @@ START_TEST(texture)
     d3d8_handle = LoadLibraryA("d3d8.dll");
     if (!d3d8_handle)
     {
-        trace("Could not load d3d8.dll, skipping tests\n");
+        skip("Could not load d3d8.dll\n");
         return;
     }
 
diff --git a/dlls/d3d8/tests/volume.c b/dlls/d3d8/tests/volume.c
index be4e771..5d339c3 100644
--- a/dlls/d3d8/tests/volume.c
+++ b/dlls/d3d8/tests/volume.c
@@ -129,7 +129,7 @@ START_TEST(volume)
     d3d8_handle = LoadLibraryA("d3d8.dll");
     if (!d3d8_handle)
     {
-        trace("Could not load d3d8.dll, skipping tests\n");
+        skip("Could not load d3d8.dll\n");
         return;
     }
 
-- 
1.4.4.2




More information about the wine-patches mailing list