[PATCH 2/2] dxgi/tests: Add test for creating swapchains for windows with empty client rect.

Józef Kucia jkucia at codeweavers.com
Thu May 17 08:46:55 CDT 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/dxgi/tests/device.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c
index 3ad968308e8b..b18ee5904fb5 100644
--- a/dlls/dxgi/tests/device.c
+++ b/dlls/dxgi/tests/device.c
@@ -1385,6 +1385,29 @@ static void test_create_swapchain(void)
     expected_width = expected_client_rect->right;
     expected_height = expected_client_rect->bottom;
 
+    creation_desc.BufferDesc.Width = 0;
+    creation_desc.BufferDesc.Height = 0;
+    hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain);
+    ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
+    hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
+    ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
+    ok(result_desc.BufferDesc.Width == expected_width, "Got width %u, expected %u.\n",
+            result_desc.BufferDesc.Width, expected_width);
+    ok(result_desc.BufferDesc.Height == expected_height, "Got height %u, expected %u.\n",
+            result_desc.BufferDesc.Height, expected_height);
+    check_swapchain_fullscreen_state(swapchain, &expected_state);
+    IDXGISwapChain_Release(swapchain);
+
+    DestroyWindow(creation_desc.OutputWindow);
+    creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test",
+            WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+            1, 1, 0, 0, 0, 0, 0, 0);
+    SetRect(&expected_state.fullscreen_state.window_rect, 1, 1, 1, 1);
+    SetRectEmpty(expected_client_rect);
+    expected_width = expected_height = 8;
+
+    creation_desc.BufferDesc.Width = 0;
+    creation_desc.BufferDesc.Height = 0;
     hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain);
     ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
     hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
-- 
2.16.1




More information about the wine-devel mailing list