[PATCH 1/4] ddraw/tests: Skip a crashy test on WARP.

Stefan Dösinger stefan at codeweavers.com
Sun Feb 6 11:07:46 CST 2022


ddraw1 doesn't draw, so presumably not affected. Can't find any crashes in the testbot history
http://test.winehq.org/data/4364ff8d5c0387edd6fae142affe8e844b291518/win81_newtb-w8adm/ddraw:ddraw2.html
http://test.winehq.org/data/d03984709d87d6eaa0e2e7746f0db5d8fdf81b5a/win1507_newtb-w1064v1507-32/ddraw:ddraw4.html
I haven't found any examples of ddraw7 crashing in this test. Doesn't mean there aren't any. Let's wait and see.

Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
 dlls/ddraw/tests/ddraw2.c | 20 ++++++++++++++------
 dlls/ddraw/tests/ddraw4.c |  9 +++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 625776c652c..1285fa1b682 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -1076,6 +1076,17 @@ static void test_coop_level_d3d_state(void)
     window = create_window();
     ddraw = create_ddraw();
     ok(!!ddraw, "Failed to create a ddraw object.\n");
+
+    if (ddraw_is_warp(ddraw))
+    {
+        /* ddraw2 crashes in EndScene, and if it doesn't crash it fails with
+         * DDERR_SURFACELOST on WARP. */
+        win_skip("Skipping test that crashes WARP occasionally.\n");
+        IDirectDraw2_Release(ddraw);
+        DestroyWindow(window);
+        return;
+    }
+
     if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
     {
         skip("Failed to create a 3D device, skipping test.\n");
@@ -1159,12 +1170,9 @@ static void test_coop_level_d3d_state(void)
     hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0);
     ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
     hr = IDirect3DDevice2_EndScene(device);
-    ok(hr == DD_OK || broken(ddraw_is_warp(ddraw) && hr == DDERR_SURFACELOST), "Got unexpected hr %#x.\n", hr);
-    if (hr == DD_OK)
-    {
-        color = get_surface_color(rt, 320, 240);
-        ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
-    }
+    ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+    color = get_surface_color(rt, 320, 240);
+    ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
 
     destroy_viewport(device, viewport);
     destroy_material(background);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 9b8acb674e3..6ed12d980db 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -1301,6 +1301,14 @@ static void test_coop_level_d3d_state(void)
     hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw);
     ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
     IDirect3D3_Release(d3d);
+
+    if (ddraw_is_warp(ddraw))
+    {
+        /* ddraw4 occasionally crashes in GetRenderTarget. */
+        win_skip("Skipping test that crashes WARP occasionally.\n");
+        goto done;
+    }
+
     hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
     ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
     hr = IDirectDrawSurface4_IsLost(rt);
@@ -1349,6 +1357,7 @@ static void test_coop_level_d3d_state(void)
             || broken(ddraw_is_warp(ddraw) && compare_color(color, 0x0000ff00, 0)),
             "Got unexpected color 0x%08x.\n", color);
 
+done:
     destroy_viewport(device, viewport);
     IDirectDrawSurface4_Release(surface);
     IDirectDrawSurface4_Release(rt);
-- 
2.34.1




More information about the wine-devel mailing list