Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51478 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55327 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55328
-- v2: user32/tests: Avoid calling UnloadKeyboardLayout. dinput/tests: Avoid calling UnloadKeyboardLayout. user32/tests: Skip some keyboard layout tests on broken VMs. user32/tests: Dynamically resize the keyboard layout preload list.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 6a28bd24301..8619cfe30ee 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -3379,7 +3379,7 @@ static void test_keyboard_layout_name(void) len = GetKeyboardLayoutList(len, layouts); ok(len > 0, "GetKeyboardLayoutList returned %d\n", len);
- layouts_preload = calloc(len, sizeof(HKL)); + layouts_preload = calloc(1, sizeof(HKL)); ok(layouts_preload != NULL, "Could not allocate memory\n");
if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Keyboard Layout\Preload", &hkey )) @@ -3388,24 +3388,26 @@ static void test_keyboard_layout_name(void) type = REG_SZ; klid_size = sizeof(klid); value_size = ARRAY_SIZE(value); - while (i < len && !RegEnumValueW( hkey, i++, value, &value_size, NULL, &type, (void *)&klid, &klid_size )) + while (!RegEnumValueW( hkey, i++, value, &value_size, NULL, &type, (void *)&klid, &klid_size )) { klid_size = sizeof(klid); value_size = ARRAY_SIZE(value); + layouts_preload = realloc( layouts_preload, (i + 1) * sizeof(*layouts_preload) ); + ok(layouts_preload != NULL, "Could not allocate memory\n"); layouts_preload[i - 1] = UlongToHandle( wcstoul( klid, NULL, 16 ) ); + layouts_preload[i] = 0;
id = (DWORD_PTR)layouts_preload[i - 1]; if (id & 0x80000000) todo_wine_if(HIWORD(id) == 0xe001) ok((id & 0xf0000000) == 0xd0000000, "Unexpected preloaded keyboard layout high bits %#lx\n", id); else ok(!(id & 0xf0000000), "Unexpected preloaded keyboard layout high bits %#lx\n", id); }
- ok(i <= len, "Unexpected keyboard count %d in preload list\n", i); RegCloseKey( hkey ); }
if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Keyboard Layout\Substitutes", &hkey )) { - for (i = 0; i < len && layouts_preload[i]; ++i) + for (i = 0; layouts_preload[i]; ++i) { type = REG_SZ; klid_size = sizeof(klid); @@ -3447,7 +3449,7 @@ static void test_keyboard_layout_name(void)
GetKeyboardLayoutNameW(klid);
- for (j = 0; j < len; ++j) + for (j = 0; layouts_preload[j]; ++j) { swprintf( tmpklid, KL_NAMELENGTH, L"%08X", layouts_preload[j] ); if (!wcscmp( tmpklid, klid )) break;
From: Rémi Bernon rbernon@codeweavers.com
This seems to later mess up with the preload keyboard list and GetKeyboardLayoutNameW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51478 --- dlls/dinput/tests/device8.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index 1d53d35a93b..5d4c2bb4366 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -1707,7 +1707,6 @@ static void test_dik_codes( IDirectInputDevice8W *device, HANDLE event, HWND hwn
skip_key_tests: ActivateKeyboardLayout( old_hkl, 0 ); - UnloadKeyboardLayout( hkl );
winetest_pop_context(); } @@ -2253,7 +2252,6 @@ static void test_sys_keyboard( DWORD version )
skip_key_tests: ActivateKeyboardLayout( old_hkl, 0 ); - UnloadKeyboardLayout( hkl );
test_dik_codes( device, event, hwnd, version );
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55327 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55328 --- dlls/user32/tests/input.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 8619cfe30ee..f92b839f1cb 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -3369,6 +3369,16 @@ static void test_keyboard_layout_name(void) ok(GetLastError() == ERROR_NOACCESS, "got %ld\n", GetLastError());
layout = GetKeyboardLayout(0); + if (broken( layout == (HKL)0x040a0c0a )) + { + /* The testbot w7u_es has a broken layout configuration, its active layout is 040a:0c0a, + * with 0c0a its user locale and 040a its layout langid. Its layout preload list contains + * a 00000c0a layout but the system layouts OTOH only contains the standard 0000040a layout. + * Later, after activating 0409:0409 layout, GetKeyboardLayoutNameW returns 00000c0a. + */ + win_skip( "broken keyboard layout, skipping tests\n" ); + return; + }
len = GetKeyboardLayoutList(0, NULL); ok(len > 0, "GetKeyboardLayoutList returned %d\n", len); @@ -3549,6 +3559,13 @@ static void test_ActivateKeyboardLayout( char **argv ) DWORD ret;
layout = GetKeyboardLayout( 0 ); + if (broken( layout == (HKL)0x040a0c0a )) + { + /* The testbot w7u_es has a broken layout configuration, see test_keyboard_layout_name above. */ + win_skip( "broken keyboard layout, skipping tests\n" ); + return; + } + count = GetKeyboardLayoutList( 0, NULL ); ok( count > 0, "GetKeyboardLayoutList returned %d\n", count ); layouts = malloc( count * sizeof(HKL) );
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51478 --- dlls/user32/tests/msg.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 0059afcbac7..bb7b74558c4 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16535,7 +16535,6 @@ static void test_unicode_wm_char(void)
DestroyWindow( hwnd ); ActivateKeyboardLayout( hkl_orig, 0 ); - UnloadKeyboardLayout( hkl_greek ); }
#define ID_LISTBOX 0x000f
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=141348
Your paranoid android.
=== w864 (32 bit report) ===
Report validation errors: user32:input has unaccounted for failure messages The report seems to have been truncated
Added a change to load the full preload list, as it's not always in sync with `GetKeyboardLayouts`.