Paul Vriens : d3d9: Don't treat missing d3d9.dll as a failure.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Dec 14 05:23:29 CST 2005
Module: wine
Branch: refs/heads/master
Commit: 9a1bc10f5d7d8417110a354e2feadf5ef9da1023
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=9a1bc10f5d7d8417110a354e2feadf5ef9da1023
Author: Paul Vriens <Paul.Vriens at xs4all.nl>
Date: Wed Dec 14 10:50:52 2005 +0100
d3d9: Don't treat missing d3d9.dll as a failure.
---
dlls/d3d9/tests/shader.c | 18 ++++++++++++------
dlls/d3d9/tests/stateblock.c | 18 ++++++++++++------
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d9/tests/shader.c b/dlls/d3d9/tests/shader.c
index 8622e6e..6da5164 100644
--- a/dlls/d3d9/tests/shader.c
+++ b/dlls/d3d9/tests/shader.c
@@ -20,19 +20,16 @@
#include <d3d9.h>
#include "wine/test.h"
+static HMODULE d3d9_handle = 0;
+
static IDirect3DDevice9 *init_d3d9(void)
{
IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0;
- HMODULE d3d9_handle = 0;
IDirect3D9 *d3d9_ptr = 0;
IDirect3DDevice9 *device_ptr = 0;
D3DPRESENT_PARAMETERS present_parameters;
HRESULT hres;
- d3d9_handle = LoadLibrary("d3d9");
- ok(d3d9_handle != NULL, "Failed to load d3d9.\n");
- if (!d3d9_handle) return NULL;
-
d3d9_create = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
ok(d3d9_create != NULL, "Failed to get address of Direct3DCreate9\n");
if (!d3d9_create) return NULL;
@@ -136,7 +133,16 @@ static void test_get_set_pixel_shader(ID
START_TEST(shader)
{
D3DCAPS9 caps;
- IDirect3DDevice9 *device_ptr = init_d3d9();
+ IDirect3DDevice9 *device_ptr;
+
+ d3d9_handle = LoadLibraryA("d3d9.dll");
+ if (!d3d9_handle)
+ {
+ trace("Could not load d3d9.dll, skipping tests\n");
+ return;
+ }
+
+ device_ptr = init_d3d9();
if (!device_ptr) return;
IDirect3DDevice9_GetDeviceCaps(device_ptr, &caps);
diff --git a/dlls/d3d9/tests/stateblock.c b/dlls/d3d9/tests/stateblock.c
index dcb49b8..61b5be5 100644
--- a/dlls/d3d9/tests/stateblock.c
+++ b/dlls/d3d9/tests/stateblock.c
@@ -19,19 +19,16 @@
#include <d3d9.h>
#include "wine/test.h"
+static HMODULE d3d9_handle = 0;
+
static IDirect3DDevice9 *init_d3d9(void)
{
IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion) = 0;
- HMODULE d3d9_handle = 0;
IDirect3D9 *d3d9_ptr = 0;
IDirect3DDevice9 *device_ptr = 0;
D3DPRESENT_PARAMETERS present_parameters;
HRESULT hres;
- d3d9_handle = LoadLibrary("d3d9");
- ok(d3d9_handle != NULL, "Failed to load d3d9.\n");
- if (!d3d9_handle) return NULL;
-
d3d9_create = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
ok(d3d9_create != NULL, "Failed to get address of Direct3DCreate9\n");
if (!d3d9_create) return NULL;
@@ -83,6 +80,15 @@ static void test_begin_end_state_block(I
START_TEST(stateblock)
{
- IDirect3DDevice9 *device_ptr = init_d3d9();
+ IDirect3DDevice9 *device_ptr;
+
+ d3d9_handle = LoadLibraryA("d3d9.dll");
+ if (!d3d9_handle)
+ {
+ trace("Could not load d3d9.dll, skipping tests\n");
+ return;
+ }
+
+ device_ptr = init_d3d9();
test_begin_end_state_block(device_ptr);
}
More information about the wine-cvs
mailing list