Commit 77c05ebc authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

d3d9/tests: Use todo_wine_if() in tests.

parent 3e532140
...@@ -2869,12 +2869,9 @@ static void test_window_style(void) ...@@ -2869,12 +2869,9 @@ static void test_window_style(void)
ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr);
style = GetWindowLongA(device_window, GWL_STYLE); style = GetWindowLongA(device_window, GWL_STYLE);
if (tests[i].style_flags & WS_VISIBLE) todo_wine_if (!(tests[i].style_flags & WS_VISIBLE))
ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n", ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n",
device_style, style, i); device_style, style, i);
else
todo_wine ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n",
device_style, style, i);
style = GetWindowLongA(device_window, GWL_EXSTYLE); style = GetWindowLongA(device_window, GWL_EXSTYLE);
todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n", todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n",
device_exstyle, style, i); device_exstyle, style, i);
...@@ -2890,12 +2887,9 @@ static void test_window_style(void) ...@@ -2890,12 +2887,9 @@ static void test_window_style(void)
ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref);
style = GetWindowLongA(device_window, GWL_STYLE); style = GetWindowLongA(device_window, GWL_STYLE);
if (device_style & WS_VISIBLE) todo_wine_if (!(device_style & WS_VISIBLE))
ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n", ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n",
device_style, style, i); device_style, style, i);
else
todo_wine ok(style == device_style, "Expected device window style %#x, got %#x, i=%u.\n",
device_style, style, i);
style = GetWindowLongA(device_window, GWL_EXSTYLE); style = GetWindowLongA(device_window, GWL_EXSTYLE);
todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n", todo_wine ok(style == device_exstyle, "Expected device window extended style %#x, got %#x, i=%u.\n",
device_exstyle, style, i); device_exstyle, style, i);
......
...@@ -668,11 +668,7 @@ static void test_fvf_decl_conversion(void) ...@@ -668,11 +668,7 @@ static void test_fvf_decl_conversion(void)
hr = IDirect3DDevice9_GetFVF(device, &fvf); hr = IDirect3DDevice9_GetFVF(device, &fvf);
ok(SUCCEEDED(hr), "Test %u: Failed to get FVF, hr %#x.\n", i, hr); ok(SUCCEEDED(hr), "Test %u: Failed to get FVF, hr %#x.\n", i, hr);
if (decl_to_fvf_tests[i].todo) todo_wine_if (decl_to_fvf_tests[i].todo)
todo_wine ok(fvf == decl_to_fvf_tests[i].fvf,
"Test %u: Got unexpected FVF %#x, expected %#x.\n",
i, fvf, decl_to_fvf_tests[i].fvf);
else
ok(fvf == decl_to_fvf_tests[i].fvf, ok(fvf == decl_to_fvf_tests[i].fvf,
"Test %u: Got unexpected FVF %#x, expected %#x.\n", "Test %u: Got unexpected FVF %#x, expected %#x.\n",
i, fvf, decl_to_fvf_tests[i].fvf); i, fvf, decl_to_fvf_tests[i].fvf);
...@@ -3681,10 +3677,8 @@ static void test_wndproc(void) ...@@ -3681,10 +3677,8 @@ static void test_wndproc(void)
* But sometimes focus-follows-mouse WMs also temporarily drop window focus, which makes * But sometimes focus-follows-mouse WMs also temporarily drop window focus, which makes
* mark the device lost, then not reset, causing the test to succeed for the wrong reason. */ * mark the device lost, then not reset, causing the test to succeed for the wrong reason. */
hr = IDirect3DDevice9_TestCooperativeLevel(device); hr = IDirect3DDevice9_TestCooperativeLevel(device);
if (hr == D3DERR_DEVICENOTRESET) todo_wine_if (hr != D3DERR_DEVICENOTRESET)
ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr);
else
todo_wine ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr);
expect_messages = tests[i].focus_loss_messages; expect_messages = tests[i].focus_loss_messages;
/* SetForegroundWindow is a poor replacement for the user pressing alt-tab or /* SetForegroundWindow is a poor replacement for the user pressing alt-tab or
...@@ -4483,18 +4477,12 @@ static void test_window_style(void) ...@@ -4483,18 +4477,12 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); style = GetWindowLongA(device_window, GWL_STYLE);
expected_style = device_style | tests[i].style; expected_style = device_style | tests[i].style;
if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES)
todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n",
expected_style, style, i);
else
ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n",
expected_style, style, i); expected_style, style, i);
style = GetWindowLongA(device_window, GWL_EXSTYLE); style = GetWindowLongA(device_window, GWL_EXSTYLE);
expected_style = device_exstyle | tests[i].exstyle; expected_style = device_exstyle | tests[i].exstyle;
if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES)
todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n",
expected_style, style, i);
else
ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n",
expected_style, style, i); expected_style, style, i);
...@@ -8873,9 +8861,7 @@ static void test_update_volumetexture(void) ...@@ -8873,9 +8861,7 @@ static void test_update_volumetexture(void)
ok(SUCCEEDED(hr), "Failed to create volume texture, hr %#x, case %u.\n", hr, i); ok(SUCCEEDED(hr), "Failed to create volume texture, hr %#x, case %u.\n", hr, i);
hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)src, (IDirect3DBaseTexture9 *)dst); hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)src, (IDirect3DBaseTexture9 *)dst);
if (FAILED(hr)) todo_wine_if (FAILED(hr))
todo_wine ok(SUCCEEDED(hr), "Failed to update texture, hr %#x, case %u.\n", hr, i);
else
ok(SUCCEEDED(hr), "Failed to update texture, hr %#x, case %u.\n", hr, i); ok(SUCCEEDED(hr), "Failed to update texture, hr %#x, case %u.\n", hr, i);
IDirect3DVolumeTexture9_Release(src); IDirect3DVolumeTexture9_Release(src);
......
...@@ -1450,15 +1450,11 @@ static void color_fill_test(void) ...@@ -1450,15 +1450,11 @@ static void color_fill_test(void)
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, fmt=%s.\n", hr, formats[i].name); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, fmt=%s.\n", hr, formats[i].name);
hr = IDirect3DDevice9_ColorFill(device, surface, NULL, 0xdeadbeef); hr = IDirect3DDevice9_ColorFill(device, surface, NULL, 0xdeadbeef);
if (formats[i].flags & TODO_FILL_RETURN) todo_wine_if (formats[i].flags & TODO_FILL_RETURN)
todo_wine ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
else
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name); ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
hr = IDirect3DDevice9_ColorFill(device, surface, &rect, 0xdeadbeef); hr = IDirect3DDevice9_ColorFill(device, surface, &rect, 0xdeadbeef);
if (formats[i].flags & TODO_FILL_RETURN) todo_wine_if (formats[i].flags & TODO_FILL_RETURN)
todo_wine ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
else
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name); ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -8472,14 +8468,7 @@ static void test_shademode(void) ...@@ -8472,14 +8468,7 @@ static void test_shademode(void)
* functionality being available. */ * functionality being available. */
/* PHONG should be the same as GOURAUD, since no hardware implements /* PHONG should be the same as GOURAUD, since no hardware implements
* this. */ * this. */
if (tests[i].todo) todo_wine_if (tests[i].todo)
{
todo_wine ok(color_match(color0, tests[i].color0, 1), "Test %u shading has color0 %08x, expected %08x.\n",
i, color0, tests[i].color0);
todo_wine ok(color_match(color1, tests[i].color1, 1), "Test %u shading has color1 %08x, expected %08x.\n",
i, color1, tests[i].color1);
}
else
{ {
ok(color_match(color0, tests[i].color0, 1), "Test %u shading has color0 %08x, expected %08x.\n", ok(color_match(color0, tests[i].color0, 1), "Test %u shading has color0 %08x, expected %08x.\n",
i, color0, tests[i].color0); i, color0, tests[i].color0);
...@@ -18123,10 +18112,7 @@ static void test_fog_interpolation(void) ...@@ -18123,10 +18112,7 @@ static void test_fog_interpolation(void)
color = getPixelColor(device, 0, 240); color = getPixelColor(device, 0, 240);
ok(color_match(color, 0x000000ff, 2), "Got unexpected color 0x%08x, case %u.\n", color, i); ok(color_match(color, 0x000000ff, 2), "Got unexpected color 0x%08x, case %u.\n", color, i);
color = getPixelColor(device, 320, 240); color = getPixelColor(device, 320, 240);
if (tests[i].todo) todo_wine_if (tests[i].todo)
todo_wine ok(color_match(color, tests[i].middle_color, 2),
"Got unexpected color 0x%08x, case %u.\n", color, i);
else
ok(color_match(color, tests[i].middle_color, 2), ok(color_match(color, tests[i].middle_color, 2),
"Got unexpected color 0x%08x, case %u.\n", color, i); "Got unexpected color 0x%08x, case %u.\n", color, i);
color = getPixelColor(device, 639, 240); color = getPixelColor(device, 639, 240);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment