-- v2: d3d9/tests: Fix some activation/focus test failures.
From: Alexandre Julliard julliard@winehq.org
It fails on the Gitlab CI. --- dlls/d3d9/tests/visual.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index ccfa8ce5e3a..d85be0ee2b2 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26608,6 +26608,7 @@ static void test_mismatched_sample_types(void)
colour = getPixelColor(device, 320, 240);
+ todo_wine_if(!color_match(colour, tests[i].expected_colour, 1)) ok(color_match(colour, tests[i].expected_colour, 1) || broken(tests[i].expected_broken && color_match(colour, tests[i].expected_broken, 1)) || broken(tests[i].expected_broken2 && color_match(colour, tests[i].expected_broken2, 1)),
From: Alexandre Julliard julliard@winehq.org
Split the check_rt_color() function to allow conditional todos. --- dlls/d3d9/tests/visual.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index d85be0ee2b2..fed70a675e1 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -258,9 +258,7 @@ static DWORD getPixelColor(IDirect3DDevice9 *device, UINT x, UINT y) return ret; }
-#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false) -#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true) -static void check_rt_color_(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR expected_color, bool todo) +static D3DCOLOR check_expected_rt_color(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR expected_color) { unsigned int color = 0xdeadbeef; struct surface_readback rb; @@ -284,6 +282,15 @@ static void check_rt_color_(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR e break; } release_surface_readback(&rb); + return color; +} + +#define check_rt_color(a, b) check_rt_color_(__LINE__, a, b, false) +#define check_rt_color_todo(a, b) check_rt_color_(__LINE__, a, b, true) +static void check_rt_color_(unsigned int line, IDirect3DSurface9 *rt, D3DCOLOR expected_color, bool todo) +{ + unsigned int color = check_expected_rt_color(line, rt, expected_color); + todo_wine_if (todo) ok_(__FILE__, line)(color == expected_color, "Got unexpected color 0x%08x.\n", color); } @@ -26913,7 +26920,12 @@ static void test_sample_attached_rendertarget(void) if (is_warp || color == 0x00010101) skip("Sampling attached render targets is not supported.\n"); else - check_rt_color(rt, 0x00c1c1c1); + { + unsigned int expected_color = 0x00c1c1c1; + unsigned int color = check_expected_rt_color(__LINE__, rt, expected_color); + todo_wine_if(color != expected_color) + ok(color == expected_color, "Got unexpected color 0x%08x.\n", color); + }
IDirect3DQuery9_Release(event_query);
From: Alexandre Julliard julliard@winehq.org
By backporting the corresponding window management tweaks from the d3d8:device test. --- dlls/d3d9/tests/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 5c4417a2568..0a95e819018 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -4294,7 +4294,6 @@ static void test_wndproc(void)
SetForegroundWindow(GetDesktopWindow()); ShowWindow(device_window, SW_MINIMIZE); - ShowWindow(device_window, SW_RESTORE); ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_RESTORE); SetForegroundWindow(focus_window); @@ -4339,7 +4338,6 @@ static void test_wndproc(void) } filter_messages = NULL; SetForegroundWindow(focus_window); /* For KDE. */ - flush_events();
expect_messages = focus_loss_messages_filtered; windowposchanged_received = 0; @@ -4416,6 +4414,10 @@ static void test_wndproc(void) ref = IDirect3DDevice9_Release(device); ok(!ref, "Unexpected refcount %lu, i=%u.\n", ref, i);
+ ShowWindow(device_window, SW_RESTORE); + SetForegroundWindow(focus_window); + flush_events(); + filter_messages = focus_window; device_desc.device_window = device_window; if (!(device = create_device(d3d9, focus_window, &device_desc)))
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128016
Your paranoid android.
=== w10pro64 (64 bit report) ===
d3d9: device.c:4146: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0. device.c:4190: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=0. device.c:4194: Test failed: The device window is active, i=0. device.c:4199: Test failed: Got unexpected hr 0x88760869. device.c:4203: Test failed: Got unexpected screen size 800x600. device.c:4229: Test failed: Expected message 0x46 for window 0, but didn't receive it, i=0. device.c:4238: Test failed: Got unexpected screen size 800x600. device.c:4255: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=0. device.c:4263: Test failed: Got unexpected width 640. device.c:4264: Test failed: Got unexpected height 480. device.c:4345: Test failed: Expected message 0x7e for window 0x1, but didn't receive it, i=0. device.c:4352: Test failed: Expected IsIconic 1, got 0, i=0. device.c:4356: Test failed: Got unexpected hr 0. device.c:4364: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0. device.c:4399: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=0. device.c:4409: Test failed: Got unexpected hr 0. device.c:4467: Test failed: Expected message 0x18 for window 0, but didn't receive it, i=0. device.c:4473: Test failed: Got unexpected WINDOWPOS hwnd=0000000000000000, insertAfter=0000000000000000, x=0, y=0, cx=0, cy=0, flags=0 device.c:4490: Test failed: Expected the device window to be visible, i=0. device.c:4146: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=1. device.c:4190: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=1. device.c:4194: Test failed: The device window is active, i=1. device.c:4199: Test failed: Got unexpected hr 0x88760869. device.c:4203: Test failed: Got unexpected screen size 800x600. device.c:4238: Test failed: Got unexpected screen size 800x600. device.c:4255: Test failed: Expected message 0x7e for window 0, but didn't receive it, i=1. device.c:4263: Test failed: Got unexpected width 640. device.c:4264: Test failed: Got unexpected height 480. device.c:4345: Test failed: Expected message 0x7e for window 0x1, but didn't receive it, i=1. device.c:4356: Test failed: Got unexpected hr 0. device.c:4399: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=1. device.c:4409: Test failed: Got unexpected hr 0. device.c:3742: Test failed: Received unexpected message 0x46 for window 0000000000070048. device.c:3742: Test failed: Received unexpected message 0x47 for window 0000000000070048. device.c:3742: Test failed: Received unexpected message 0x86 for window 0000000000070048. device.c:3742: Test failed: Received unexpected message 0x6 for window 0000000000070048. device.c:3742: Test failed: Received unexpected message 0x281 for window 0000000000070048. device.c:3742: Test failed: Received unexpected message 0x7 for window 0000000000070048.
I also don't see how ShowWindow() is supposed to make sure WM_SIZE is processed? Why not flush_events() instead?
There's a flush_events() a few lines later already, but it's not enough to ensure that this WM_SIZE has been received.
It's not clear why we get an extra WM_SIZE at that point. Anyway I've dropped the change for now since it's not part of the d3d8 backport.
This merge request was approved by Zebediah Figura.