This series, in addition to patches [1], [2], [3], fixes most of the user32 msg.c unit test. There's still some occasional failures, but it should be in a much better state now.
See a successful run here:
https://testbot.winehq.org/JobDetails.pl?Key=59917
[1] https://source.winehq.org/patches/data/172976 [2] https://source.winehq.org/patches/data/173238 [3] https://source.winehq.org/patches/data/173239
Rémi Bernon (12): user32/tests: Increase test_timers count tolerance on Windows. user32/tests: Tweak test result for w1064v1809. user32/tests: Synchronize with the SendMessageTimeout thread. user32/tests: Wait a bit more for ScrollWindowEx events. user32/tests: Close event at the end of the test_WaitForInputIdle test. user32/tests: Wait indefinitely for the child process to notify. user32/tests: Ignore WM_WININICHANGE message in test sequences. user32/tests: Make the test_PeekMessage3 timer fire less often. user32/tests: Tweak test_PeekMessage expectations for w1064v1809. user32/tests: Synchronize with other thread between SendMessage calls. user32/tests: Wait longer for injected mouse event to take effect. user32/tests: Add optional messages to test sequences.
dlls/user32/tests/msg.c | 89 ++++++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 19 deletions(-)
Sometimes the tests fail on w1064v1809 with count equals to 54, or 53.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 193a20fd958..2b777e0c89c 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -10275,8 +10275,8 @@ static void test_timers(void) while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0)) DispatchMessageA(&msg); ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE /* xp */ - || broken(abs(count-64) < TIMER_COUNT_TOLERANCE) /* most common */ - || broken(abs(count-43) < TIMER_COUNT_TOLERANCE) /* w2k3, win8 */, + || broken(abs(count-64) <= TIMER_COUNT_TOLERANCE) /* most common */ + || broken(abs(count-43) <= TIMER_COUNT_TOLERANCE) /* w2k3, win8 */, "did not get expected count for minimum timeout (%d != ~%d).\n", count, TIMER_COUNT_EXPECTED); ok(KillTimer(info.hWnd, id), "KillTimer failed\n"); @@ -10345,7 +10345,8 @@ static void test_timers_no_wnd(void) while (GetTickCount()-start < 1001 && GetMessageA(&msg, NULL, 0, 0)) DispatchMessageA(&msg); ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE /* xp */ - || broken(abs(count-64) < TIMER_COUNT_TOLERANCE) /* most common */, + || broken(abs(count-64) <= TIMER_COUNT_TOLERANCE) /* most common */ + || broken(abs(count-43) <= TIMER_COUNT_TOLERANCE) /* w1064v1809 */, "did not get expected count for minimum timeout (%d != ~%d).\n", count, TIMER_COUNT_EXPECTED); KillTimer(NULL, id);
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=59921
Your paranoid android.
=== wvistau64 (32 bit report) ===
user32: msg.c:16277: Test failed: 0: WaitForSingleObject failed
=== w2008s64 (32 bit report) ===
user32: msg.c:16277: Test failed: 0: WaitForSingleObject failed msg.c:16277: Test failed: 7: WaitForSingleObject failed
=== w2008s64 (task log) ===
Task errors: The task timed out
=== w8adm (32 bit report) ===
user32: msg.c:12930: Test failed: WmMouseHoverSeq: 5: the msg sequence is not complete: expected 0000 - actual 001a
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:8766: Test failed: MsgWaitForMultipleObjects failed 102
=== w1064v1809_zh_CN (32 bit report) ===
user32: msg.c:16277: Test failed: 1: WaitForSingleObject failed
=== w864 (64 bit report) ===
user32: msg.c:12420: Test failed: expected PeekMessage to return FALSE, got 1
=== debian10 (32 bit Japanese:Japan report) ===
user32: msg.c:8774: Test failed: WaitForSingleObject failed 102 msg.c:8780: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8780: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8780: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Seems like the wparam is not always as expected.
https://testbot.winehq.org/JobDetails.pl?Key=59835#k110
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2b777e0c89c..26d3abee0fa 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -9059,8 +9059,8 @@ static const struct message WmShiftMouseButton[] = { { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_SHIFT, 0xc0000001 }, /* XP */ { WM_KEYUP, wparam|lparam, VK_SHIFT, 0xc0000001 }, { WM_KEYUP, sent|wparam|lparam, VK_SHIFT, 0xc0000001 }, - { WM_LBUTTONUP, wparam|optional, MK_SHIFT, 0 }, /* >= w1064v1809 */ - { WM_LBUTTONUP, sent|wparam|optional, MK_SHIFT, 0 }, /* >= w1064v1809 */ + { WM_LBUTTONUP, optional, 0, 0 }, /* >= w1064v1809 */ + { WM_LBUTTONUP, sent|optional, 0, 0 }, /* >= w1064v1809 */ { 0 } }; static const struct message WmF1Seq[] = {
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=59922
Your paranoid android.
=== w864 (32 bit report) ===
user32: msg.c:12420: Test failed: expected PeekMessage to return FALSE, got 1
=== w1064v1809_ar (32 bit report) ===
user32: msg.c:11412: Test failed: SendMessageTimeout succeeded msg.c:11413: Test failed: WmEmptySeq: 0: the msg sequence is not complete: expected 0000 - actual 0400 msg.c:11461: Test failed: SendMessageTimeout failed
We wait a bit after starting the thread, but sometimes the test fails because we didn't wait long enough. This synchronizes the Sleep and the SendMessageTimeout calls.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 26d3abee0fa..f136ea11669 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11355,12 +11355,14 @@ struct sendmsg_info HWND hwnd; DWORD timeout; DWORD ret; + HANDLE ready; };
static DWORD CALLBACK send_msg_thread( LPVOID arg ) { struct sendmsg_info *info = arg; SetLastError( 0xdeadbeef ); + SetEvent( info->ready ); info->ret = SendMessageTimeoutA( info->hwnd, WM_USER, 0, 0, 0, info->timeout, NULL ); if (!info->ret) ok( GetLastError() == ERROR_TIMEOUT || broken(GetLastError() == 0), /* win9x */ @@ -11390,6 +11392,7 @@ static void test_SendMessageTimeout(void) DWORD tid; BOOL is_win9x;
+ info.ready = CreateEventA( NULL, 0, 0, NULL ); info.hwnd = CreateWindowA( "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); flush_events(); @@ -11397,7 +11400,9 @@ static void test_SendMessageTimeout(void)
info.timeout = 1000; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); wait_for_thread( thread ); CloseHandle( thread ); ok( info.ret == 1, "SendMessageTimeout failed\n" ); @@ -11405,7 +11410,9 @@ static void test_SendMessageTimeout(void)
info.timeout = 1; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); Sleep(100); /* SendMessageTimeout should time out here */ wait_for_thread( thread ); CloseHandle( thread ); @@ -11415,7 +11422,9 @@ static void test_SendMessageTimeout(void) /* 0 means infinite timeout (but not on win9x) */ info.timeout = 0; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); Sleep(100); wait_for_thread( thread ); CloseHandle( thread ); @@ -11426,7 +11435,9 @@ static void test_SendMessageTimeout(void) /* timeout is treated as signed despite the prototype (but not on win9x) */ info.timeout = 0x7fffffff; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); Sleep(100); wait_for_thread( thread ); CloseHandle( thread ); @@ -11435,7 +11446,9 @@ static void test_SendMessageTimeout(void)
info.timeout = 0x80000000; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); Sleep(100); wait_for_thread( thread ); CloseHandle( thread ); @@ -11454,7 +11467,9 @@ static void test_SendMessageTimeout(void) SetWindowLongPtrA( info.hwnd, GWLP_WNDPROC, (LONG_PTR)send_msg_delay_proc ); info.timeout = 100; info.ret = 0xdeadbeef; + ResetEvent( info.ready ); thread = CreateThread( NULL, 0, send_msg_thread, &info, 0, &tid ); + WaitForSingleObject( info.ready, INFINITE ); wait_for_thread( thread ); CloseHandle( thread ); /* we should time out but still get the message */ @@ -11462,6 +11477,7 @@ static void test_SendMessageTimeout(void) ok_sequence( WmUser, "WmUser", FALSE );
DestroyWindow( info.hwnd ); + CloseHandle( info.ready ); }
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=59923
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:8234: Test failed: WmParentPaintNc: 5: the msg sequence is not complete: expected 0000 - actual 0024
It sometimes fails with an empty sequence on w2003std.
https://testbot.winehq.org/JobDetails.pl?Key=59878#k102
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f136ea11669..1d795b50c3a 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11073,6 +11073,7 @@ static void test_scrollwindowex(void) ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 1000, QS_ALLINPUT ); flush_events(); ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); @@ -11084,6 +11085,7 @@ static void test_scrollwindowex(void) ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 1000, QS_ALLINPUT ); flush_events(); ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE); flush_events(); @@ -11098,6 +11100,7 @@ static void test_scrollwindowex(void) ok_sequence(WmEmptySeq, "ScrollWindowEx", TRUE); trace("end scroll\n"); flush_sequence(); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 1000, QS_ALLINPUT ); flush_events(); ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); @@ -11108,6 +11111,7 @@ static void test_scrollwindowex(void) ScrollWindow( hwnd, 5, 5, NULL, NULL); trace("end scroll\n"); flush_sequence(); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 1000, QS_ALLINPUT ); flush_events(); ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE);
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=59929
Your paranoid android.
=== w8adm (32 bit report) ===
user32: msg.c:12950: Test failed: WmMouseHoverSeq: 3: the msg 0x0118 was expected, but got msg 0x001a instead msg.c:12950: Test failed: WmMouseHoverSeq: 4: the msg 0x02a1 was expected, but got msg 0x001a instead msg.c:12950: Test failed: WmMouseHoverSeq: 5: the msg sequence is not complete: expected 0000 - actual 0118
=== w864 (32 bit report) ===
user32: msg.c:12499: Test failed: expected PeekMessage to return FALSE, got 1 msg.c:12511: Test failed: msg.message = 275 instead of WM_USER msg.c:12513: Test failed: expected PeekMessage to return FALSE, got 1 msg.c:12522: Test failed: msg.message = 1024 instead of WM_TIMER msg.c:12524: Test failed: expected PeekMessage to return FALSE, got 1
=== w864 (64 bit report) ===
user32: msg.c:12440: Test failed: expected PeekMessage to return FALSE, got 1
=== debian10 (64 bit WoW report) ===
user32: msg.c:17545: Test failed: SendMessage from other thread 1: 1: the msg 0x0400 was expected, but got msg 0x0403 instead msg.c:17545: Test failed: SendMessage from other thread 1: 2: the msg sequence is not complete: expected 0000 - actual 0400 msg.c:17555: Test failed: wrong status 00080000 msg.c:17561: Test failed: SendMessage from other thread 3: 0: the msg 0x0403 was expected, but got msg 0x0401 instead msg.c:17561: Test failed: SendMessage from other thread 3: 1: the msg sequence is not complete: expected 0401 - actual 0000
There's some random timeout failures on Windows VMs in this test, this is probably not going to fix them, but cleaning up is not going to hurt.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 1d795b50c3a..41310864574 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16319,6 +16319,7 @@ static void test_WaitForInputIdle( char *argv0 ) CloseHandle( pi.hThread ); } } + CloseHandle( end_event ); CloseHandle( start_event ); PostThreadMessageA( id, WM_QUIT, 0, 0 ); WaitForSingleObject( thread, 10000 );
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=59930
Your paranoid android.
=== w8adm (32 bit report) ===
user32: msg.c:12958: Test failed: WmMouseHoverSeq: 5: the msg sequence is not complete: expected 0000 - actual 001a
=== w864 (32 bit report) ===
user32: msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 12: the msg 0x001c was expected, but got msg 0x0085 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 13: the msg 0x0086 was expected, but got msg 0x0014 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 14: the msg 0x0006 was expected, but got msg 0x0047 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 19: the msg 0x0009 was expected, but got msg 0x001c instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 20: the msg 0x0007 was expected, but got msg 0x0086 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 21: the msg 0x0085 was expected, but got msg 0x0006 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 22: the msg 0x0014 was expected, but got msg 0x0009 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 23: the msg 0x0047 was expected, but got msg 0x0007 instead msg.c:5322: Test failed: RedrawWindow:show_popup_extreme_location: 26: the msg sequence is not complete: expected 0000 - actual 0047
=== w1064v1809_he (32 bit report) ===
user32: msg.c:11895: Test failed: wrong qstatus 00490048 msg.c:11977: Test failed: got 0 and 0000 instead of TRUE and WM_PAINT msg.c:11980: Test failed: WmPaint: 0: the msg sequence is not complete: expected 000f - actual 0000 msg.c:11983: Test failed: wrong qstatus 00210000 msg.c:11994: Test failed: wrong qstatus 00210000 msg.c:12002: Test failed: wrong qstatus 00610040 msg.c:12008: Test failed: wrong qstatus 00690008 msg.c:12019: Test failed: wrong qstatus 00210000 msg.c:12027: Test failed: WmEmptySeq: 0: the msg sequence is not complete: expected 0000 - actual 0024 msg.c:12030: Test failed: wrong qstatus 00210000 msg.c:12036: Test failed: wrong qstatus 00290008 msg.c:12044: Test failed: wrong qstatus 00690040 msg.c:12055: Test failed: wrong qstatus 00290000 msg.c:12069: Test failed: wrong qstatus 00290000 msg.c:12083: Test failed: wrong qstatus 00280000 msg.c:12094: Test failed: wrong qstatus 00280000 msg.c:12105: Test failed: wrong qstatus 00200000 msg.c:12110: Test failed: PeekMessageA should have returned FALSE instead of msg 000f msg.c:12116: Test failed: wrong qstatus 00200000 msg.c:12125: Test failed: wrong qstatus 00280008 msg.c:12131: Test failed: wrong qstatus 00280008 msg.c:12141: Test failed: wrong qstatus 00280000 msg.c:12154: Test failed: wrong qstatus 00280000 msg.c:12160: Test failed: PeekMessageA should have returned FALSE instead of msg 000f msg.c:12166: Test failed: wrong qstatus 00200000 msg.c:12173: Test failed: wrong qstatus 00210001 msg.c:12177: Test failed: wrong qstatus 00290008 msg.c:12186: Test failed: wrong qstatus 00210000 msg.c:12197: Test failed: wrong qstatus 00200000 msg.c:12202: Test failed: wrong qstatus 00210001 msg.c:12206: Test failed: wrong qstatus 00290008 msg.c:12216: Test failed: wrong qstatus 00280000 msg.c:12226: Test failed: wrong qstatus 00200000 msg.c:12231: Test failed: wrong qstatus 00210001 msg.c:12235: Test failed: wrong qstatus 00290008 msg.c:12241: Test failed: wrong qstatus 00690040 msg.c:12252: Test failed: wrong qstatus 00280000 msg.c:12262: Test failed: wrong qstatus 00200000 msg.c:17789: Test failed: Restore minimized window: 41: the msg sequence is not complete: expected 0000 - actual 0007
=== w1064v1809_zh_CN (32 bit report) ===
user32: msg.c:17789: Test failed: Restore minimized window: 41: the msg sequence is not complete: expected 0000 - actual 0007
=== w864 (64 bit report) ===
user32: msg.c:12453: Test failed: expected PeekMessage to return FALSE, got 1
We could create the process, so now it should eventually signal the event unless there's something very wrong going on. This wait sometimes times out on the testbot, this makes it infinite.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 41310864574..f548ffbb584 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16293,7 +16293,7 @@ static void test_WaitForInputIdle( char *argv0 ) ok( ret, "CreateProcess '%s' failed err %u.\n", path, GetLastError() ); if (ret) { - ret = WaitForSingleObject( start_event, 5000 ); + ret = WaitForSingleObject( start_event, INFINITE ); ok( ret == WAIT_OBJECT_0, "%u: WaitForSingleObject failed\n", i ); if (ret == WAIT_OBJECT_0) {
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=59931
Your paranoid android.
=== w8adm (32 bit report) ===
user32: msg.c:12958: Test failed: WmMouseHoverSeq: 5: the msg sequence is not complete: expected 0000 - actual 001a
=== w1064v1809_he (32 bit report) ===
user32: msg.c:17789: Test failed: Restore minimized window: 0: the msg 0x0005 was expected, but got msg 0x0024 instead
=== w864 (64 bit report) ===
user32: msg.c:12440: Test failed: expected PeekMessage to return FALSE, got 1
Tests sometimes fail because of an unexpected 0x001a message.
https://testbot.winehq.org/JobDetails.pl?Key=59886#k106
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f548ffbb584..53482d2cf29 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -2085,7 +2085,8 @@ static BOOL ignore_message( UINT message ) message == WM_TIMECHANGE || message == WM_DISPLAYCHANGE || message == WM_DEVICECHANGE || - message == WM_DWMNCRENDERINGCHANGED); + message == WM_DWMNCRENDERINGCHANGED || + message == WM_WININICHANGE); }
static unsigned hash_Ly_W(const WCHAR *str)
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=59932
Your paranoid android.
=== w8adm (32 bit report) ===
user32: msg.c:12500: Test failed: expected PeekMessage to return FALSE, got 1 msg.c:12512: Test failed: msg.message = 275 instead of WM_USER msg.c:12514: Test failed: expected PeekMessage to return FALSE, got 1 msg.c:12523: Test failed: msg.message = 1024 instead of WM_TIMER msg.c:12525: Test failed: expected PeekMessage to return FALSE, got 1
On Windows it sometimes fires again before we get the expected WM_USER message and/or before the end of the test where we don't expect any more message. We cannot fire it only once because Wine doesn't pass the tests yet and it would block otherwise, but fire it less often helps the test to pass on Windows.
https://testbot.winehq.org/JobDetails.pl?Key=59886#k107
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 53482d2cf29..3a92ec24276 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12424,7 +12424,7 @@ static void test_PeekMessage3(void) /* GetMessage() and PeekMessage(..., PM_REMOVE) should prefer messages which * were already seen. */
- SetTimer(hwnd, 1, 0, NULL); + SetTimer(hwnd, 1, 100, NULL); while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)); ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message); PostMessageA(hwnd, WM_USER, 0, 0); @@ -12440,7 +12440,7 @@ static void test_PeekMessage3(void) ret = PeekMessageA(&msg, NULL, 0, 0, 0); ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
- SetTimer(hwnd, 1, 0, NULL); + SetTimer(hwnd, 1, 100, NULL); while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)); ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message); PostMessageA(hwnd, WM_USER, 0, 0); @@ -12455,7 +12455,7 @@ static void test_PeekMessage3(void)
/* It doesn't matter if a message range is specified or not. */
- SetTimer(hwnd, 1, 0, NULL); + SetTimer(hwnd, 1, 100, NULL); while (!PeekMessageA(&msg, NULL, WM_TIMER, WM_TIMER, PM_NOREMOVE)); ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message); PostMessageA(hwnd, WM_USER, 0, 0); @@ -12471,7 +12471,7 @@ static void test_PeekMessage3(void) /* But not if the post messages were added before the PeekMessage() call. */
PostMessageA(hwnd, WM_USER, 0, 0); - SetTimer(hwnd, 1, 0, NULL); + SetTimer(hwnd, 1, 100, NULL); while (!PeekMessageA(&msg, NULL, WM_TIMER, WM_TIMER, PM_NOREMOVE)); ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message); ret = GetMessageA(&msg, NULL, 0, 0); @@ -12484,7 +12484,7 @@ static void test_PeekMessage3(void) /* More complicated test with multiple messages. */
PostMessageA(hwnd, WM_USER, 0, 0); - SetTimer(hwnd, 1, 0, NULL); + SetTimer(hwnd, 1, 100, NULL); while (!PeekMessageA(&msg, NULL, WM_TIMER, WM_TIMER, PM_NOREMOVE)); ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message); PostMessageA(hwnd, WM_USER + 1, 0, 0);
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=59933
Your paranoid android.
=== w8adm (32 bit report) ===
user32: msg.c:13510: Test failed: 54: ShowWindow(SW_MINIMIZE): 4: in msg 0x0047 expecting wParam 0x8170 got 0x1803 msg.c:13510: Test failed: 54: ShowWindow(SW_MINIMIZE): 5: the msg 0x0003 was expected, but got msg 0x0047 instead msg.c:13510: Test failed: 54: ShowWindow(SW_MINIMIZE): 6: the msg 0x0005 was expected, but got msg 0x0003 instead msg.c:13510: Test failed: 54: ShowWindow(SW_MINIMIZE): 7: the msg sequence is not complete: expected 0000 - actual 0005
=== w1064v1809_he (32 bit report) ===
user32: msg.c:11896: Test failed: wrong qstatus 00490048 msg.c:11978: Test failed: got 0 and 0000 instead of TRUE and WM_PAINT msg.c:11981: Test failed: WmPaint: 0: the msg sequence is not complete: expected 000f - actual 0000 msg.c:11984: Test failed: wrong qstatus 00210000 msg.c:11995: Test failed: wrong qstatus 00210000 msg.c:12003: Test failed: wrong qstatus 00610040 msg.c:12009: Test failed: wrong qstatus 00690008 msg.c:12020: Test failed: wrong qstatus 00210000 msg.c:12028: Test failed: WmEmptySeq: 0: the msg sequence is not complete: expected 0000 - actual 0024 msg.c:12031: Test failed: wrong qstatus 00210000 msg.c:12037: Test failed: wrong qstatus 00290008 msg.c:12045: Test failed: wrong qstatus 00690040 msg.c:12056: Test failed: wrong qstatus 00290000 msg.c:12070: Test failed: wrong qstatus 00290000 msg.c:12084: Test failed: wrong qstatus 00280000 msg.c:12095: Test failed: wrong qstatus 00280000 msg.c:12106: Test failed: wrong qstatus 00200000 msg.c:12111: Test failed: PeekMessageA should have returned FALSE instead of msg 000f msg.c:12117: Test failed: wrong qstatus 00200000 msg.c:12126: Test failed: wrong qstatus 00280008 msg.c:12132: Test failed: wrong qstatus 00280008 msg.c:12142: Test failed: wrong qstatus 00280000 msg.c:12155: Test failed: wrong qstatus 00280000 msg.c:12161: Test failed: PeekMessageA should have returned FALSE instead of msg 000f msg.c:12167: Test failed: wrong qstatus 00200000 msg.c:12174: Test failed: wrong qstatus 00210001 msg.c:12178: Test failed: wrong qstatus 00290008 msg.c:12187: Test failed: wrong qstatus 00210000 msg.c:12198: Test failed: wrong qstatus 00200000 msg.c:12203: Test failed: wrong qstatus 00210001 msg.c:12207: Test failed: wrong qstatus 00290008 msg.c:12217: Test failed: wrong qstatus 00280000 msg.c:12227: Test failed: wrong qstatus 00200000 msg.c:12232: Test failed: wrong qstatus 00210001 msg.c:12236: Test failed: wrong qstatus 00290008 msg.c:12242: Test failed: wrong qstatus 00690040 msg.c:12253: Test failed: wrong qstatus 00280000 msg.c:12263: Test failed: wrong qstatus 00200000
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:12385: Test failed: message time not advanced: 1531c 1531c msg.c:12386: Test failed: coords not changed: (101 101) (101 101) msg.c:12403: Test failed: message time not advanced: 1531c 1531c msg.c:12404: Test failed: coords not changed: (101 101) (101 101)
This sometimes fails on the testbot, usually on the non-us VMs.
https://testbot.winehq.org/JobDetails.pl?Key=59888#k113
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 3a92ec24276..c73f9ac36b9 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11894,7 +11894,8 @@ static void test_PeekMessage(void) PostMessageA(info.hwnd, WM_CHAR, 'z', 0); qstatus = GetQueueStatus(qs_all_input); ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY) || - qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY|QS_SENDMESSAGE), + qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY|QS_SENDMESSAGE) || + broken(qstatus == MAKELONG(QS_POSTMESSAGE|QS_SENDMESSAGE, QS_POSTMESSAGE|QS_KEY|QS_SENDMESSAGE)) /* sometimes on non-us w1064v1809 */, "wrong qstatus %08x\n", qstatus);
InvalidateRect(info.hwnd, NULL, FALSE); @@ -11975,6 +11976,10 @@ static void test_PeekMessage(void)
msg.message = 0; ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_PAINT); + /* GetQueueStatus documentation says that it's not a guarantee that PeekMessage will succeed, + * it indeed fails from time to time on the non-us w1064v1809 testbot VMs, let's try again */ + if (!ret && GetQueueStatus(qs_all_input) == MAKELONG(0, QS_PAINT|QS_KEY)) + ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_PAINT); ok(ret && msg.message == WM_PAINT, "got %d and %04x instead of TRUE and WM_PAINT\n", ret, msg.message); DispatchMessageA(&msg);
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=59934
Your paranoid android.
=== wxppro (32 bit report) ===
user32: msg.c:5841: Test failed: ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent: 1: in msg 0x0046 expecting wParam 0x8170 got 0x8160 msg.c:5841: Test failed: ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent: 4: the msg 0x0047 was expected, but got msg 0x0022 instead msg.c:5841: Test failed: ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent: 5: the msg 0x0003 was expected, but got msg 0x0047 instead msg.c:5841: Test failed: ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent: 6: the msg 0x0005 was expected, but got msg 0x0003 instead msg.c:5841: Test failed: ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent: 11: the msg sequence is not complete: expected 0000 - actual 0005
This sometimes fails on Windows because we check the queue status before the other thread second call to SendMessage has been made (or received).
Adding a synchronization here could help, although there should not be any long delay as we already seen the first SendMessage call -asserted by the send_message_1 sequence.
https://testbot.winehq.org/JobDetails.pl?Key=59890#k106
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index c73f9ac36b9..593a1e65047 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -17475,6 +17475,7 @@ static DWORD WINAPI SendMessage_thread_1(void *param)
trace("thread: call SendMessage\n"); SendMessageA(wnd_event->hwnd, WM_USER+2, 0, 0); + SetEvent(wnd_event->stop_event);
trace("thread: call SendMessage\n"); SendMessageA(wnd_event->hwnd, WM_USER+3, 0, 0); @@ -17501,6 +17502,7 @@ static DWORD WINAPI SendMessage_thread_2(void *param)
trace("thread: call SendMessage\n"); SendMessageA(wnd_event->hwnd, WM_USER+2, 0, 0); + SetEvent(wnd_event->stop_event);
trace("thread: call SendMessage\n"); SendMessageA(wnd_event->hwnd, WM_USER+3, 0, 0); @@ -17517,6 +17519,7 @@ static void test_SendMessage_other_thread(int thread_n) MSG msg;
wnd_event.start_event = CreateEventA(NULL, 0, 0, NULL); + wnd_event.stop_event = CreateEventA(NULL, 0, 0, NULL);
wnd_event.hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL); @@ -17551,6 +17554,10 @@ static void test_SendMessage_other_thread(int thread_n) DispatchMessageA(&msg); ok_sequence(send_message_1, "SendMessage from other thread 1", thread_n == 2);
+ ret = WaitForSingleObject(wnd_event.stop_event, 100); + todo_wine_if (thread_n == 2) + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed, ret:%x\n", ret); + /* intentionally yield */ MsgWaitForMultipleObjects(0, NULL, FALSE, 100, qs_all_input);
@@ -17587,6 +17594,9 @@ todo_wine_if (thread_n == 2)
flush_events(); flush_sequence(); + + CloseHandle(wnd_event.start_event); + CloseHandle(wnd_event.stop_event); }
static LRESULT CALLBACK insendmessage_wnd_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
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=59935
Your paranoid android.
=== w1064v1809_he (task log) ===
Task errors: The task timed out
=== w1064v1809_ja (32 bit report) ===
user32: msg.c:12390: Test failed: message time not advanced: 12ce7 12ce7 msg.c:12391: Test failed: coords not changed: (101 101) (101 101) msg.c:12408: Test failed: message time not advanced: 12ce7 12ce7 msg.c:12409: Test failed: coords not changed: (101 101) (101 101)
Also rework the wait loop a bit, the delay was weird.
https://testbot.winehq.org/JobDetails.pl?Key=59890#k112
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 593a1e65047..24314e98eb4 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12309,15 +12309,15 @@ done: static void wait_move_event(HWND hwnd, int x, int y) { MSG msg; - DWORD time; + DWORD timeout = GetTickCount() + 500, delay; BOOL ret;
- time = GetTickCount(); - while (GetTickCount() - time < 200) { - ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE); + while ((delay = timeout - GetTickCount()) > 0) + { + ret = PeekMessageA(&msg, hwnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_NOREMOVE); if (ret && msg.pt.x > x && msg.pt.y > y) break; - if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, GetTickCount() - time, QS_ALLINPUT ); - else Sleep( GetTickCount() - time ); + if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, delay, QS_ALLINPUT ); + else Sleep( delay ); } }
* To WmCreateDialogParamSeq_4, as seen on w2008s64 here:
https://testbot.winehq.org/JobDetails.pl?Key=59881
* To WmShowPopupExtremeLocationSeq, as see on w864 here:
https://testbot.winehq.org/JobDetails.pl?Key=59894
* To WmRestoreMinimizedSeq, as see on w1064v1809_ja here:
https://testbot.winehq.org/JobDetails.pl?Key=59893#k113
* To WmMouseHoverSeq, as see on w1064v1809_zh_CN here:
https://testbot.winehq.org/JobDetails.pl?Key=59894#k114
* To WmParentPaintNc, as see on w1064v1809_ar here:
https://testbot.winehq.org/JobDetails.pl?Key=59906#k111
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/tests/msg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 24314e98eb4..b473a128c8d 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -962,6 +962,12 @@ static const struct message WmShowPopupExtremeLocationSeq[] = { { HCBT_ACTIVATE, hook }, { WM_WINDOWPOSCHANGING, sent|optional }, { WM_QUERYNEWPALETTE, sent|optional }, + + /* occasionally received on test machines */ + { WM_NCPAINT, sent|optional }, + { WM_ERASEBKGND, sent|optional }, + { WM_WINDOWPOSCHANGED, sent|optional }, + { WM_ACTIVATEAPP, sent }, { WM_NCACTIVATE, sent }, { WM_ACTIVATE, sent }, @@ -7879,6 +7885,7 @@ static const struct message WmParentPaintNc[] = { { WM_NCPAINT, sent|beginpaint }, { WM_GETTEXT, sent|beginpaint|defwinproc|optional }, { WM_ERASEBKGND, sent|beginpaint|optional }, + { WM_GETMINMAXINFO, sent|optional }, { 0 } };
@@ -12740,6 +12747,7 @@ static void test_notify_message(void) }
static const struct message WmMouseHoverSeq[] = { + { WM_GETMINMAXINFO, sent|optional }, /* sometimes seen on w1064v1809 */ { WM_MOUSEACTIVATE, sent|optional }, /* we can get those when moving the mouse in focus-follow-mouse mode under X11 */ { WM_MOUSEACTIVATE, sent|optional }, { WM_TIMER, sent|optional }, /* XP sends it */ @@ -13771,6 +13779,7 @@ static const struct message WmCreateDialogParamSeq_4[] = { { WM_QUERYNEWPALETTE, sent|parent|optional }, /* TODO: this message should not be sent */ { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_WINDOWPOSCHANGED, sent|parent|wparam|optional, SWP_NOREDRAW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { WM_ACTIVATEAPP, sent|parent|wparam, 1 }, { WM_NCACTIVATE, sent|parent }, { WM_ACTIVATE, sent|parent|wparam, 1 }, @@ -17760,6 +17769,10 @@ static const struct message WmRestoreMinimizedSeq[] = { WM_SYSKEYUP, sent|optional }, { HCBT_KEYSKIPPED, hook|optional }, { WM_KEYUP, sent|optional }, + { HCBT_KEYSKIPPED, hook|optional }, + { WM_SYSKEYUP, sent|optional }, + { HCBT_KEYSKIPPED, hook|optional }, + { WM_KEYUP, sent|optional }, { WM_PAINT, sent| optional }, { 0 } };