Paul Vriens : kernel32/tests: Fix some test failures on several platforms.

Alexandre Julliard julliard at winehq.org
Thu Jan 29 09:14:47 CST 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Jan 28 20:51:56 2009 +0100

kernel32/tests: Fix some test failures on several platforms.

---

 dlls/kernel32/tests/profile.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index 59f9c2b..fba8c5d 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -223,10 +223,15 @@ static void test_profile_sections_names(void)
     /* Test with exactly fitting buffer */
     memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 28, testfile3 );
-    ok( ret == 26, "expected return size 26, got %d\n", ret );
+    ok( ret == 26 ||
+        broken(ret == 28), /* Win9x, WinME */
+        "expected return size 26, got %d\n", ret );
     todo_wine
-    ok( buf[ret+1] == 0 && buf[ret] == 0, "returned buffer not terminated with double-null\n" );
-    
+    ok( (buf[ret+1] == 0 && buf[ret] == 0) || /* W2K3 and higher */
+        broken(buf[ret+1] == 0xc && buf[ret] == 0) || /* NT4, W2K, WinXP */
+        broken(buf[ret-1] == 0 && buf[ret-2] == 0), /* Win9x, WinME */
+        "returned buffer not terminated with double-null\n" );
+
     /* Test with a buffer too small */
     memset(buf, 0xc, sizeof(buf));
     ret = GetPrivateProfileSectionNamesA( buf, 27, testfile3 );
@@ -258,8 +263,10 @@ static void test_profile_sections_names(void)
     memset(bufW, 0xcc, sizeof(bufW));
     ret = GetPrivateProfileSectionNamesW( bufW, 28, testfile3W );
     ok( ret == 26, "expected return size 26, got %d\n", ret );
-    ok( bufW[ret+1] == 0 && bufW[ret] == 0, "returned buffer not terminated with double-null\n" );
-    
+    ok( (bufW[ret+1] == 0 && bufW[ret] == 0) || /* W2K3 and higher */
+        broken(bufW[ret+1] == 0xcccc && bufW[ret] == 0), /* NT4, W2K, WinXP */
+        "returned buffer not terminated with double-null\n" );
+
     /* Test with a buffer too small */
     memset(bufW, 0xcc, sizeof(bufW));
     ret = GetPrivateProfileSectionNamesW( bufW, 27, testfile3W );




More information about the wine-cvs mailing list