user32/tests: Try to fix the test failures on Win 2k.
Huw Davies
huw at codeweavers.com
Tue Jun 16 06:38:53 CDT 2015
This is somewhat of a guess since it's difficult to reproduce
the failures with a stand-alone testbot run. It would seem
that the current code sits tight loop calling PeekMessage()
until the pending mouse message is updated (or the timeout
expires). This adds a sleep to give the system a chance
to update that message.
---
dlls/user32/tests/msg.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index b5f9e6a..cc74f1c 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -10339,13 +10339,14 @@ static void wait_move_event(HWND hwnd, int x, int y)
{
MSG msg;
DWORD time;
- BOOL ret, go = FALSE;
+ BOOL ret;
time = GetTickCount();
- while (GetTickCount() - time < 200 && !go) {
+ while (GetTickCount() - time < 200) {
ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE);
- go = ret && msg.pt.x > x && msg.pt.y > y;
+ if (ret && msg.pt.x > x && msg.pt.y > y) break;
if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, GetTickCount() - time, QS_ALLINPUT );
+ else Sleep( GetTickCount() - time );
}
}
--
1.8.0
More information about the wine-patches
mailing list