Module: wine Branch: master Commit: f166b298ec8ff47c0bf6d72372177e219927b4af URL: https://gitlab.winehq.org/wine/wine/-/commit/f166b298ec8ff47c0bf6d72372177e2...
Author: Robin Kertels robin.kertels@gmail.com Date: Thu Mar 7 16:55:13 2024 +0100
d3d9/tests: Skip desktop window tests if device creation fails.
Signed-off-by: Robin Kertels robin.kertels@gmail.com
---
dlls/d3d9/tests/visual.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 8f7fa4be12b..d05649ab92e 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26438,16 +26438,23 @@ static void test_desktop_window(void) device = create_device(d3d, GetDesktopWindow(), GetDesktopWindow(), TRUE); ok(!!device, "Failed to create a D3D device.\n");
- hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); - ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); - color = getPixelColor(device, 1, 1); - ok(color == 0x00ff0000, "Got unexpected color 0x%08x.\n", color); + if (device) + { + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#lx.\n", hr); + color = getPixelColor(device, 1, 1); + ok(color == 0x00ff0000, "Got unexpected color 0x%08x.\n", color);
- hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Failed to present, hr %#lx.\n", hr); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#lx.\n", hr);
- refcount = IDirect3DDevice9_Release(device); - ok(!refcount, "Device has %lu references left.\n", refcount); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %lu references left.\n", refcount); + } + else + { + skip("Failed to create a D3D device for the desktop window, skipping tests.\n"); + }
/* test device with NULL HWND */ device = create_device(d3d, NULL, NULL, TRUE);