Alexandre Julliard : user32/tests: Skip more input tests if we can' t queue keyboard input.

Alexandre Julliard julliard at winehq.org
Tue Feb 24 10:21:30 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Feb 24 14:57:51 2009 +0100

user32/tests: Skip more input tests if we can't queue keyboard input.

Fix some tests on Win9x.

---

 dlls/user32/tests/input.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 0d58189..889244f 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -236,11 +236,11 @@ static BOOL do_test( HWND hwnd, int seqnr, const KEV td[] )
                   MSGNAME[msg.message - WM_KEYFIRST], msg.wParam, msg.lParam, msg.time);
         if( i < kmctr ) {
             ok( msg.message == expmsg[i].message &&
-                    msg.wParam == expmsg[i].wParam &&
-                    msg.lParam == expmsg[i].lParam,
-                    "%u/%u: wrong message %x expected %s wParam %04lx lParam %08lx\n",
-                    seqnr, i, msg.message, MSGNAME[(expmsg[i]).message - WM_KEYFIRST],
-                    expmsg[i].wParam, expmsg[i].lParam );
+                msg.wParam == expmsg[i].wParam &&
+                msg.lParam == expmsg[i].lParam,
+                "%u/%u: wrong message %x/%08lx/%08lx expected %s/%08lx/%08lx\n",
+                seqnr, i, msg.message, msg.wParam, msg.lParam,
+                MSGNAME[(expmsg[i]).message - WM_KEYFIRST], expmsg[i].wParam, expmsg[i].lParam );
         }
         i++;
     }
@@ -578,6 +578,7 @@ struct sendinput_test_s {
         {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {VK_CONTROL, 0x81, 1}, {VK_LCONTROL, 0x80, 1}, {0}},
         {{WM_KEYUP, hook|wparam|optional, VK_LCONTROL},
         {WM_KEYUP, hook|wparam, VK_RMENU},
+        {WM_SYSKEYUP, wparam|lparam|optional, VK_CONTROL, KF_UP},
         {WM_SYSKEYUP, wparam|lparam, VK_MENU, KF_UP},
         {WM_SYSCOMMAND}, {0}}},
     /* LMENU | KEYEVENTF_EXTENDEDKEY == RMENU */
@@ -602,6 +603,7 @@ struct sendinput_test_s {
         {{VK_MENU, 0x80}, {VK_RMENU, 0x80}, {VK_CONTROL, 0x81, 1}, {VK_LCONTROL, 0x80, 1}, {0}},
         {{WM_KEYUP, hook|wparam|lparam|optional, VK_LCONTROL, LLKHF_UP},
         {WM_KEYUP, hook|wparam|lparam, VK_RMENU, LLKHF_UP|LLKHF_EXTENDED},
+        {WM_SYSKEYUP, wparam|lparam|optional, VK_CONTROL, KF_UP},
         {WM_SYSKEYUP, wparam|lparam, VK_MENU, KF_UP|KF_EXTENDED},
         {WM_SYSCOMMAND}, {0}}},
     /* MENU == LMENU */
@@ -800,6 +802,7 @@ static LRESULT CALLBACK WndProc2(HWND hWnd, UINT Msg, WPARAM wParam,
         Msg != WM_NCHITTEST &&
         Msg != WM_GETTEXT &&
         Msg != WM_GETICON &&
+        Msg != WM_IME_SELECT &&
         Msg != WM_DEVICECHANGE)
     {
         ok(sent_messages_cnt < MAXKEYMESSAGES, "Too many messages\n");
@@ -882,6 +885,11 @@ static void test_Input_blackbox(void)
         pSendInput(1, (INPUT*)&i, sizeof(TEST_INPUT));
         empty_message_queue();
         GetKeyboardState(ks2);
+        if (!ii && !sent_messages_cnt && !memcmp( ks1, ks2, sizeof(ks1) ))
+        {
+            win_skip( "window doesn't receive the queued input\n" );
+            break;
+        }
         compare_and_check(ii, ks1, ks2, &sendinput_test[ii]);
     }
 
@@ -1180,7 +1188,8 @@ static void test_key_map(void)
     s  = MapVirtualKeyEx(VK_SHIFT,  MAPVK_VK_TO_VSC, kl);
     ok(s != 0, "MapVirtualKeyEx(VK_SHIFT) should return non-zero\n");
     sL = MapVirtualKeyEx(VK_LSHIFT, MAPVK_VK_TO_VSC, kl);
-    ok(s == sL, "%x != %x\n", s, sL);
+    ok(s == sL || broken(sL == 0), /* win9x */
+       "%x != %x\n", s, sL);
 
     kL = MapVirtualKeyEx(0x2a, MAPVK_VSC_TO_VK, kl);
     ok(kL == VK_SHIFT, "Scan code -> vKey = %x (not VK_SHIFT)\n", kL);
@@ -1188,9 +1197,11 @@ static void test_key_map(void)
     ok(kR == VK_SHIFT, "Scan code -> vKey = %x (not VK_SHIFT)\n", kR);
 
     kL = MapVirtualKeyEx(0x2a, MAPVK_VSC_TO_VK_EX, kl);
-    ok(kL == VK_LSHIFT, "Scan code -> vKey = %x (not VK_LSHIFT)\n", kL);
+    ok(kL == VK_LSHIFT || broken(kL == 0), /* win9x */
+       "Scan code -> vKey = %x (not VK_LSHIFT)\n", kL);
     kR = MapVirtualKeyEx(0x36, MAPVK_VSC_TO_VK_EX, kl);
-    ok(kR == VK_RSHIFT, "Scan code -> vKey = %x (not VK_RSHIFT)\n", kR);
+    ok(kR == VK_RSHIFT || broken(kR == 0), /* win9x */
+       "Scan code -> vKey = %x (not VK_RSHIFT)\n", kR);
 
     /* test that MAPVK_VSC_TO_VK prefers the non-numpad vkey if there's ambiguity */
     for (i = 0; i < sizeof(numpad_collisions)/sizeof(numpad_collisions[0]); i++)




More information about the wine-cvs mailing list