From: Tomasz Pakuła tomasz.pakula.oficjalny@gmail.com
--- dlls/dinput/tests/force_feedback.c | 197 +---------------------------- 1 file changed, 2 insertions(+), 195 deletions(-)
diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index ba459958b62..1deaca10c80 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -3659,200 +3659,7 @@ done: return device != NULL; }
-static void test_condition_effect_six_axes( IDirectInputDevice8W *device, HANDLE file, DWORD version ) -{ - // struct hid_expect expect_create[] = - // { - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* set condition */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 7, - // .report_len = 8, - // .report_buf = {0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - // }, - // /* update effect */ - // { - // .code = IOCTL_HID_WRITE_REPORT, - // .report_id = 3, - // .report_len = 15, - // .report_buf = {0x03,0x01,0x03,0x40,0x01,0x00,0x00,0x00,0x01,0x55,0x00,0x55,0x00,0x55,0x00}, - // }, - // }; - static const DWORD expect_axes[6] = - { - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 0 ) | DIDFT_FFACTUATOR, - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 1 ) | DIDFT_FFACTUATOR, - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 2 ) | DIDFT_FFACTUATOR, - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 3 ) | DIDFT_FFACTUATOR, - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 4 ) | DIDFT_FFACTUATOR, - DIDFT_ABSAXIS | DIDFT_MAKEINSTANCE( 5 ) | DIDFT_FFACTUATOR, - }; - static const LONG expect_directions[6] = { - 3000, - 0, - 3000, - 0, - 3000, - 0, - }; - static const DICONDITION expect_condition[6] = - { - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - { - .lOffset = 0, - .lPositiveCoefficient = 0, - .lNegativeCoefficient = 0, - .dwPositiveSaturation = 0, - .dwNegativeSaturation = 0, - .lDeadBand = 0, - }, - }; - const DIEFFECT expect_desc = - { - .dwSize = version >= 0x700 ? sizeof(DIEFFECT_DX6) : sizeof(DIEFFECT_DX5), - .dwFlags = DIEFF_SPHERICAL | DIEFF_OBJECTIDS, - .dwDuration = 1000, - .dwGain = 3000, - .dwTriggerRepeatInterval = 0, - .cAxes = 2, - .rgdwAxes = (void *)expect_axes, - .rglDirection = (void *)expect_directions, - .cbTypeSpecificParams = sizeof(DICONDITION), - .lpvTypeSpecificParams = (void *)expect_condition, - .dwStartDelay = 0, - }; - struct check_created_effect_params check_params = {0}; - DIENVELOPE envelope = {.dwSize = sizeof(DIENVELOPE)}; - DICONDITION condition[6] = {{0}}; - IDirectInputEffect *effect; - LONG directions[6] = {0}; - DWORD axes[6] = {0}; - DIEFFECT desc = - { - .dwSize = version >= 0x700 ? sizeof(DIEFFECT_DX6) : sizeof(DIEFFECT_DX5), - .dwFlags = DIEFF_SPHERICAL | DIEFF_OBJECTIDS, - .cAxes = 2, - .rgdwAxes = axes, - .rglDirection = directions, - .lpEnvelope = &envelope, - .cbTypeSpecificParams = sizeof(DICONDITION), - .lpvTypeSpecificParams = condition, - }; - HRESULT hr; - ULONG ref; - GUID guid; - - // set_hid_expect( file, expect_create, sizeof(expect_create) ); - hr = IDirectInputDevice8_CreateEffect( device, &GUID_Spring, &expect_desc, &effect, NULL ); - ok( hr == DI_OK, "CreateEffect returned %#lx\n", hr ); - // set_hid_expect( file, NULL, 0 ); - - check_params.expect_effect = effect; - hr = IDirectInputDevice8_EnumCreatedEffectObjects( device, check_created_effect_objects, &check_params, 0 ); - ok( hr == DI_OK, "EnumCreatedEffectObjects returned %#lx\n", hr ); - ok( check_params.count == 1, "got count %lu, expected 1\n", check_params.count ); - - hr = IDirectInputEffect_GetEffectGuid( effect, &guid ); - ok( hr == DI_OK, "GetEffectGuid returned %#lx\n", hr ); - ok( IsEqualGUID( &guid, &GUID_Spring ), "got guid %s, expected %s\n", debugstr_guid( &guid ), - debugstr_guid( &GUID_Spring ) ); - - hr = IDirectInputEffect_GetParameters( effect, &desc, version >= 0x700 ? DIEP_ALLPARAMS : DIEP_ALLPARAMS_DX5 ); - ok( hr == DI_OK, "GetParameters returned %#lx\n", hr ); - check_member( desc, expect_desc, "%lu", cAxes ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[0] ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[1] ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[2] ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[3] ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[4] ); - check_member( desc, expect_desc, "%#lx", rgdwAxes[5] ); - check_member( desc, expect_desc, "%ld", rglDirection[0] ); - check_member( desc, expect_desc, "%ld", rglDirection[1] ); - check_member( desc, expect_desc, "%ld", rglDirection[2] ); - check_member( desc, expect_desc, "%ld", rglDirection[3] ); - check_member( desc, expect_desc, "%ld", rglDirection[4] ); - check_member( desc, expect_desc, "%ld", rglDirection[5] ); - check_member( desc, expect_desc, "%lu", cbTypeSpecificParams ); - - ref = IDirectInputEffect_Release( effect ); - ok( ref == 0, "Release returned %ld\n", ref ); -} - -/* Test if we're getting just one axis in effects */ +/* Test if we're getting effects in six ffb axis controllers */ static BOOL test_force_feedback_six_axes( DWORD version ) { #include "psh_hid_macros.h" @@ -4356,7 +4163,7 @@ static BOOL test_force_feedback_six_axes( DWORD version ) hr = IDirectInputDevice8_Acquire( device ); ok( hr == DI_OK, "Acquire returned: %#lx\n", hr );
- test_condition_effect_six_axes( device, file, version ); + test_condition_effect( device, file, version );
hr = IDirectInputDevice8_Unacquire( device ); ok( hr == DI_OK, "Unacquire returned: %#lx\n", hr );