[PATCH 5/6] comctl32/tests: Narrow scope of PGM_SETCHILD todos.
Stefan Dösinger
stefan at codeweavers.com
Wed Apr 5 02:15:43 CDT 2017
---
dlls/comctl32/tests/msg.h | 24 ++++++++++++++++++++++--
dlls/comctl32/tests/pager.c | 8 +++++---
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/tests/msg.h b/dlls/comctl32/tests/msg.h
index 42f3981..0a2140e 100644
--- a/dlls/comctl32/tests/msg.h
+++ b/dlls/comctl32/tests/msg.h
@@ -42,6 +42,7 @@ typedef enum
custdraw = 0x800,
child1 = 0x1000,
child2 = 0x2000,
+ todo_extra = 0x4000,
} msg_flags_t;
struct message
@@ -124,7 +125,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++;
@@ -342,11 +343,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++;
@@ -369,8 +382,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 f0361ec..4f16b11 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -39,6 +39,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|child1 },
{ WM_NCCALCSIZE, sent|wparam|child1|optional, TRUE },
{ WM_CHILDACTIVATE, sent|child1 },
@@ -57,6 +58,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|child2 },
{ WM_NCCALCSIZE, sent|wparam|child2, TRUE },
{ WM_CHILDACTIVATE, sent|child2 },
@@ -266,14 +268,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);
@@ -281,7 +283,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