Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/user32/tests/msg.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index bf20c5c7f20..1e616e3d061 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -15964,15 +15964,15 @@ static void test_PostMessage(void) flush_events(); }
-static LPARAM g_broadcast_lparam; +static WPARAM g_broadcast_wparam; static LRESULT WINAPI broadcast_test_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
if (wParam == 0xbaadbeef) - g_broadcast_lparam = wParam; + g_broadcast_wparam = wParam; else - g_broadcast_lparam = 0; + g_broadcast_wparam = 0;
return CallWindowProcA(oldproc, hwnd, message, wParam, lParam); } @@ -16040,7 +16040,7 @@ static void test_broadcast(void) }
/* send, broadcast */ - g_broadcast_lparam = 0xdead; + g_broadcast_wparam = 0xdead; ret = SendMessageTimeoutA(HWND_BROADCAST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL); if (!ret && GetLastError() == ERROR_TIMEOUT) win_skip("broadcasting test %d, timeout\n", i); @@ -16048,18 +16048,18 @@ static void test_broadcast(void) { if (messages[i] < WM_USER || messages[i] >= 0xc000) { - ok(g_broadcast_lparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_lparam, GetLastError()); + ok(g_broadcast_wparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], + g_broadcast_wparam, GetLastError()); } else { - ok(g_broadcast_lparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_lparam, GetLastError()); + ok(g_broadcast_wparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], + g_broadcast_wparam, GetLastError()); } }
/* send, topmost */ - g_broadcast_lparam = 0xdead; + g_broadcast_wparam = 0xdead; ret = SendMessageTimeoutA(HWND_TOPMOST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL); if (!ret && GetLastError() == ERROR_TIMEOUT) win_skip("broadcasting test %d, timeout\n", i); @@ -16067,13 +16067,13 @@ static void test_broadcast(void) { if (messages[i] < WM_USER || messages[i] >= 0xc000) { - ok(g_broadcast_lparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_lparam, GetLastError()); + ok(g_broadcast_wparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], + g_broadcast_wparam, GetLastError()); } else { - ok(g_broadcast_lparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_lparam, GetLastError()); + ok(g_broadcast_wparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], + g_broadcast_wparam, GetLastError()); } } }
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/user32/tests/msg.c | 47 ++++++++++------------------------------- 1 file changed, 11 insertions(+), 36 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 1e616e3d061..8aae9405320 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16001,6 +16001,7 @@ static void test_broadcast(void) for (i = 0; i < ARRAY_SIZE(messages); i++) { BOOL ret; + BOOL msg_expected = (messages[i] < WM_USER || messages[i] >= 0xc000); MSG msg;
flush_events(); @@ -16013,15 +16014,9 @@ static void test_broadcast(void)
memset(&msg, 0xab, sizeof(msg)); ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE); - if (messages[i] < WM_USER || messages[i] >= 0xc000) - { - ok(ret, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); + ok(ret == msg_expected, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); + if (msg_expected) ok(msg.hwnd == hwnd, "%d: got %p\n", i, msg.hwnd); - } - else - { - ok(!ret, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); - }
/* post, topmost */ ret = PostMessageA(HWND_TOPMOST, messages[i], 0, 0); @@ -16029,15 +16024,9 @@ static void test_broadcast(void)
memset(&msg, 0xab, sizeof(msg)); ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE); - if (messages[i] < WM_USER || messages[i] >= 0xc000) - { - ok(ret, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); + ok(ret == msg_expected, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); + if (msg_expected) ok(msg.hwnd == hwnd, "%d: got %p\n", i, msg.hwnd); - } - else - { - ok(!ret, "%d: got %d, error %d\n", i, ret, GetLastError()); - }
/* send, broadcast */ g_broadcast_wparam = 0xdead; @@ -16046,16 +16035,9 @@ static void test_broadcast(void) win_skip("broadcasting test %d, timeout\n", i); else { - if (messages[i] < WM_USER || messages[i] >= 0xc000) - { - ok(g_broadcast_wparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_wparam, GetLastError()); - } - else - { - ok(g_broadcast_wparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_wparam, GetLastError()); - } + WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead; + ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#lx, error %d\n", + i, messages[i], g_broadcast_wparam, GetLastError()); }
/* send, topmost */ @@ -16065,16 +16047,9 @@ static void test_broadcast(void) win_skip("broadcasting test %d, timeout\n", i); else { - if (messages[i] < WM_USER || messages[i] >= 0xc000) - { - ok(g_broadcast_wparam == 0xbaadbeef, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_wparam, GetLastError()); - } - else - { - ok(g_broadcast_wparam == 0xdead, "%d: message %04x, got %#lx, error %d\n", i, messages[i], - g_broadcast_wparam, GetLastError()); - } + WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead; + ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#lx, error %d\n", + i, messages[i], g_broadcast_wparam, GetLastError()); } }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81920
Your paranoid android.
=== debiant (32 bit Japanese:Japan report) ===
user32: msg.c:8816: Test failed: WaitForSingleObject failed 102 msg.c:8822: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8822: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8822: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Report validation errors: user32:msg prints too much data (33127 bytes)
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/user32/tests/msg.c | 82 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 8aae9405320..f6802fe3bdd 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -15976,6 +15976,16 @@ static LRESULT WINAPI broadcast_test_proc(HWND hwnd, UINT message, WPARAM wParam
return CallWindowProcA(oldproc, hwnd, message, wParam, lParam); } +static WNDPROC *g_oldproc_sub; +static WPARAM *g_broadcast_sub_wparam; +static LRESULT WINAPI broadcast_test_sub_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int sub_index = GetWindowLongPtrA(hwnd, GWLP_USERDATA); + + g_broadcast_sub_wparam[sub_index] = (wParam == 0xbaadbeef) ? wParam : 0; + + return CallWindowProcA(g_oldproc_sub[sub_index], hwnd, message, wParam, lParam); +}
static void test_broadcast(void) { @@ -15988,9 +15998,35 @@ static void test_broadcast(void) 0xc000, /* lowest possible atom returned by RegisterWindowMessage */ 0xffff, }; + static const struct + { + LONG style; + BOOL receive; + BOOL todo; + } bcast_expect[] = + { + {WS_OVERLAPPED, TRUE, TRUE}, + {WS_OVERLAPPED|WS_DLGFRAME, TRUE}, + {WS_OVERLAPPED|WS_BORDER, TRUE}, + {WS_OVERLAPPED|WS_CAPTION, TRUE}, + {WS_CHILD, FALSE}, + {WS_CHILD|WS_DLGFRAME, FALSE}, + {WS_CHILD|WS_BORDER, FALSE}, + {WS_CHILD|WS_CAPTION, FALSE}, + {WS_CHILD|WS_POPUP, TRUE}, + {WS_POPUP, TRUE}, + {WS_POPUP|WS_DLGFRAME, TRUE}, + {WS_POPUP|WS_BORDER, TRUE}, + {WS_POPUP|WS_CAPTION, TRUE}, + }; WNDPROC oldproc; - unsigned int i; + unsigned int i, j; HWND hwnd; + HWND *hwnd_sub; + + hwnd_sub = HeapAlloc( GetProcessHeap(), 0, ARRAY_SIZE(bcast_expect) * sizeof(*hwnd_sub) ); + g_oldproc_sub = HeapAlloc( GetProcessHeap(), 0, ARRAY_SIZE(bcast_expect) * sizeof(*g_oldproc_sub) ); + g_broadcast_sub_wparam = HeapAlloc( GetProcessHeap(), 0, ARRAY_SIZE(bcast_expect) * sizeof(*g_broadcast_sub_wparam) );
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL); ok(hwnd != NULL, "got %p\n", hwnd); @@ -16027,9 +16063,28 @@ static void test_broadcast(void) ok(ret == msg_expected, "%d: message %04x, got %d, error %d\n", i, messages[i], ret, GetLastError()); if (msg_expected) ok(msg.hwnd == hwnd, "%d: got %p\n", i, msg.hwnd); + } + + for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + { + hwnd_sub[j] = CreateWindowA("static", NULL, bcast_expect[j].style, 0, 0, 0, 0, hwnd, 0, 0, NULL); + ok(hwnd_sub[j] != NULL, "got %p\n", hwnd_sub[j]); + /* CreateWindow adds extra style flags, so call SetWindowLong to clear some of those. */ + SetWindowLongA(hwnd_sub[j], GWL_STYLE, bcast_expect[j].style); + + g_oldproc_sub[j] = (WNDPROC)SetWindowLongPtrA(hwnd_sub[j], GWLP_WNDPROC, (LONG_PTR)broadcast_test_sub_proc); + SetWindowLongPtrA(hwnd_sub[j], GWLP_USERDATA, (LONG_PTR)j); + } + + for (i = 0; i < ARRAY_SIZE(messages); i++) + { + BOOL ret; + BOOL msg_expected = (messages[i] < WM_USER || messages[i] >= 0xc000);
/* send, broadcast */ g_broadcast_wparam = 0xdead; + for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + g_broadcast_sub_wparam[j] = 0xdead; ret = SendMessageTimeoutA(HWND_BROADCAST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL); if (!ret && GetLastError() == ERROR_TIMEOUT) win_skip("broadcasting test %d, timeout\n", i); @@ -16038,10 +16093,20 @@ static void test_broadcast(void) WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead; ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#lx, error %d\n", i, messages[i], g_broadcast_wparam, GetLastError()); + for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + { + wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead; + todo_wine_if (msg_expected && bcast_expect[j].todo) + ok(g_broadcast_sub_wparam[j] == wparam_expected, + "%d,%d: message %04x, got %#lx, error %d\n", i, j, messages[i], + g_broadcast_sub_wparam[j], GetLastError()); + } }
/* send, topmost */ g_broadcast_wparam = 0xdead; + for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + g_broadcast_sub_wparam[j] = 0xdead; ret = SendMessageTimeoutA(HWND_TOPMOST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL); if (!ret && GetLastError() == ERROR_TIMEOUT) win_skip("broadcasting test %d, timeout\n", i); @@ -16050,9 +16115,24 @@ static void test_broadcast(void) WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead; ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#lx, error %d\n", i, messages[i], g_broadcast_wparam, GetLastError()); + for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + { + wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead; + todo_wine_if (msg_expected && bcast_expect[j].todo) + ok(g_broadcast_sub_wparam[j] == wparam_expected, + "%d,%d: message %04x, got %#lx, error %d\n", i, j, messages[i], + g_broadcast_sub_wparam[j], GetLastError()); + } } }
+ for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) + DestroyWindow(hwnd_sub[j]); + + HeapFree(GetProcessHeap(), 0, g_broadcast_sub_wparam); + HeapFree(GetProcessHeap(), 0, g_oldproc_sub); + HeapFree(GetProcessHeap(), 0, hwnd_sub); + DestroyWindow(hwnd); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81922
Your paranoid android.
=== debiant (32 bit French report) ===
Report validation errors: user32:msg prints too much data (32826 bytes)
=== debiant (32 bit Japanese:Japan report) ===
Report validation errors: user32:msg prints too much data (32823 bytes)
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/user32/message.c | 3 ++- dlls/user32/tests/msg.c | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 4434f4b0c2a..d8ebbfd32e3 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -552,7 +552,8 @@ LRESULT WINAPI MessageWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lP static BOOL CALLBACK broadcast_message_callback( HWND hwnd, LPARAM lparam ) { struct send_message_info *info = (struct send_message_info *)lparam; - if (!(GetWindowLongW( hwnd, GWL_STYLE ) & (WS_POPUP|WS_CAPTION))) return TRUE; + if ((GetWindowLongW( hwnd, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD) + return TRUE; switch(info->type) { case MSG_UNICODE: diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f6802fe3bdd..2ce2b3c6e54 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16002,10 +16002,9 @@ static void test_broadcast(void) { LONG style; BOOL receive; - BOOL todo; } bcast_expect[] = { - {WS_OVERLAPPED, TRUE, TRUE}, + {WS_OVERLAPPED, TRUE}, {WS_OVERLAPPED|WS_DLGFRAME, TRUE}, {WS_OVERLAPPED|WS_BORDER, TRUE}, {WS_OVERLAPPED|WS_CAPTION, TRUE}, @@ -16096,7 +16095,6 @@ static void test_broadcast(void) for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) { wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead; - todo_wine_if (msg_expected && bcast_expect[j].todo) ok(g_broadcast_sub_wparam[j] == wparam_expected, "%d,%d: message %04x, got %#lx, error %d\n", i, j, messages[i], g_broadcast_sub_wparam[j], GetLastError()); @@ -16118,7 +16116,6 @@ static void test_broadcast(void) for (j = 0; j < ARRAY_SIZE(bcast_expect); j++) { wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead; - todo_wine_if (msg_expected && bcast_expect[j].todo) ok(g_broadcast_sub_wparam[j] == wparam_expected, "%d,%d: message %04x, got %#lx, error %d\n", i, j, messages[i], g_broadcast_sub_wparam[j], GetLastError());
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81923
Your paranoid android.
=== debiant (32 bit report) ===
user32: monitor: Timeout
=== debiant (32 bit Chinese:China report) ===
user32: monitor: Timeout
=== debiant (32 bit WoW report) ===
user32: monitor: Timeout
=== debiant (64 bit WoW report) ===
user32: monitor: Timeout
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81919
Your paranoid android.
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:5363: Test failed: RedrawWindow:show_popup_extreme_location: 24: the msg 0x0085 was expected, but got msg 0x0047 instead msg.c:5363: Test failed: RedrawWindow:show_popup_extreme_location: 25: the msg sequence is not complete: expected 0014 - actual 0000