Commit f00b59f5 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

dinput/tests: Test IDirectInputEffect::SetParameters() with NULL effect parameters.

parent 2d0e113d
...@@ -598,11 +598,34 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) ...@@ -598,11 +598,34 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
{ {
DWORD effect_status; DWORD effect_status;
struct DIPROPDWORD diprop_word; struct DIPROPDWORD diprop_word;
void *tmp;
GUID guid = {0}; GUID guid = {0};
hr = IDirectInputEffect_Initialize(effect, hInstance, data->version, hr = IDirectInputEffect_Initialize(effect, hInstance, data->version,
&effect_data.guid); &effect_data.guid);
ok(hr==DI_OK,"IDirectInputEffect_Initialize failed: %08x\n", hr); ok(hr==DI_OK,"IDirectInputEffect_Initialize failed: %08x\n", hr);
/* Test SetParameters with NULL pointers */
todo_wine {
tmp = effect_data.eff.rgdwAxes;
effect_data.eff.rgdwAxes = NULL;
hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_AXES);
ok(hr==DIERR_INVALIDPARAM,"IDirectInputEffect_SetParameters should fail with INVALIDPARAM, got: %08x\n", hr);
effect_data.eff.rgdwAxes = tmp;
tmp = effect_data.eff.rglDirection;
effect_data.eff.rglDirection = NULL;
hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_DIRECTION);
ok(hr==DIERR_INVALIDPARAM,"IDirectInputEffect_SetParameters should fail with INVALIDPARAM, got: %08x\n", hr);
effect_data.eff.rglDirection = tmp;
tmp = effect_data.eff.lpvTypeSpecificParams;
effect_data.eff.lpvTypeSpecificParams = NULL;
hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_TYPESPECIFICPARAMS);
ok(hr==DIERR_INVALIDPARAM,"IDirectInputEffect_SetParameters should fail with INVALIDPARAM, got: %08x\n", hr);
effect_data.eff.lpvTypeSpecificParams = tmp;
}
hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_AXES | DIEP_DIRECTION | hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_AXES | DIEP_DIRECTION |
DIEP_TYPESPECIFICPARAMS); DIEP_TYPESPECIFICPARAMS);
ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr); ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\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