From: Józef Kucia Subject: [PATCH 7/7] d3d10core/tests: Add test for device feature level. Message-Id: <1439161885-32146-7-git-send-email-jkucia@codeweavers.com> Date: Mon, 10 Aug 2015 01:11:25 +0200 --- dlls/d3d10core/tests/device.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 55dce67..3b88387 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -19,6 +19,7 @@ #define COBJMACROS #include "initguid.h" #include "d3d10.h" +#include "d3d11.h" #include "wine/test.h" #include @@ -161,6 +162,36 @@ static IDXGISwapChain *create_swapchain(ID3D10Device *device, HWND window, BOOL return swapchain; } +static void test_feature_level(void) +{ + D3D_FEATURE_LEVEL feature_level; + ID3D11Device *device11; + ID3D10Device *device10; + HRESULT hr; + + if (!(device10 = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + hr = ID3D10Device_QueryInterface(device10, &IID_ID3D11Device, (void **)&device11); + todo_wine ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Failed to query ID3D11Device interface, hr %#x.\n", hr); + if (FAILED(hr)) + { + ID3D10Device_Release(device10); + return; + } + + /* Device was created by D3D10CreateDevice. */ + feature_level = ID3D11Device_GetFeatureLevel(device11); + ok(feature_level == D3D_FEATURE_LEVEL_10_0, "Got unexpected feature level %#x.\n", feature_level); + + ID3D11Device_Release(device11); + ID3D10Device_Release(device10); +} + static void test_create_texture2d(void) { ULONG refcount, expected_refcount; @@ -3164,6 +3195,7 @@ static void test_fragment_coords(void) START_TEST(device) { + test_feature_level(); test_create_texture2d(); test_create_texture3d(); test_create_depthstencil_view(); -- 2.4.6