dinput/tests: Add some RacingWheel runtimeclass tests.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-04-22 11:49:10 +02:00 committed by Alexandre Julliard
parent b12c74e435
commit ea30b88a99

View file

@ -5157,6 +5157,7 @@ static void test_windows_gaming_input(void)
};
static const WCHAR *force_feedback_motor = RuntimeClass_Windows_Gaming_Input_ForceFeedback_ForceFeedbackMotor;
static const WCHAR *controller_class_name = RuntimeClass_Windows_Gaming_Input_RawGameController;
static const WCHAR *racing_wheel_class_name = RuntimeClass_Windows_Gaming_Input_RacingWheel;
DIPROPGUIDANDPATH guid_path =
{
@ -5174,17 +5175,22 @@ static void test_windows_gaming_input(void)
EventRegistrationToken controller_added_token;
struct bool_async_handler bool_async_handler;
IVectorView_ForceFeedbackMotor *motors_view;
IVectorView_RacingWheel *racing_wheels_view;
IRacingWheelStatics2 *racing_wheel_statics2;
IRacingWheelStatics *racing_wheel_statics;
ForceFeedbackEffectAxes supported_axes;
IAsyncOperation_boolean *bool_async;
IRawGameController *raw_controller;
IGameController *game_controller;
IDirectInputDevice8W *device;
IForceFeedbackMotor *motor;
IRacingWheel *racing_wheel;
BOOLEAN paused, enabled;
IAsyncInfo *async_info;
DOUBLE gain;
HSTRING str;
HANDLE file;
UINT32 size;
DOUBLE gain;
HRESULT hr;
DWORD ret;
ULONG ref;
@ -5248,6 +5254,34 @@ static void test_windows_gaming_input(void)
ok( hr == S_OK, "GetAt returned %#lx\n", hr );
IVectorView_RawGameController_Release( controllers_view );
hr = pWindowsCreateString( racing_wheel_class_name, wcslen( racing_wheel_class_name ), &str );
ok( hr == S_OK, "WindowsCreateString returned %#lx\n", hr );
hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics, (void **)&racing_wheel_statics );
ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr );
hr = pRoGetActivationFactory( str, &IID_IRacingWheelStatics2, (void **)&racing_wheel_statics2 );
ok( hr == S_OK, "RoGetActivationFactory returned %#lx\n", hr );
pWindowsDeleteString( str );
/* HID driving wheels aren't exposed as WGI gamepads on Windows */
hr = IRacingWheelStatics_get_RacingWheels( racing_wheel_statics, &racing_wheels_view );
ok( hr == S_OK, "get_RacingWheels returned %#lx\n", hr );
hr = IVectorView_RacingWheel_get_Size( racing_wheels_view, &size );
ok( hr == S_OK, "get_Size returned %#lx\n", hr );
todo_wine /* but Wine currently intentionally does */
ok( size == 0, "got size %u\n", size );
IVectorView_RacingWheel_Release( racing_wheels_view );
IRacingWheelStatics_Release( racing_wheel_statics );
hr = IRawGameController_QueryInterface( raw_controller, &IID_IGameController, (void **)&game_controller );
ok( hr == S_OK, "QueryInterface returned %#lx\n", hr );
hr = IRacingWheelStatics2_FromGameController( racing_wheel_statics2, game_controller, &racing_wheel );
ok( hr == S_OK, "FromGameController returned %#lx\n", hr );
todo_wine
ok( racing_wheel == NULL, "got racing_wheel %p\n", racing_wheel );
IGameController_Release( game_controller );
IRacingWheelStatics2_Release( racing_wheel_statics2 );
set_hid_expect( file, expect_acquire, sizeof(expect_acquire) );
hr = IRawGameController_get_ForceFeedbackMotors( raw_controller, &motors_view );
todo_wine