From ce63546e028176358566865f5332bee74dadf604 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B3zef=20Kucia?= Date: Tue, 13 Oct 2015 09:44:33 +0200 Subject: [PATCH] dxgi/tests: Add test for IDXGIAdapter::CheckInterfaceSupport(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/tests/device.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 008da26d5a9..ea4e7b34a69 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -170,6 +170,60 @@ done: ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_check_interface_support(void) +{ + LARGE_INTEGER driver_version; + IDXGIAdapter *adapter; + IDXGIDevice *device; + IUnknown *iface; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + hr = IDXGIDevice_GetAdapter(device, &adapter); + ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr); + + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device, &driver_version); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + trace("UMD version: %u.%u.%u.%u.\n", + HIWORD(U(driver_version).HighPart), LOWORD(U(driver_version).HighPart), + HIWORD(U(driver_version).LowPart), LOWORD(U(driver_version).LowPart)); + + hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface); + if (SUCCEEDED(hr)) + { + IUnknown_Release(iface); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device1, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device1, &driver_version); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + } + else + { + win_skip("D3D10.1 is not supported.\n"); + } + + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, NULL); + ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); + driver_version.HighPart = driver_version.LowPart = 0xdeadbeef; + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, &driver_version); + ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); + ok(driver_version.HighPart == 0xdeadbeef, "Got unexpected driver version %#x.\n", driver_version.HighPart); + ok(driver_version.LowPart == 0xdeadbeef, "Got unexpected driver version %#x.\n", driver_version.LowPart); + + IDXGIAdapter_Release(adapter); + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_surface(void) { DXGI_SURFACE_DESC desc; @@ -1215,6 +1269,7 @@ START_TEST(device) ok(EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, ®istry_mode), "Failed to get display mode.\n"); test_adapter_desc(); + test_check_interface_support(); test_device_interfaces(); test_create_surface(); test_parents(); -- 2.11.4.GIT