Paul Vriens : d3dxof/tests: Run tests again on win9x.

Alexandre Julliard julliard at winehq.org
Tue Aug 26 07:07:37 CDT 2008


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

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Tue Aug 26 08:19:03 2008 +0200

d3dxof/tests: Run tests again on win9x.

---

 dlls/d3dxof/tests/d3dxof.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dxof/tests/d3dxof.c b/dlls/d3dxof/tests/d3dxof.c
index 8ee58b3..b38fa5d 100644
--- a/dlls/d3dxof/tests/d3dxof.c
+++ b/dlls/d3dxof/tests/d3dxof.c
@@ -23,6 +23,9 @@
 #include "wine/test.h"
 #include "dxfile.h"
 
+static HMODULE hd3dxof;
+static HRESULT (WINAPI *pDirectXFileCreate)(LPDIRECTXFILE*);
+
 char template[] =
 "xof 0302txt 0064\n"
 "template Header\n"
@@ -33,6 +36,14 @@ char template[] =
 "DWORD flags ;\n"
 "}\n";
 
+static void init_function_pointers(void)
+{
+    /* We have to use LoadLibrary as no d3dxof functions are referenced directly */
+    hd3dxof = LoadLibraryA("d3dxof.dll");
+
+    pDirectXFileCreate = (void *)GetProcAddress(hd3dxof, "DirectXFileCreate");
+}
+
 static unsigned long getRefcount(IUnknown *iface)
 {
     IUnknown_AddRef(iface);
@@ -44,11 +55,18 @@ static void test_d3dxof(void)
     HRESULT hr;
     unsigned long ref;
     LPDIRECTXFILE lpDirectXFile = NULL;
-    hr = DirectXFileCreate(&lpDirectXFile);
+
+    if (!pDirectXFileCreate)
+    {
+        win_skip("DirectXFileCreate is not available\n");
+        return;
+    }
+
+    hr = pDirectXFileCreate(&lpDirectXFile);
     ok(hr == DXFILE_OK, "DirectXFileCreate: %x\n", hr);
     if(!lpDirectXFile)
     {
-        trace("Couldn't create DirectXFile interface, skipping tests\n");
+        skip("Couldn't create DirectXFile interface\n");
         return;
     }
 
@@ -71,5 +89,9 @@ static void test_d3dxof(void)
 
 START_TEST(d3dxof)
 {
+    init_function_pointers();
+
     test_d3dxof();
+
+    FreeLibrary(hd3dxof);
 }




More information about the wine-cvs mailing list