d3d9/tests: Use a separate device for zenable_test().

This commit is contained in:
Henri Verbeet 2014-03-14 10:25:04 +01:00 committed by Alexandre Julliard
parent 55e669265d
commit af63977750
1 changed files with 22 additions and 2 deletions

View File

@ -14333,7 +14333,7 @@ static void resz_test(void)
IDirect3D9_Release(d3d);
}
static void zenable_test(IDirect3DDevice9 *device)
static void zenable_test(void)
{
static const struct
{
@ -14347,12 +14347,26 @@ static void zenable_test(IDirect3DDevice9 *device)
{{640.0f, 480.0f, 1.5f, 1.0f}, 0xff00ff00},
{{640.0f, 0.0f, 1.5f, 1.0f}, 0xff00ff00},
};
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
D3DCOLOR color;
ULONG refcount;
D3DCAPS9 caps;
HWND window;
HRESULT hr;
UINT x, y;
UINT i, j;
window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, window, TRUE)))
{
skip("Failed to create a D3D device, skipping tests.\n");
goto done;
}
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE);
ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr);
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
@ -14462,6 +14476,12 @@ static void zenable_test(IDirect3DDevice9 *device)
IDirect3DPixelShader9_Release(ps);
IDirect3DVertexShader9_Release(vs);
}
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
done:
IDirect3D9_Release(d3d);
DestroyWindow(window);
}
static void fog_special_test(void)
@ -15543,11 +15563,11 @@ START_TEST(visual)
srgbwrite_format_test(device_ptr);
update_surface_test(device_ptr);
multisample_get_rtdata_test(device_ptr);
zenable_test(device_ptr);
cleanup_device(device_ptr);
device_ptr = NULL;
zenable_test();
fog_special_test();
volume_srgb_test();
volume_dxt5_test();