Hugh McMaster : kernel32/tests: Fix rounding error when calculating console font size.

Alexandre Julliard julliard at winehq.org
Mon Aug 9 16:21:43 CDT 2021


Module: wine
Branch: master
Commit: 9ce8aafdae85be6e79c152f7118d8204becae10b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9ce8aafdae85be6e79c152f7118d8204becae10b

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Aug  9 23:27:45 2021 +1000

kernel32/tests: Fix rounding error when calculating console font size.

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

---

 dlls/kernel32/tests/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 6ee00aa49a6..bd5cad428bc 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -3579,8 +3579,8 @@ static void test_GetConsoleFontSize(HANDLE std_output)
     ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
     GetClientRect(GetConsoleWindow(), &r);
     GetConsoleScreenBufferInfo(std_output, &csbi);
-    font_width = (r.right - r.left + 1) / csbi.srWindow.Right;
-    font_height = (r.bottom - r.top + 1) / csbi.srWindow.Bottom;
+    font_width = (r.right - r.left) / (csbi.srWindow.Right - csbi.srWindow.Left + 1);
+    font_height = (r.bottom - r.top) / (csbi.srWindow.Bottom - csbi.srWindow.Top + 1);
     ok(c.X == font_width, "got %d, expected %d\n", c.X, font_width);
     ok(c.Y == font_height, "got %d, expected %d\n", c.Y, font_height);
 




More information about the wine-cvs mailing list