On Mon, 2007-08-06 at 01:26 +0200, Peter Dons Tychsen wrote:

> I will go back and redo the tests with this approach, now that you have
> torpedoed my idea, which i probably deserved.

OK. To recover from my earlier brain-dead idea, i think i have came up
with a much simpler solution, based on your recommendations.

Please review this idea.

The patch adds support for checking posted messages by
emptying the queue, and marking all dispatched messages as 
sent instead of posted.

As soon as it is introduced however, it will breaks some test-cases
which then needs fixing, as more messages are checked. Not sure about
the workload in this.

Unfortunately this does seem to indicate that my original idea that
WM_ACTIVATEAPP should be posted is wrong (scratch that silly patch).
Sorry for the mess. :-)

/Pedro
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 930821f..6ba4fb8 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -1476,11 +1476,26 @@ static void ok_sequence_(const struct message *expected, const char *context, in
     static const struct message end_of_sequence = { 0, 0, 0, 0 };
     const struct message *actual;
     int failcount = 0;
-    
+    MSG msg;    
+
     add_message(&end_of_sequence);
 
     actual = sequence;
 
+    /* Remove all pending messages from the queue, so they can be added to the
+       list of messages to compare with */
+    while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
+    {
+      int count = sequence_cnt; 
+      DispatchMessage(&msg);
+      if(count != sequence_cnt)
+      {
+        /* If a new message was inserted, mark it as posted */
+        sequence[sequence_cnt-1].flags &= ~sent;
+        sequence[sequence_cnt-1].flags |= posted;
+      }
+    }
+
     while (expected->message && actual->message)
     {
 	trace_( file, line)("expected %04x - actual %04x\n", expected->message, actual->message);


Reply via email to