In some Win10 testbot images (notably jp and cn), we can get a spurious layout change after creating the test window. Detect this and skip the tests since the test expectations (e.g., wchar mappings) are now invalid.
From: Alexandros Frantzis alexandros.frantzis@collabora.com
In some Win10 testbot images (notably jp and cn), we can get a spurious layout change after creating the test window. Detect this and skip the tests since the test expectations (e.g., wchar mappings) are now invalid. --- dlls/user32/tests/input.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 81af2aa5f28..3b337b00687 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -714,7 +714,7 @@ static void get_test_scan( WORD vkey, WORD *scan, WCHAR *wch, WCHAR *wch_shift ) } }
-static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, WCHAR wch_shift, WCHAR wch_control ) +static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, WCHAR wch_shift, WCHAR wch_control, HKL hkl ) { #define WIN_MSG(m, w, l, ...) {.func = MSG_TEST_WIN, .message = {.msg = m, .wparam = w, .lparam = l}, ## __VA_ARGS__} #define KBD_HOOK(m, s, v, f, ...) {.func = LL_HOOK_KEYBD, .ll_hook_kbd = {.msg = m, .scan = s, .vkey = v, .flags = f}, ## __VA_ARGS__} @@ -1163,6 +1163,13 @@ static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, W ok_ne( NULL, hwnd, HWND, "%p" ); wait_messages( 100, FALSE );
+ if (GetKeyboardLayout( 0 ) != hkl) + { + win_skip( "Spurious keyboard layout changed detected (expected: %p got: %p)\n", + hkl, GetKeyboardLayout( 0 ) ); + return; + } + hook = SetWindowsHookExW( WH_KEYBOARD_LL, ll_hook_kbd_proc, GetModuleHandleW( NULL ), 0 ); ok_ne( NULL, hook, HHOOK, "%p" );
@@ -4918,7 +4925,7 @@ static void test_UnregisterDeviceNotification(void) ok(ret == FALSE, "Unregistering NULL Device Notification returned: %d\n", ret); }
-static void test_SendInput( WORD vkey, WCHAR wch ) +static void test_SendInput( WORD vkey, WCHAR wch, HKL hkl ) { const struct user_call broken_sequence[] = { @@ -4936,6 +4943,13 @@ static void test_SendInput( WORD vkey, WCHAR wch ) ok_ne( NULL, hwnd, HWND, "%p" ); wait_messages( 100, FALSE );
+ if (GetKeyboardLayout( 0 ) != hkl) + { + win_skip( "Spurious keyboard layout changed detected (expected: %p got: %p)\n", + hkl, GetKeyboardLayout( 0 ) ); + return; + } + SetLastError( 0xdeadbeef ); ok_ret( 0, SendInput( 0, NULL, 0 ) ); ok_ret( ERROR_INVALID_PARAMETER, GetLastError() ); @@ -5758,8 +5772,8 @@ static void test_input_desktop( char **argv ) test_SetCursorPos();
get_test_scan( 'F', &scan, &wch, &wch_shift ); - test_SendInput( 'F', wch ); - test_SendInput_keyboard_messages( 'F', scan, wch, wch_shift, '\x06' ); + test_SendInput( 'F', wch, hkl ); + test_SendInput_keyboard_messages( 'F', scan, wch, wch_shift, '\x06', hkl ); test_SendInput_mouse_messages();
test_keyboard_ll_hook_blocking();
From: Alexandros Frantzis alexandros.frantzis@collabora.com
The workaround was needed because the zh_CN Win10 testbot image may spuriously change to the ru_RU keyboard layout during testing. We now detect such changes and skip the tests, so the workaround is not needed. --- dlls/user32/tests/input.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 3b337b00687..94ca53cd8c1 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -705,13 +705,6 @@ static void get_test_scan( WORD vkey, WORD *scan, WCHAR *wch, WCHAR *wch_shift ) ok_ret( 1, ToUnicodeEx( vkey, *scan, state, wch, 1, 0, hkl ) ); state[VK_SHIFT] = 0x80; ok_ret( 1, ToUnicodeEx( vkey, *scan, state, wch_shift, 1, 0, hkl ) ); - - /* zh_CN returns a different WM_(SYS)CHAR, possibly coming from IME */ - if (HIWORD(hkl) == 0x0804) - { - *wch = 0x430; - *wch_shift = 0x410; - } }
static void test_SendInput_keyboard_messages( WORD vkey, WORD scan, WCHAR wch, WCHAR wch_shift, WCHAR wch_control, HKL hkl )
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=145579
Your paranoid android.
=== w11pro64 (32 bit report) ===
user32: input.c:4088: Test failed: layered 1: button_down_hwnd_todo 0: got MSG_TEST_WIN hwnd 000D0278, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 input.c:4088: Test failed: layered 1: button_down_hwnd_todo 1 (missing): MSG_TEST_WIN hwnd 000D0278, WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
=== w10pro64_ja (64 bit report) ===
user32: input.c:5728: Test failed: GetKeyboardLayout returned 0000000004090409
=== w10pro64_zh_CN (64 bit report) ===
user32: input.c:3677: Test failed: got pos (50,50) input.c:5728: Test failed: GetKeyboardLayout returned 0000000004090409