Dmitry Timoshkov : user32: Add a test to make sure that SendInput sets a non-zero event time.

Alexandre Julliard julliard at winehq.org
Fri Mar 4 09:39:36 CST 2011


Module: wine
Branch: master
Commit: 7fb4e2ae45cff5ce72260c60587c6473e8bbfdf2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7fb4e2ae45cff5ce72260c60587c6473e8bbfdf2

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Fri Mar  4 14:43:31 2011 +0800

user32: Add a test to make sure that SendInput sets a non-zero event time.

---

 dlls/user32/tests/input.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 22120f0..d45edf1 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -369,6 +369,16 @@ static void test_Input_whitebox(void)
     DestroyWindow(hWndTest);
 }
 
+static inline BOOL is_keyboard_message( UINT message )
+{
+    return (message >= WM_KEYFIRST && message <= WM_KEYLAST);
+}
+
+static inline BOOL is_mouse_message( UINT message )
+{
+    return (message >= WM_MOUSEFIRST && message <= WM_MOUSELAST);
+}
+
 /* try to make sure pending X events have been processed before continuing */
 static void empty_message_queue(void)
 {
@@ -382,6 +392,9 @@ static void empty_message_queue(void)
         if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT) break;
         while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
         {
+            if (is_keyboard_message(msg.message) || is_mouse_message(msg.message))
+                ok(msg.time != 0, "message %#x has time set to 0\n", msg.message);
+
             TranslateMessage(&msg);
             DispatchMessage(&msg);
         }




More information about the wine-cvs mailing list