Alex Henrie : user32/tests: Recognize undefined characters in OemKeyScan tests.

Alexandre Julliard julliard at winehq.org
Fri Dec 29 13:46:14 CST 2017


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

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu Dec 28 23:46:57 2017 -0700

user32/tests: Recognize undefined characters in OemKeyScan tests.

This reverts commit 72ab2d5b078d0ebad70a0baed29a80ce6b6c86ad.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/Makefile.in |  2 +-
 dlls/user32/tests/input.c     | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in
index c71cbe2..7149dc8 100644
--- a/dlls/user32/tests/Makefile.in
+++ b/dlls/user32/tests/Makefile.in
@@ -1,5 +1,5 @@
 TESTDLL   = user32.dll
-IMPORTS   = user32 gdi32 advapi32 imm32
+IMPORTS   = user32 gdi32 advapi32
 
 C_SRCS = \
 	broadcast.c \
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index a15a644..030592b 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -54,7 +54,6 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "winnls.h"
-#include "imm.h"
 
 #include "wine/test.h"
 
@@ -2516,23 +2515,23 @@ static void test_OemKeyScan(void)
     DWORD ret, expect, vkey, scan;
     WCHAR oem, wchr;
     char oem_char;
-    BOOL ime = ImmIsIME(GetKeyboardLayout(0));
 
     for (oem = 0; oem < 0x200; oem++)
     {
         ret = OemKeyScan( oem );
 
         oem_char = LOBYTE( oem );
-        if (!OemToCharBuffW( &oem_char, &wchr, 1 ))
+        /* OemKeyScan returns -1 for any character that cannot be mapped,
+         * whereas OemToCharBuff changes unmappable characters to question
+         * marks. The ASCII characters 0-127, including the real question mark
+         * character, are all mappable and are the same in all OEM codepages. */
+        if (!OemToCharBuffW( &oem_char, &wchr, 1 ) || (wchr == '?' && oem_char < 0))
             expect = -1;
         else
         {
             vkey = VkKeyScanW( wchr );
             scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
-            /* OemKeyScan returns -1 for any character that has to go through
-             * the IME, whereas VkKeyScan returns the virtual key code for the
-             * question mark key */
-            if (!scan || (ime && wchr != '?' && vkey == VkKeyScanW( '?' )))
+            if (!scan)
                 expect = -1;
             else
             {




More information about the wine-cvs mailing list