From: Conor McCarthy cmccarthy@codeweavers.com
Requires display mode emulation for failures to manifest. --- dlls/user32/tests/monitor.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 206d9505705..7ad3970a646 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -3611,6 +3611,8 @@ static void test_monitor_dpi(void) DPI_AWARENESS_CONTEXT old_ctx; float scale_x, scale_y; BOOL ret, is_virtual; + INT x, y; + POINT pt;
if (!pGetDpiForMonitorInternal || !pSetThreadDpiAwarenessContext) { @@ -3722,6 +3724,19 @@ static void test_monitor_dpi(void) ok( fabs( dpi_y - system_dpi * scale_y ) < system_dpi * 0.05, "got MDT_RAW_DPI y %u\n", dpi_y ); }
+ /* Test for cursor position rounding errors. To be meaninful, this requires display + * mode emulation. To enable it, run 'wine control desk.cpl' and set the checkbox. */ + for (x = infos[i].rect.left; x < infos[i].rect.left + 64; ++x) + { + y = x - infos[i].rect.left + infos[i].rect.top; + SetCursorPos(x, y); + GetCursorPos(&pt); + todo_wine_if(pt.x != x) + ok(pt.x == x, "got x %ld, expected %d.\n", pt.x, x); + todo_wine_if(pt.y != y) + ok(pt.y == y, "got y %ld, expected %d.\n", pt.y, y); + } + pSetThreadDpiAwarenessContext( old_ctx ); } }