dinput8/tests: Test effect creation with unacquired device.

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 2021-11-15 11:14:05 +01:00 committed by Alexandre Julliard
parent dab7d15c74
commit 979b19ce73
1 changed files with 16 additions and 1 deletions

View File

@ -5696,7 +5696,8 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
hr = IDirectInputDevice8_Unacquire( device );
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION | DIEP_NODOWNLOAD );
hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION );
todo_wine
ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Acquire( device );
@ -6147,6 +6148,20 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
ok( ref == 0, "Release returned %d\n", ref );
winetest_pop_context();
}
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Unacquire( device );
ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
hr = IDirectInputDevice8_CreateEffect( device, &GUID_Sine, &expect_desc, &effect, NULL );
todo_wine
ok( hr == DI_OK, "CreateEffect returned %#x\n", hr );
ref = IDirectInputEffect_Release( effect );
ok( ref == 0, "Release returned %d\n", ref );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Acquire( device );
ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
}
static void test_condition_effect( IDirectInputDevice8W *device, HANDLE file, DWORD version )