[PATCH] ddraw/tests: Don't expect emulation to always fail on 64-bit

Alex Henrie alexhenrie24 at gmail.com
Mon Oct 7 23:06:51 CDT 2019


As far as I can tell, all 32-bit drivers and some 64-bit drivers support
emulation. This patch fixes test failures both on several Windows VMs
and on my Linux laptop with Intel graphics.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/ddraw/tests/ddraw1.c | 6 +++++-
 dlls/ddraw/tests/ddraw2.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index a23e76e1f7..6bbea6f2f8 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -12998,7 +12998,7 @@ static void test_caps(void)
     }
 
     hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw, NULL);
-    ok(hr == (is_ddraw64 ? E_FAIL : DD_OK), "Got unexpected hr %#x.\n", hr);
+    ok(hr == DD_OK || (hr == E_FAIL && is_ddraw64), "Got unexpected hr %#x.\n", hr);
     if (SUCCEEDED(hr))
     {
         memset(&hal_caps, 0, sizeof(hal_caps));
@@ -13022,6 +13022,10 @@ static void test_caps(void)
 
         IDirectDraw_Release(ddraw);
     }
+    else
+    {
+        skip("Driver does not support emulation\n");
+    }
 }
 
 static void test_d32_support(void)
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 2156bd5849..113d5e6b05 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -13878,7 +13878,7 @@ static void test_caps(void)
     }
 
     hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL);
-    ok(hr == (is_ddraw64 ? E_FAIL : DD_OK), "Got unexpected hr %#x.\n", hr);
+    ok(hr == DD_OK || (hr == E_FAIL && is_ddraw64), "Got unexpected hr %#x.\n", hr);
     if (SUCCEEDED(hr))
     {
         hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw);
@@ -13906,6 +13906,10 @@ static void test_caps(void)
 
         IDirectDraw2_Release(ddraw);
     }
+    else
+    {
+        skip("Driver does not support emulation\n");
+    }
 }
 
 static void test_d32_support(void)
-- 
2.23.0




More information about the wine-devel mailing list