Module: wine Branch: master Commit: 1368a4c20b0789108da5473aa8fd33b6757170e2 URL: https://gitlab.winehq.org/wine/wine/-/commit/1368a4c20b0789108da5473aa8fd33b...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Dec 21 12:25:59 2022 +0100
d3d9/tests: Mark a render target color test as todo.
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 53f38632d5c..8857c483302 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);