d3d10/tests: Create a new device for each device test.
This commit is contained in:
parent
3b13f08537
commit
db521d5cd1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue