Alexandre Julliard : ntdll/tests: Fix a test that fails on Win2k.

Alexandre Julliard julliard at winehq.org
Thu Jan 9 12:52:50 CST 2014


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan  9 16:01:59 2014 +0100

ntdll/tests: Fix a test that fails on Win2k.

---

 dlls/ntdll/tests/string.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c
index 7b56691..56b7584 100644
--- a/dlls/ntdll/tests/string.c
+++ b/dlls/ntdll/tests/string.c
@@ -1281,12 +1281,15 @@ static void test__snprintf(void)
     int res;
 
     res = p__snprintf(NULL, 0, teststring);
-    ok(res == lstrlenA(teststring), "_snprintf returned %d, expected %d.\n", res, lstrlenA(teststring));
-
-    res = p__snprintf(NULL, 1, teststring);
-    ok(res == lstrlenA(teststring) /* WinXP */ || res < 0 /* Vista and greater */,
-            "_snprintf returned %d, expected %d or < 0.\n", res, lstrlenA(teststring));
+    ok(res == lstrlenA(teststring) || broken(res == -1) /* <= w2k */,
+       "_snprintf returned %d, expected %d.\n", res, lstrlenA(teststring));
 
+    if (res != -1)
+    {
+        res = p__snprintf(NULL, 1, teststring);
+        ok(res == lstrlenA(teststring) /* WinXP */ || res < 0 /* Vista and greater */,
+           "_snprintf returned %d, expected %d or < 0.\n", res, lstrlenA(teststring));
+    }
     res = p__snprintf(buffer, strlen(teststring) - 1, teststring);
     ok(res < 0, "_snprintf returned %d, expected < 0.\n", res);
 




More information about the wine-cvs mailing list