Hugh McMaster : kernel32/tests: Add tests for the TRUE pathway of GetCurrentConsoleFont.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 27 11:27:21 CST 2016


Module: wine
Branch: master
Commit: c6e10496b3106a5b4203243f473b400a77e51d7b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c6e10496b3106a5b4203243f473b400a77e51d7b

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Jan 27 14:55:17 2016 +1100

kernel32/tests: Add tests for the TRUE pathway of GetCurrentConsoleFont.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/console.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 43a4b75..4dca17d 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -2606,6 +2606,14 @@ static void test_GetCurrentConsoleFont(HANDLE std_output)
 
     memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO));
     SetLastError(0xdeadbeef);
+    ret = GetCurrentConsoleFont(NULL, TRUE, &cfi);
+    ok(!ret, "got %d, expected 0\n", ret);
+    ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+    ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X);
+    ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
+
+    memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO));
+    SetLastError(0xdeadbeef);
     ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), FALSE, &cfi);
     ok(!ret, "got %d, expected 0\n", ret);
     ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
@@ -2614,6 +2622,14 @@ static void test_GetCurrentConsoleFont(HANDLE std_output)
 
     memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO));
     SetLastError(0xdeadbeef);
+    ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), TRUE, &cfi);
+    ok(!ret, "got %d, expected 0\n", ret);
+    ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+    ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X);
+    ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y);
+
+    memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO));
+    SetLastError(0xdeadbeef);
     ret = GetCurrentConsoleFont(std_output, FALSE, &cfi);
     ok(ret, "got %d, expected non-zero\n", ret);
     ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
@@ -2625,6 +2641,16 @@ static void test_GetCurrentConsoleFont(HANDLE std_output)
         "got %d, expected %d\n", cfi.dwFontSize.X, width);
     ok(cfi.dwFontSize.Y == height || cfi.dwFontSize.Y == c.Y /* Vista and higher */,
         "got %d, expected %d\n", cfi.dwFontSize.Y, height);
+
+    memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO));
+    SetLastError(0xdeadbeef);
+    ret = GetCurrentConsoleFont(std_output, TRUE, &cfi);
+    ok(ret, "got %d, expected non-zero\n", ret);
+    ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+    ok(cfi.dwFontSize.X == csbi.dwMaximumWindowSize.X,
+       "got %d, expected %d\n", cfi.dwFontSize.X, csbi.dwMaximumWindowSize.X);
+    ok(cfi.dwFontSize.Y == csbi.dwMaximumWindowSize.Y,
+       "got %d, expected %d\n", cfi.dwFontSize.Y, csbi.dwMaximumWindowSize.Y);
 }
 
 static void test_GetConsoleFontSize(HANDLE std_output)




More information about the wine-cvs mailing list