Module: wine Branch: master Commit: db521d5cd109880d7cddb242e5b03204f4088f46 URL: http://source.winehq.org/git/wine.git/?a=commit;h=db521d5cd109880d7cddb242e5...
Author: Rico Schüller kgbricola@web.de Date: Fri Nov 15 09:46:12 2013 +0100
d3d10/tests: Create a new device for each device test.
---
dlls/d3d10/tests/device.c | 31 +++++++++++++++---------------- 1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index d5393a9..0d5e0b3 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); }