msvcrt: tests: some values of _mbctype are dependent on the version of Windows

Mikolaj Zalewski mikolajz at google.com
Mon Aug 27 19:59:47 CDT 2007


-------------- next part --------------
From 5fd3279f6fc4882c52dc49a8709b124ec8333f8f Mon Sep 17 00:00:00 2001
From: Mikolaj Zalewski <mikolaj at zalewski.pl>
Date: Mon, 27 Aug 2007 17:57:28 -0700
Subject: [PATCH] msvcrt: tests: the values of _mbctype are dependent on the version of Windows
---
 dlls/msvcrt/tests/string.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 6dabc61..820006c 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -126,7 +126,7 @@ #define test_codepage_todo(cp, todo) tes
 
 #else
 
-/* RLE-encoded mbctype tables for given codepages */
+/* RLE-encoded mbctype tables for given codepages on XP/Vista */
 static int result_cp_1252_mbctype[] = { 0x0,66, 0x10,26, 0x0,6, 0x20,26, 0x0,8, 0x20,1,
   0x0,6, 0x10,1, 0x0,1, 0x10,1, 0x0,1, 0x10,1, 0x0,11, 0x20,1, 0x0,1, 0x20,1, 0x0,1,
   0x20,1, 0x10,1, 0x0,10, 0x20,1, 0x0,10, 0x20,1, 0x0,4, 0x20,1, 0x0,5, 0x10,23, 0x0,1,
@@ -144,10 +144,18 @@ static int result_cp_949_mbctype[] = { 0
 static int result_cp_950_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
   0x0,2, 0x4,32, 0xc,94, 0,1 };
 
+/* these characters may differ on different Windows versions */
+static int fuzzy_cp_1252_mbctype[] = {142, 158, 170, 181, 186, -2};
+static int fuzzy_cp_1250_mbctype[] = {131, 141, 142, 143, 157, 158, 159, 163, 165, 170, 175, 179, 181, 185, 186, 188, 190, 191, -2};
+static int fuzzy_cp_932_mbctype[] = { -2 };
+static int fuzzy_cp_936_mbctype[] = { -2 };
+static int fuzzy_cp_949_mbctype[] = { -2 };
+static int fuzzy_cp_950_mbctype[] = { -2 };
+
 static int todo_none[] = { -2 };
 static int todo_cp_932[] = { 254, -2 };
 
-void test_cp_table(int cp, int *result, int *todo)
+void test_cp_table(int cp, int *result, int *todo, int *fuzzy)
 {
     int i;
     int count = 0;
@@ -166,14 +174,20 @@ void test_cp_table(int cp, int *result, 
             todo_wine ok(_mbctype[i] == curr, "CP%d: Mismatch in ctype for character %d - %d instead of %d\n", cp, i-1, _mbctype[i], curr);
             todo++;
 	}
-	else
+	else if (i == *fuzzy + 1)
+        {
+            if (_mbctype[i] != curr)
+                trace("CP%d: Value of type for character %d (%d) different than in Windows XP/Vista (%d)\n", cp, i-1, _mbctype[i], curr);
+            fuzzy++;
+        }
+        else
             ok(_mbctype[i] == curr, "CP%d: Mismatch in ctype for character %d - %d instead of %d\n", cp, i-1, _mbctype[i], curr);
         count--;
     }
 }
 
-#define test_codepage(num) test_cp_table(num, result_cp_##num##_mbctype, todo_none);
-#define test_codepage_todo(num, todo) test_cp_table(num, result_cp_##num##_mbctype, todo);
+#define test_codepage(num) test_cp_table(num, result_cp_##num##_mbctype, todo_none, fuzzy_cp_##num##_mbctype);
+#define test_codepage_todo(num, todo) test_cp_table(num, result_cp_##num##_mbctype, todo, fuzzy_cp_##num##_mbctype);
 
 #endif
 
-- 
1.4.1


More information about the wine-patches mailing list