Commit e47fcc11 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput8/tests: Add some HID joystick IDirectInputDevice8_GetEffectInfo tests.

parent 5f492b5e
...@@ -3679,6 +3679,7 @@ static void test_simple_joystick(void) ...@@ -3679,6 +3679,7 @@ static void test_simple_joystick(void)
DIDEVICEOBJECTDATA objdata[32] = {{0}}; DIDEVICEOBJECTDATA objdata[32] = {{0}};
DIDEVICEOBJECTINSTANCEW objinst = {0}; DIDEVICEOBJECTINSTANCEW objinst = {0};
DIDEVICEINSTANCEW devinst = {0}; DIDEVICEINSTANCEW devinst = {0};
DIEFFECTINFOW effectinfo = {0};
DIDATAFORMAT dataformat = {0}; DIDATAFORMAT dataformat = {0};
IDirectInputDevice8W *device; IDirectInputDevice8W *device;
DIDEVCAPS caps = {0}; DIDEVCAPS caps = {0};
...@@ -4049,6 +4050,21 @@ static void test_simple_joystick(void) ...@@ -4049,6 +4050,21 @@ static void test_simple_joystick(void)
ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n",
check_effects_params.expect_count - check_effects_params.index ); check_effects_params.expect_count - check_effects_params.index );
hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine );
todo_wine
ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1;
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL );
todo_wine
ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
todo_wine
ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, NULL ); hr = IDirectInputDevice8_SetDataFormat( device, NULL );
ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
...@@ -5416,6 +5432,7 @@ static void test_force_feedback_joystick( void ) ...@@ -5416,6 +5432,7 @@ static void test_force_feedback_joystick( void )
}; };
WCHAR cwd[MAX_PATH], tempdir[MAX_PATH]; WCHAR cwd[MAX_PATH], tempdir[MAX_PATH];
DIDEVICEINSTANCEW devinst = {0}; DIDEVICEINSTANCEW devinst = {0};
DIEFFECTINFOW effectinfo = {0};
IDirectInputDevice8W *device; IDirectInputDevice8W *device;
DIDEVCAPS caps = {0}; DIDEVCAPS caps = {0};
IDirectInput8W *di; IDirectInput8W *di;
...@@ -5514,6 +5531,19 @@ static void test_force_feedback_joystick( void ) ...@@ -5514,6 +5531,19 @@ static void test_force_feedback_joystick( void )
ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n",
check_effects_params.expect_count - check_effects_params.index ); check_effects_params.expect_count - check_effects_params.index );
effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
todo_wine
check_member_guid( effectinfo, expect_effects[0], guid );
check_member( effectinfo, expect_effects[0], "%#x", dwEffType );
todo_wine
check_member( effectinfo, expect_effects[0], "%#x", dwStaticParams );
todo_wine
check_member( effectinfo, expect_effects[0], "%#x", dwDynamicParams );
todo_wine
check_member_wstr( effectinfo, expect_effects[0], tszName );
hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 ); hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 );
ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment