[USER32_APITEST]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 18 Jun 2015 13:59:51 +0000 (13:59 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 18 Jun 2015 13:59:51 +0000 (13:59 +0000)
- Fail if we get too many WM_HOTKEY messages
CORE-9728

svn path=/trunk/; revision=68188

rostests/apitests/user32/RegisterHotKey.c

index e8f0edc..60ca156 100644 (file)
 #define expect_hotkey(id, mod, vk) do                                                               \
     {                                                                                               \
         MSG msg;                                                                                    \
-        BOOL got_hotkey = FALSE;                                                                    \
+        int hotkey_count = 0;                                                                       \
         while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))                                               \
         {                                                                                           \
             msg_hotkey(&msg, id, mod, vk);                                                          \
-            if (msg.message == WM_HOTKEY) got_hotkey = TRUE;                                        \
+            if (msg.message == WM_HOTKEY) hotkey_count++;                                           \
             DispatchMessageW(&msg);                                                                 \
         }                                                                                           \
-        ok(got_hotkey, "Did not receive expected WM_HOTKEY message\n");                             \
+        ok(hotkey_count == 1, "Received %d WM_HOTKEY messages, expected 1\n");                      \
     } while (0)
 #define msg_no_hotkey(msg) do                                                                       \
     {                                                                                               \