[PATCH v4 3/4] user32/tests: Workaround an intermittent failure. (resend)

Zebediah Figura z.figura12 at gmail.com
Fri Apr 7 14:17:10 CDT 2017


Fixes https://bugs.winehq.org/show_bug.cgi?id=42568

Since the message timing is incorrect, the child's SendMessage() may
sometimes precede the main thread's PeekMessage(), causing additional
tests to fail. Adding a short thread sleep should prevent this.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/user32/tests/msg.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 093aaa6..9618948 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -16301,9 +16301,14 @@ static DWORD WINAPI SendMessage_thread_2(void *param)
     trace("thread: call SetParent\n");
     SetParent(wnd_event->hwnd, wnd_event->hwnd);
 
+    /* FIXME: remove wait once WINE is fixed */
+    Sleep(50);
+
     trace("thread: call SendMessage\n");
     SendMessageA(wnd_event->hwnd, WM_USER+2, 0, 0);
 
+    Sleep(50);
+
     trace("thread: call SendMessage\n");
     SendMessageA(wnd_event->hwnd, WM_USER+3, 0, 0);
 
-- 
2.7.4




More information about the wine-patches mailing list