I'm not 100% sure all of them are the same thing, and I can only reproduce one failure locally, but I suspect they might. In any case if the foreground window is wrong it's simply not going to work.
-- v2: dinput/tests: Mark some tests as flaky to workaround fvwm bug.
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54594 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54713 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54774 --- dlls/dinput/tests/device8.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index a649fe53b41..523c2506a39 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -395,11 +395,13 @@ void test_overlapped_format( DWORD version ) /* press D */ keybd_event( 0, DIK_D, KEYEVENTF_SCANCODE, 0 ); res = WaitForSingleObject( event, 5000 ); + flaky_wine_if( GetForegroundWindow() != hwnd && version == 0x800 ) /* FIXME: fvwm sometimes steals input focus */ ok( res == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx\n", res );
count = 10; hr = IDirectInputDevice_GetDeviceData( keyboard, data_size, NULL, &count, 0 ); ok( hr == DI_OK, "GetDeviceData returned %#lx\n", hr ); + flaky_wine_if( GetForegroundWindow() != hwnd && version == 0x800 ) /* FIXME: fvwm sometimes steals input focus */ ok( count == 1, "got count %lu\n", count );
memset( &state, 0xFF, sizeof(state) ); @@ -415,11 +417,13 @@ void test_overlapped_format( DWORD version ) /* release D */ keybd_event( 0, DIK_D, KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP, 0 ); res = WaitForSingleObject( event, 5000 ); + flaky_wine_if( GetForegroundWindow() != hwnd && version == 0x800 ) /* FIXME: fvwm sometimes steals input focus */ ok( res == WAIT_OBJECT_0, "WaitForSingleObject returned %#lx\n", res );
count = 10; hr = IDirectInputDevice_GetDeviceData( keyboard, data_size, NULL, &count, 0 ); ok( hr == DI_OK, "GetDeviceData returned %#lx\n", hr ); + flaky_wine_if( GetForegroundWindow() != hwnd && version == 0x800 ) /* FIXME: fvwm sometimes steals input focus */ ok( count == 1, "got count %lu\n", count );
@@ -682,14 +686,19 @@ static void test_mouse_keyboard(void) IDirectInputDevice8_SetCooperativeLevel(di_keyboard, hwnd, DISCL_FOREGROUND|DISCL_EXCLUSIVE);
hr = IDirectInputDevice8_Acquire(di_keyboard); + flaky_wine_if( GetForegroundWindow() != hwnd ) /* FIXME: fvwm sometimes steals input focus */ ok(SUCCEEDED(hr), "IDirectInputDevice8_Acquire failed: %#lx\n", hr); hr = IDirectInputDevice8_Acquire(di_mouse); + flaky_wine_if( GetForegroundWindow() != hwnd ) /* FIXME: fvwm sometimes steals input focus */ ok(SUCCEEDED(hr), "IDirectInputDevice8_Acquire failed: %#lx\n", hr); raw_devices_count = ARRAY_SIZE(raw_devices); memset(raw_devices, 0, sizeof(raw_devices)); hr = GetRegisteredRawInputDevices(raw_devices, &raw_devices_count, sizeof(RAWINPUTDEVICE)); + flaky_wine_if( GetForegroundWindow() != hwnd ) /* FIXME: fvwm sometimes steals input focus */ ok(hr == 3, "GetRegisteredRawInputDevices returned %ld, raw_devices_count: %d\n", hr, raw_devices_count); + flaky_wine_if( GetForegroundWindow() != hwnd ) /* FIXME: fvwm sometimes steals input focus */ ok(raw_devices[0].dwFlags == (RIDEV_CAPTUREMOUSE|RIDEV_NOLEGACY), "Unexpected raw device flags: %#lx\n", raw_devices[0].dwFlags); + flaky_wine_if( GetForegroundWindow() != hwnd ) /* FIXME: fvwm sometimes steals input focus */ ok(raw_devices[2].dwFlags == (RIDEV_NOHOTKEYS|RIDEV_NOLEGACY), "Unexpected raw device flags: %#lx\n", raw_devices[1].dwFlags); hr = IDirectInputDevice8_Unacquire(di_keyboard); ok(SUCCEEDED(hr), "IDirectInputDevice8_Acquire failed: %#lx\n", hr); @@ -1581,7 +1590,7 @@ cleanup: localized = old_localized; }
-static void test_dik_codes( IDirectInputDevice8W *device, HANDLE event, HWND hwnd ) +static void test_dik_codes( IDirectInputDevice8W *device, HANDLE event, HWND hwnd, DWORD version ) { static const struct key2dik { @@ -1685,6 +1694,7 @@ static void test_dik_codes( IDirectInputDevice8W *device, HANDLE event, HWND hwn
keybd_event( vkey, scan, KEYEVENTF_KEYUP, 0 ); res = WaitForSingleObject( event, 5000 ); + flaky_wine_if( GetForegroundWindow() != hwnd && version == 0x800 ) /* FIXME: fvwm sometimes steals input focus */ ok( !res, "WaitForSingleObject returned %#lx\n", res );
winetest_pop_context(); @@ -2190,7 +2200,7 @@ skip_key_tests: ActivateKeyboardLayout( old_hkl, 0 ); UnloadKeyboardLayout( hkl );
- test_dik_codes( device, event, hwnd ); + test_dik_codes( device, event, hwnd, version );
CloseHandle( event ); DestroyWindow( hwnd );
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=131544
Your paranoid android.
=== debian11 (32 bit he:IL report) ===
dinput: device8.c:373: Test failed: 0x800: Acquire returned 0x80070005, skipping test_overlapped_format