Paul Vriens : ddraw/tests: Don't crash on older ddraw.

Alexandre Julliard julliard at winehq.org
Mon Oct 12 11:19:41 CDT 2009


Module: wine
Branch: master
Commit: 72fab20ffe0d7f713a78c4cbee8d6ef87ca16c93
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=72fab20ffe0d7f713a78c4cbee8d6ef87ca16c93

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Sat Oct 10 10:06:32 2009 +0200

ddraw/tests: Don't crash on older ddraw.

---

 dlls/ddraw/tests/ddrawmodes.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c
index 7ea4d53..bd8bec7 100644
--- a/dlls/ddraw/tests/ddrawmodes.c
+++ b/dlls/ddraw/tests/ddrawmodes.c
@@ -149,9 +149,14 @@ static void test_DirectDrawEnumerateA(void)
     ret = pDirectDrawEnumerateA((LPDDENUMCALLBACKA)0xdeadbeef, NULL);
     ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
 
-    /* Test with callback that crashes. */
-    ret = pDirectDrawEnumerateA(crash_callbackA, NULL);
-    ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    if (pDirectDrawEnumerateExA)
+    {
+        /* Test with callback that crashes. */
+        ret = pDirectDrawEnumerateA(crash_callbackA, NULL);
+        ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    }
+    else
+        win_skip("Test would crash on older ddraw\n");
 
     /* Test with valid callback parameter and NULL context parameter. */
     trace("Calling DirectDrawEnumerateA with test_nullcontext_callbackA callback and NULL context.\n");
@@ -185,7 +190,9 @@ static void test_DirectDrawEnumerateW(void)
 
     /* Test with NULL callback parameter. */
     ret = pDirectDrawEnumerateW(NULL, NULL);
-    ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    ok(ret == DDERR_INVALIDPARAMS ||
+       ret == DDERR_UNSUPPORTED, /* Older ddraw */
+       "Expected DDERR_INVALIDPARAMS or DDERR_UNSUPPORTED, got %d\n", ret);
 
     /* Test with invalid callback parameter. */
     ret = pDirectDrawEnumerateW((LPDDENUMCALLBACKW)0xdeadbeef, NULL);




More information about the wine-cvs mailing list