Commit 24bf6618 authored by Kirill K. Smirnov's avatar Kirill K. Smirnov Committed by Alexandre Julliard

kernel32/tests: Add tests for console codepages.

parent 9d746618
......@@ -1175,6 +1175,20 @@ static void test_Console(void)
cpInC = GetConsoleCP();
cpOutC = GetConsoleOutputCP();
/* Try to set invalid CP */
SetLastError(0xdeadbeef);
ok(!SetConsoleCP(0), "Shouldn't succeed\n");
ok(GetLastError()==ERROR_INVALID_PARAMETER,
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_PARAMETER, GetLastError());
SetLastError(0xdeadbeef);
ok(!SetConsoleOutputCP(0), "Shouldn't succeed\n");
ok(GetLastError()==ERROR_INVALID_PARAMETER,
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_PARAMETER, GetLastError());
SetConsoleCP(cpIn);
SetConsoleOutputCP(cpOut);
......@@ -1213,8 +1227,8 @@ static void test_Console(void)
okChildInt("Console", "InputMode", modeIn);
okChildInt("Console", "OutputMode", modeOut);
todo_wine ok(cpInC == 1252, "Wrong console CP (expected 1252 got %d/%d)\n", cpInC, cpIn);
todo_wine ok(cpOutC == 1252, "Wrong console-SB CP (expected 1252 got %d/%d)\n", cpOutC, cpOut);
ok(cpInC == 1252, "Wrong console CP (expected 1252 got %d/%d)\n", cpInC, cpIn);
ok(cpOutC == 1252, "Wrong console-SB CP (expected 1252 got %d/%d)\n", cpOutC, cpOut);
ok(modeInC == (modeIn ^ 1), "Wrong console mode\n");
ok(modeOutC == (modeOut ^ 1), "Wrong console-SB mode\n");
ok(sbiC.dwCursorPosition.X == (sbi.dwCursorPosition.X ^ 1), "Wrong cursor position\n");
......
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