From 2be432b4df37de6890c66557d36178902f2dd48b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 11 Feb 2014 11:42:22 +0100 Subject: [PATCH] dxgi/tests: Also test for ID3D10Device1 and ID3D11Device in test_device_interfaces(). --- dlls/d3d10/tests/device.c | 49 ----------------------------------- dlls/d3d10core/tests/device.c | 34 ------------------------ dlls/dxgi/tests/device.c | 38 +++++++++++++++++---------- 3 files changed, 24 insertions(+), 97 deletions(-) diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index 8df4150c10b..fa8f708b13c 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -21,54 +21,6 @@ #include "d3d10.h" #include "wine/test.h" -static ID3D10Device *create_device(void) -{ - ID3D10Device *device; - - if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device))) - return device; - if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device))) - return device; - if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device))) - return device; - - return NULL; -} - -static void test_device_interfaces(void) -{ - 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); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown (%#x)\n", hr); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device (%#x)\n", hr); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr); - - 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) { static const struct @@ -229,6 +181,5 @@ static void test_stateblock_mask(void) START_TEST(device) { - test_device_interfaces(); test_stateblock_mask(); } diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 8278afc1970..213987b40aa 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -35,39 +35,6 @@ static ID3D10Device *create_device(void) return NULL; } -static void test_device_interfaces(void) -{ - ID3D10Device *device; - ULONG refcount; - IUnknown *obj; - HRESULT hr; - - if (!(device = create_device())) - { - skip("Failed to create device, skipping tests.\n"); - return; - } - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown\n"); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject\n"); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice\n"); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device\n"); - - refcount = ID3D10Device_Release(device); - ok(!refcount, "Device has %u references left\n", refcount); -} - static void test_create_texture2d(void) { D3D10_TEXTURE2D_DESC desc; @@ -761,7 +728,6 @@ static void test_create_predicate(void) START_TEST(device) { - test_device_interfaces(); test_create_texture2d(); test_create_texture3d(); test_create_depthstencil_view(); diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index b4337fafdd2..5572a5475c6 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -18,7 +18,7 @@ #define COBJMACROS #include "initguid.h" -#include "d3d10.h" +#include "d3d11.h" #include "wine/test.h" static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory); @@ -49,8 +49,8 @@ success: static void test_device_interfaces(void) { IDXGIDevice *device; + IUnknown *iface; ULONG refcount; - IUnknown *obj; HRESULT hr; if (!(device = create_device())) @@ -59,21 +59,31 @@ static void test_device_interfaces(void) return; } - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "IDXGIDevice does not implement IUnknown\n"); + hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&iface); + ok(SUCCEEDED(hr), "Failed to query IUnknown interface, hr %#x.\n", hr); + IUnknown_Release(iface); - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIObject\n"); + hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&iface); + ok(SUCCEEDED(hr), "Failed to query IDXGIObject interface, hr %#x.\n", hr); + IUnknown_Release(iface); - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIDevice\n"); + hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&iface); + ok(SUCCEEDED(hr), "Failed to query IDXGIDevice interface, hr %#x.\n", hr); + IUnknown_Release(iface); - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "IDXGIDevice does not implement ID3D10Device\n"); + hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&iface); + ok(SUCCEEDED(hr), "Failed to query ID3D10Device interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface))) + IUnknown_Release(iface); + todo_wine ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Failed to query ID3D10Device1 interface, hr %#x.\n", hr); + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D11Device, (void **)&iface))) + IUnknown_Release(iface); + todo_wine ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Failed to query ID3D11Device interface, hr %#x.\n", hr); refcount = IDXGIDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);