[PATCH] kernel32/tests: Fix rounding error when calculating console font size
Hugh McMaster
hugh.mcmaster at outlook.com
Mon Aug 9 08:27:45 CDT 2021
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
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);
--
2.32.0
More information about the wine-devel
mailing list