https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4b924a8685c8ce9005797b85b7aaa3998b3d472c

commit 4b924a8685c8ce9005797b85b7aaa3998b3d472c
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Fri Jan 18 12:11:53 2019 +0900
Commit:     GitHub <[email protected]>
CommitDate: Fri Jan 18 12:11:53 2019 +0900

    [USER32_APITEST] Improve GetMessageTime tests more (#1254)
    
    Compare GetMessageTime and GetTickCount values.
    CORE-15565
---
 modules/rostests/apitests/user32/GetMessageTime.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/modules/rostests/apitests/user32/GetMessageTime.c 
b/modules/rostests/apitests/user32/GetMessageTime.c
index 76a1aff415..de41755a37 100644
--- a/modules/rostests/apitests/user32/GetMessageTime.c
+++ b/modules/rostests/apitests/user32/GetMessageTime.c
@@ -1,7 +1,7 @@
 /*
  * PROJECT:         ReactOS api tests
  * LICENSE:         GPL - See COPYING in the top level directory
- * PURPOSE:         Test for GetMessageTime
+ * PURPOSE:         Test for GetMessageTime and GetTickCount
  * PROGRAMMERS:     Katayama Hirofumi MZ <[email protected]>
  */
 #include "precomp.h"
@@ -46,7 +46,9 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
             if (s_nCount != 0)
             {
                 ok(GetMessageTime() - s_nMsgTime >= TIMER_INTERVAL / 2,
-                   "message time is wrong\n");
+                   "GetMessageTime() is wrong, compared to previous one\n");
+                ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 
2,
+                   "GetMessageTime() is wrong, compared to GetTickCount()\n");
             }
             s_nMsgTime = GetMessageTime();
             ok(s_nMsgTime != 0, "message time was zero.\n");
@@ -65,19 +67,28 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM 
lParam)
         case WM_MOUSEMOVE:
             trace("WM_MOUSEMOVE\n");
             ok_int(s_nCount, 5);
-            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time 
is wrong.\n");
+            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL,
+               "GetMessageTime() is wrong, compared to previous one\n");
+            ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2,
+               "GetMessageTime() is wrong, compared to GetTickCount()\n");
             s_bReach_WM_MOUSEMOVE = TRUE;
             break;
         case WM_LBUTTONDOWN:
             trace("WM_LBUTTONDOWN\n");
             ok_int(s_nCount, 5);
-            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time 
is wrong.\n");
+            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL,
+               "GetMessageTime() is wrong, compared to previous one\n");
+            ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2,
+               "GetMessageTime() is wrong, compared to GetTickCount()\n");
             s_bReach_WM_LBUTTONDOWN = TRUE;
             break;
         case WM_LBUTTONUP:
             trace("WM_LBUTTONUP\n");
             ok_int(s_nCount, 5);
-            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time 
is wrong.\n");
+            ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL,
+               "GetMessageTime() is wrong, compared to previous one\n");
+            ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2,
+               "GetMessageTime() is wrong, compared to GetTickCount()\n");
             s_bReach_WM_LBUTTONUP = TRUE;
             break;
         case WM_DESTROY:

Reply via email to