[PATCH 5/6] comctl32/tests: Narrow scope of PGM_SETCHILD todos.

Stefan Dösinger stefan at codeweavers.com
Fri Apr 7 09:02:05 CDT 2017


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
 dlls/comctl32/tests/msg.h   | 26 +++++++++++++++++++++++---
 dlls/comctl32/tests/pager.c |  8 +++++---
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h
index 242d690..5f246b7 100644
--- a/dlls/comctl32/tests/msg.h
+++ b/dlls/comctl32/tests/msg.h
@@ -39,7 +39,8 @@ typedef enum
     hook = 0x100,
     winevent_hook =0x200,
     id = 0x400,
-    custdraw = 0x800
+    custdraw = 0x800,
+    todo_extra = 0x1000,
 } msg_flags_t;
 
 struct message
@@ -122,7 +123,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,
 	if (expected->message == actual->message)
 	{
 	    if ((expected->flags & defwinproc) != (actual->flags & defwinproc) &&
-                (expected->flags & optional))
+                (expected->flags & (optional | todo_extra)))
             {
                 /* don't match messages if their defwinproc status differs */
                 expected++;
@@ -319,11 +320,23 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
                 context, expected->message);
             if ((expected->flags & winevent_hook) != (actual->flags & winevent_hook)) dump++;
 
+            if (expected->flags & todo_extra)
+            {
+                todo_wine ok_(file, line) (FALSE, "%s: received extra message 0x%04x\n",
+                                           context, actual->message);
+            }
+
             expected++;
             actual++;
         }
         else if (expected->flags & optional)
             expected++;
+        else if (expected->flags & todo_extra)
+        {
+            todo_wine ok_(file, line) (TRUE, "%s: expected extra message 0x%04x not received\n",
+                context, expected->message);
+            expected++;
+        }
         else if (todo)
         {
             failcount++;
@@ -346,8 +359,15 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
     }
 
     /* skip all optional trailing messages */
-    while (expected->message && ((expected->flags & optional)))
+    while (expected->message && (expected->flags & (optional | todo_extra)))
+    {
+        if (expected->flags & todo_extra)
+        {
+            todo_wine ok_(file, line) (TRUE, "%s: expected extra message 0x%04x not received\n",
+                context, expected->message);
+        }
         expected++;
+    }
 
     if (todo)
     {
diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 7a9cdbb..971f0ae 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -42,6 +42,7 @@ static const struct message set_child_seq[] = {
     { WM_NCCALCSIZE, sent|wparam, TRUE },
     { WM_NOTIFY, sent|id|parent, 0, 0, PGN_CALCSIZE },
     { WM_WINDOWPOSCHANGED, sent },
+    { WM_NOTIFY, sent|parent|todo_extra },
     { WM_WINDOWPOSCHANGING, sent|id, 0, 0, CHILD1_ID },
     { WM_NCCALCSIZE, sent|wparam|id|optional, TRUE, 0, CHILD1_ID },
     { WM_CHILDACTIVATE, sent|id, 0, 0, CHILD1_ID },
@@ -60,6 +61,7 @@ static const struct message switch_child_seq[] = {
     { WM_NCCALCSIZE, sent|wparam, TRUE },
     { WM_NOTIFY, sent|id|parent, 0, 0, PGN_CALCSIZE },
     { WM_WINDOWPOSCHANGED, sent },
+    { WM_NOTIFY, sent|parent|todo_extra },
     { WM_WINDOWPOSCHANGING, sent|id, 0, 0, CHILD2_ID },
     { WM_NCCALCSIZE, sent|wparam|id, TRUE, 0, CHILD2_ID },
     { WM_CHILDACTIVATE, sent|id, 0, 0, CHILD2_ID },
@@ -272,14 +274,14 @@ static void test_pager(void)
 
     flush_sequences( sequences, NUM_MSG_SEQUENCES );
     SendMessageA( pager, PGM_SETCHILD, 0, (LPARAM)child1_wnd );
-    ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", TRUE);
+    ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", FALSE);
     GetWindowRect( pager, &rect );
     ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
         "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child2_wnd);
-    ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", TRUE);
+    ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE);
     GetWindowRect(pager, &rect);
     ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
         "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
@@ -287,7 +289,7 @@ static void test_pager(void)
 
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child1_wnd);
-    ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", TRUE);
+    ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE);
     GetWindowRect(pager, &rect);
     ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
         "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
-- 
2.10.2




More information about the wine-patches mailing list