From 809d47839d665588b79eb35fcf1a06fbd8d3e99a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 25 Jul 2007 13:46:42 +0200 Subject: [PATCH] user32/tests: Flush events more aggressively in mouse input test. --- dlls/user32/tests/win.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 6cbddebe24a..9c083674089 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -2507,7 +2507,7 @@ static void test_mouse_input(HWND hwnd) GetCursorPos(&pt); ok(x == pt.x && y == pt.y, "wrong cursor pos (%d,%d), expected (%d,%d)\n", pt.x, pt.y, x, y); - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + flush_events(); /* Check that setting the same position will generate WM_MOUSEMOVE */ SetCursorPos(x, y); @@ -2520,7 +2520,7 @@ static void test_mouse_input(HWND hwnd) * otherwise it won't generate relative mouse movements below. */ mouse_event(MOUSEEVENTF_MOVE, -1, -1, 0, 0); - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + flush_events(); msg.message = 0; mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); @@ -2536,7 +2536,7 @@ static void test_mouse_input(HWND hwnd) ShowWindow(popup, SW_HIDE); ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "no message available\n"); ok(msg.hwnd == hwnd && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message); - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + flush_events(); mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); ShowWindow(hwnd, SW_HIDE); @@ -2547,8 +2547,6 @@ static void test_mouse_input(HWND hwnd) ShowWindow(hwnd, SW_SHOW); ShowWindow(popup, SW_SHOW); - - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); flush_events(); mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); @@ -2580,7 +2578,7 @@ static void test_mouse_input(HWND hwnd) ok(!ret, "message %04x available\n", msg.message); ShowWindow(popup, SW_HIDE); - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + flush_events(); mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);