From 0947a64a9026ff4a51d701753594766e8e9ad784 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Tue, 3 Jun 2025 14:08:03 -0600 Subject: [PATCH] [GDI32_APITEST] Fix test on all versions of Windows at certain vertical resolutions (#8048) * Use MulDiv to generate the result and negate that instead of dividing by a negative number, which can cause test failures. --- modules/rostests/apitests/gdi32/SetWindowExtEx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rostests/apitests/gdi32/SetWindowExtEx.c b/modules/rostests/apitests/gdi32/SetWindowExtEx.c index e55c993eda6..a61c64bc886 100644 --- a/modules/rostests/apitests/gdi32/SetWindowExtEx.c +++ b/modules/rostests/apitests/gdi32/SetWindowExtEx.c @@ -178,7 +178,7 @@ void Test_SetWindowExtEx() /* Check the viewport now, should not be the same */ GetViewportExtEx(hDC, &ViewportExt); ok_long(ViewportExt.cx, GetDeviceCaps(GetDC(0), VERTRES)); - ok_long(ViewportExt.cy, -GetDeviceCaps(GetDC(0), VERTRES) / 3); + ok_long(ViewportExt.cy, -MulDiv(GetDeviceCaps(GetDC(0), VERTRES), 1, 3)); /* again isotropic mode with 1:3 res */ SetViewportExtEx(hDC, 6000, 3000, 0);