Commit 63d7591b authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll/tests: Fix string test for UTF-8 default codepage.

parent b5561c8b
...@@ -1837,7 +1837,7 @@ static void test_toupper(void) ...@@ -1837,7 +1837,7 @@ static void test_toupper(void)
{ {
int i, ret, exp_ret; int i, ret, exp_ret;
char str[2], *p; char str[3], *p;
WCHAR wc; WCHAR wc;
ok(ptoupper != NULL, "toupper is not available\n"); ok(ptoupper != NULL, "toupper is not available\n");
...@@ -1846,17 +1846,20 @@ static void test_toupper(void) ...@@ -1846,17 +1846,20 @@ static void test_toupper(void)
{ {
str[0] = i; str[0] = i;
str[1] = i >> 8; str[1] = i >> 8;
str[2] = 0;
p = str; p = str;
wc = RtlAnsiCharToUnicodeChar( &p ); wc = RtlAnsiCharToUnicodeChar( &p );
wc = RtlUpcaseUnicodeChar( wc ); wc = RtlUpcaseUnicodeChar( wc );
ret = WideCharToMultiByte( CP_ACP, 0, &wc, 1, str, 2, NULL, NULL ); ret = WideCharToMultiByte( CP_ACP, 0, &wc, 1, str, 2, NULL, NULL );
ok(ret == 1 || ret == 2, "WideCharToMultiByte returned %d\n", ret); ok(!ret || ret == 1 || ret == 2, "WideCharToMultiByte returned %d\n", ret);
if (ret == 2) if (ret == 2)
exp_ret = (unsigned char)str[1] + ((unsigned char)str[0] << 8); exp_ret = (unsigned char)str[1] + ((unsigned char)str[0] << 8);
else else if (ret == 1)
exp_ret = (unsigned char)str[0]; exp_ret = (unsigned char)str[0];
else
exp_ret = (WCHAR)i;
ret = ptoupper(i); ret = (WCHAR)ptoupper(i);
ok(ret == exp_ret, "toupper(%x) = %x, expected %x\n", i, ret, exp_ret); ok(ret == exp_ret, "toupper(%x) = %x, expected %x\n", i, ret, exp_ret);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment