Commit 12b9d371 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

d3d9/tests: Skip tests if we can't create the D3D9 object.

parent 855ce5bd
......@@ -58,8 +58,11 @@ static void test_qi_base_to_ex(void)
HWND window = create_window();
D3DPRESENT_PARAMETERS present_parameters;
ok( d3d9 != NULL, "Failed to create D3D9 object\n" );
if (!d3d9) return;
if (!d3d9)
{
skip("Direct3D9 is not available\n");
return;
}
hr = IDirect3D9_QueryInterface(d3d9, &IID_IDirect3D9Ex, (void **) &d3d9ex);
ok(hr == E_NOINTERFACE,
......
......@@ -2153,6 +2153,14 @@ START_TEST(device)
ok(pDirect3DCreate9 != NULL, "Failed to get address of Direct3DCreate9\n");
if (pDirect3DCreate9)
{
IDirect3D9 *d3d9 = pDirect3DCreate9( D3D_SDK_VERSION );
if(!d3d9)
{
skip("could not create D3D9 object\n");
return;
}
IDirect3D9_Release(d3d9);
test_display_formats();
test_display_modes();
test_swapchain();
......
......@@ -46,8 +46,11 @@ static IDirect3DDevice9 *init_d3d9(void)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = TRUE;
......
......@@ -50,8 +50,11 @@ static HRESULT init_d3d9(
if (!d3d9_create) return E_FAIL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return E_FAIL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return E_FAIL;
}
window = create_window();
......
......@@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = TRUE;
......
......@@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = TRUE;
......
......@@ -51,8 +51,11 @@ static IDirect3DDevice9 *init_d3d9(void)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = TRUE;
......
......@@ -161,8 +161,11 @@ static IDirect3DDevice9 *init_d3d9(void)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = FALSE;
......
......@@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle)
if (!d3d9_create) return NULL;
d3d9_ptr = d3d9_create(D3D_SDK_VERSION);
ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n");
if (!d3d9_ptr) return NULL;
if (!d3d9_ptr)
{
skip("could not create D3D9\n");
return NULL;
}
ZeroMemory(&present_parameters, sizeof(present_parameters));
present_parameters.Windowed = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment