[PATCH] user32/tests: Simplify test_SendMessage_other_thread().

Zebediah Figura z.figura12 at gmail.com
Fri Nov 3 01:01:20 CDT 2017


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
This fixes an intermittent set of test failures (reported as bug 42568) wherein
the child thread's second (but effectively third) call to SendMessage() would
sneak between the main thread's two calls to PeekMessage(). There is no
apparent reason to call PeekMessage() twice in such a manner; we have tests for
the behaviour of this function elsewhere in this file, and the purpose of this
test is to demonstrate that Wine's current method of using internal messages to
handle cross-thread and cross-process window events is incorrect.

 dlls/user32/tests/msg.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 10f4fbd..64c7967 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -16365,9 +16365,6 @@ static const struct message send_message_2[] = {
 };
 static const struct message send_message_3[] = {
     { WM_USER+3, sent|wparam|lparam, 0, 0 },
-    { 0 }
-};
-static const struct message send_message_4[] = {
     { WM_USER+1, sent|wparam|lparam, 0, 0 },
     { 0 }
 };
@@ -16474,15 +16471,10 @@ static void test_SendMessage_other_thread(int thread_n)
     ok(ret == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE), "wrong status %08x\n", ret);
 
     trace("main: call PeekMessage\n");
-    ok(PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE), "PeekMessage should not fail\n");
-    ok(msg.message == WM_USER+1, "expected WM_USER+1, got %04x\n", msg.message);
-    ok_sequence(send_message_3, "SendMessage from other thread 3", thread_n == 2);
-
-    trace("main: call PeekMessage\n");
     ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should not fail\n");
     ok(msg.message == WM_USER+1, "expected WM_USER+1, got %04x\n", msg.message);
     DispatchMessageA(&msg);
-    ok_sequence(send_message_4, "SendMessage from other thread 4", FALSE);
+    ok_sequence(send_message_3, "SendMessage from other thread 3", thread_n == 2);
 
     /* intentionally yield */
     MsgWaitForMultipleObjects(0, NULL, FALSE, 100, qs_all_input);
-- 
2.7.4




More information about the wine-patches mailing list