Module: wine Branch: master Commit: e47fcc112fe31d9edbfb00b7bc2d93a61d836cba URL: https://source.winehq.org/git/wine.git/?a=commit;h=e47fcc112fe31d9edbfb00b7b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Sep 30 10:37:34 2021 +0200
dinput8/tests: Add some HID joystick IDirectInputDevice8_GetEffectInfo tests.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dinput8/tests/hid.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index cf47216cd9e..149790f1484 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3679,6 +3679,7 @@ static void test_simple_joystick(void) DIDEVICEOBJECTDATA objdata[32] = {{0}}; DIDEVICEOBJECTINSTANCEW objinst = {0}; DIDEVICEINSTANCEW devinst = {0}; + DIEFFECTINFOW effectinfo = {0}; DIDATAFORMAT dataformat = {0}; IDirectInputDevice8W *device; DIDEVCAPS caps = {0}; @@ -4049,6 +4050,21 @@ static void test_simple_joystick(void) ok( check_effects_params.index >= check_effects_params.expect_count, "missing %u effects\n", 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 ); ok( hr == E_POINTER, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); @@ -5416,6 +5432,7 @@ static void test_force_feedback_joystick( void ) }; WCHAR cwd[MAX_PATH], tempdir[MAX_PATH]; DIDEVICEINSTANCEW devinst = {0}; + DIEFFECTINFOW effectinfo = {0}; IDirectInputDevice8W *device; DIDEVCAPS caps = {0}; IDirectInput8W *di; @@ -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", 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 ); ok( hr == DI_OK, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );