[PATCH v2] ddraw/tests: Fix some test failures.

Zebediah Figura z.figura12 at gmail.com
Sun Jan 5 17:08:23 CST 2020


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48150
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/ddraw/tests/ddraw2.c | 9 ++++++---
 dlls/ddraw/tests/ddraw4.c | 6 ++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 541362c748..a2a27d86f0 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -1010,9 +1010,12 @@ 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, "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);
+    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);
+    }
 
     destroy_viewport(device, viewport);
     destroy_material(background);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 8cadfae52a..77cf6f4511 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -1171,7 +1171,6 @@ static void test_coop_level_d3d_state(void)
     ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
     hr = IDirectDraw4_RestoreAllSurfaces(ddraw);
     ok(SUCCEEDED(hr), "Failed to restore surfaces, hr %#x.\n", hr);
-    IDirectDraw4_Release(ddraw);
 
     hr = IDirect3DDevice3_GetRenderTarget(device, &surface);
     ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
@@ -1197,12 +1196,15 @@ static void test_coop_level_d3d_state(void)
     hr = IDirect3DDevice3_EndScene(device);
     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);
+    ok(compare_color(color, 0x0000ff80, 1)
+            || broken(ddraw_is_warp(ddraw) && compare_color(color, 0x0000ff00, 0)),
+            "Got unexpected color 0x%08x.\n", color);
 
     destroy_viewport(device, viewport);
     IDirectDrawSurface4_Release(surface);
     IDirectDrawSurface4_Release(rt);
     IDirect3DDevice3_Release(device);
+    IDirectDraw4_Release(ddraw);
     DestroyWindow(window);
 }
 
-- 
2.24.1




More information about the wine-devel mailing list