sync ntdll rtlstr winetest with wine 1.1.24

svn path=/trunk/; revision=41582
This commit is contained in:
Christoph von Wittich 2009-06-23 12:02:58 +00:00
parent aa2eef5de1
commit 0e7c48671b

View file

@ -89,7 +89,7 @@ static WCHAR* AtoW( const char* p )
{ {
WCHAR* buffer; WCHAR* buffer;
DWORD len = MultiByteToWideChar( CP_ACP, 0, p, -1, NULL, 0 ); DWORD len = MultiByteToWideChar( CP_ACP, 0, p, -1, NULL, 0 );
buffer = malloc( len * sizeof(WCHAR) ); buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, p, -1, buffer, len ); MultiByteToWideChar( CP_ACP, 0, p, -1, buffer, len );
return buffer; return buffer;
} }
@ -191,7 +191,7 @@ static void test_RtlInitUnicodeStringEx(void)
UNICODE_STRING uni; UNICODE_STRING uni;
NTSTATUS result; NTSTATUS result;
teststring2 = malloc((TESTSTRING2_LEN + 1) * sizeof(WCHAR)); teststring2 = HeapAlloc(GetProcessHeap(), 0, (TESTSTRING2_LEN + 1) * sizeof(WCHAR));
memset(teststring2, 'X', TESTSTRING2_LEN * sizeof(WCHAR)); memset(teststring2, 'X', TESTSTRING2_LEN * sizeof(WCHAR));
teststring2[TESTSTRING2_LEN] = '\0'; teststring2[TESTSTRING2_LEN] = '\0';
@ -293,7 +293,7 @@ static void test_RtlInitUnicodeStringEx(void)
"pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n", "pRtlInitUnicodeString(&uni, 0) sets Buffer to %p, expected %p\n",
uni.Buffer, NULL); uni.Buffer, NULL);
free(teststring2); HeapFree(GetProcessHeap(), 0, teststring2);
} }
@ -1357,14 +1357,15 @@ static void test_RtlUnicodeStringToInteger(void)
test_num, str2int[test_num].str, str2int[test_num].base, result, test_num, str2int[test_num].str, str2int[test_num].base, result,
str2int[test_num].result, str2int[test_num].alternative); str2int[test_num].result, str2int[test_num].alternative);
if (result == STATUS_SUCCESS) if (result == STATUS_SUCCESS)
ok(value == str2int[test_num].value, ok(value == str2int[test_num].value ||
broken(str2int[test_num].str[0] == '\0' && str2int[test_num].base == 16), /* nt4 */
"(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n", "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected: %d\n",
test_num, str2int[test_num].str, str2int[test_num].base, value, str2int[test_num].value); test_num, str2int[test_num].str, str2int[test_num].base, value, str2int[test_num].value);
else else
ok(value == 0xdeadbeef || value == 0 /* vista */, ok(value == 0xdeadbeef || value == 0 /* vista */,
"(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected 0 or deadbeef\n", "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) assigns value %d, expected 0 or deadbeef\n",
test_num, str2int[test_num].str, str2int[test_num].base, value); test_num, str2int[test_num].str, str2int[test_num].base, value);
free(wstr); HeapFree(GetProcessHeap(), 0, wstr);
} }
wstr = AtoW(str2int[1].str); wstr = AtoW(str2int[1].str);
@ -1404,7 +1405,7 @@ static void test_RtlUnicodeStringToInteger(void)
"didn't return expected value (test c): expected: %d, got: %d\n", "didn't return expected value (test c): expected: %d, got: %d\n",
1, value); 1, value);
/* w2k: uni.Length = 0 returns value 11234567 instead of 0 */ /* w2k: uni.Length = 0 returns value 11234567 instead of 0 */
free(wstr); HeapFree(GetProcessHeap(), 0, wstr);
} }