From 24bf66180b7563b49d6460e2c49b944b63eab2c1 Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Thu, 10 May 2007 21:24:11 +0400 Subject: [PATCH] kernel32/tests: Add tests for console codepages. --- dlls/kernel32/tests/process.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 162a62287fa..a5f240af0cc 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -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");