From db521d5cd109880d7cddb242e5b03204f4088f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Fri, 15 Nov 2013 09:46:12 +0100 Subject: [PATCH] d3d10/tests: Create a new device for each device test. --- dlls/d3d10/tests/device.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index d5393a9f6fd..0d5e0b34283 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -36,10 +36,19 @@ static ID3D10Device *create_device(void) return NULL; } -static void test_device_interfaces(ID3D10Device *device) +static void test_device_interfaces(void) { - HRESULT hr; + ID3D10Device *device; + ULONG refcount; IUnknown *obj; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests\n"); + return; + } if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&obj))) IUnknown_Release(obj); @@ -56,6 +65,9 @@ static void test_device_interfaces(ID3D10Device *device) if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) IUnknown_Release(obj); ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left\n", refcount); } static void test_stateblock_mask(void) @@ -218,19 +230,6 @@ static void test_stateblock_mask(void) START_TEST(device) { - ID3D10Device *device; - ULONG refcount; - - device = create_device(); - if (!device) - { - skip("Failed to create device, skipping tests\n"); - return; - } - - test_device_interfaces(device); + test_device_interfaces(); test_stateblock_mask(); - - refcount = ID3D10Device_Release(device); - ok(!refcount, "Device has %u references left\n", refcount); }