Commit 35c65edc authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernel32/tests: Workaround some broken Windows behavior in console tests.

parent 7bfa058a
...@@ -925,10 +925,16 @@ static void testScreenBuffer(HANDLE hConOut) ...@@ -925,10 +925,16 @@ static void testScreenBuffer(HANDLE hConOut)
SetConsoleCursorPosition(hConOutRW, c); SetConsoleCursorPosition(hConOutRW, c);
ret = WriteConsoleA(hConOutRW, test_cp866, lstrlenA(test_cp866), &len, NULL); ret = WriteConsoleA(hConOutRW, test_cp866, lstrlenA(test_cp866), &len, NULL);
ok(ret && len == lstrlenA(test_cp866), "WriteConsoleA failed\n"); ok(ret && len == lstrlenA(test_cp866), "WriteConsoleA failed\n");
ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenA(test_cp866), c, &len); ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenW(test_unicode), c, &len);
ok(ret && len == lstrlenA(test_cp866), "ReadConsoleOutputCharacterW failed\n"); /* Work around some broken results under Windows with some locale (ja, cn, ko...)
str_wbuf[lstrlenA(test_cp866)] = 0; * Looks like a real bug in Win10 (at least).
ok(!lstrcmpW(str_wbuf, test_unicode), "string does not match the pattern\n"); */
if (ret && broken(len == lstrlenW(test_unicode) / sizeof(WCHAR)))
ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenW(test_unicode) * sizeof(WCHAR), c, &len);
ok(ret, "ReadConsoleOutputCharacterW failed\n");
ok(len == lstrlenW(test_unicode), "unexpected len %lu %u\n", len, lstrlenW(test_unicode));
ok(!memcmp(str_wbuf, test_unicode, lstrlenW(test_unicode) * sizeof(WCHAR)),
"string does not match the pattern\n");
/* /*
* cp866 is OK, let's switch to cp1251. * cp866 is OK, let's switch to cp1251.
......
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