Commit 7d0ee987 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Alexandre Julliard

dinput: Add test to show that effects are stopped after Unacquire + Acquire and…

dinput: Add test to show that effects are stopped after Unacquire + Acquire and preserved in dinput.
parent 41be1096
......@@ -373,6 +373,8 @@ static BOOL CALLBACK EnumJoysticks(
if (effect)
{
DWORD effect_status;
hr = IDirectInputEffect_Initialize(effect, hInstance, data->version,
&GUID_ConstantForce);
ok(hr==DI_OK,"IDirectInputEffect_Initialize failed: %08x\n", hr);
......@@ -389,6 +391,44 @@ static BOOL CALLBACK EnumJoysticks(
hr = IDirectInputEffect_SetParameters(effect, &eff, DIEP_GAIN);
ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
}
/* Check effect status.
* State: initialy stopped
* start
* State: started
* unacquire, acquire, download
* State: stopped
* start
* State: started
*
* Shows that:
* - effects are stopped after Unacquire + Acquire
* - effects are preserved (Download + Start doesn't complain
* about incomplete effect)
*/
hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);
ok(effect_status==0,"IDirectInputEffect_GetEffectStatus() reported effect as started\n");
hr = IDirectInputEffect_SetParameters(effect, &eff, DIEP_START);
ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);
todo_wine ok(effect_status!=0,"IDirectInputEffect_GetEffectStatus() reported effect as stopped\n");
hr = IDirectInputDevice_Unacquire(pJoystick);
ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %08x\n", hr);
hr = IDirectInputDevice_Acquire(pJoystick);
ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %08x\n", hr);
hr = IDirectInputEffect_Download(effect);
ok(hr==DI_OK,"IDirectInputEffect_Download() failed: %08x\n", hr);
hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);
ok(effect_status==0,"IDirectInputEffect_GetEffectStatus() reported effect as started\n");
hr = IDirectInputEffect_Start(effect, 1, 0);
ok(hr==DI_OK,"IDirectInputEffect_Start() failed: %08x\n", hr);
hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);
todo_wine ok(effect_status!=0,"IDirectInputEffect_GetEffectStatus() reported effect as stopped\n");
ref = IUnknown_Release(effect);
ok(ref == 0, "IDirectInputDevice_Release() reference count = %d\n", ref);
}
......
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