[PATCH 08/12] user32/tests: Make the test_PeekMessage3 timer fire less often.

Rémi Bernon rbernon at codeweavers.com
Tue Nov 12 14:42:01 CST 2019


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 at 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);
-- 
2.24.0.rc2




More information about the wine-devel mailing list