dinput/tests: Remove unrequired pointer checks (Coverity).
Also fixes a few test strings. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4f07e4f014
commit
61a85a6031
|
@ -190,15 +190,15 @@ static BOOL CALLBACK enum_devices(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
|
||||||
trace("Testing device %p \"%s\"\n", device, lpddi->tszInstanceName);
|
trace("Testing device %p \"%s\"\n", device, lpddi->tszInstanceName);
|
||||||
|
|
||||||
hr = IUnknown_QueryInterface(device, &IID_IDirectInputDevice2A, (LPVOID*)&obj);
|
hr = IUnknown_QueryInterface(device, &IID_IDirectInputDevice2A, (LPVOID*)&obj);
|
||||||
ok(SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputDevice7A) failed: %08x\n", hr);
|
ok(SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputDevice2A) failed: %08x\n", hr);
|
||||||
test_object_info(obj, data->hwnd);
|
test_object_info(obj, data->hwnd);
|
||||||
if (obj) IUnknown_Release(obj);
|
IUnknown_Release(obj);
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
|
|
||||||
hr = IUnknown_QueryInterface(device, &IID_IDirectInputDevice2W, (LPVOID*)&obj);
|
hr = IUnknown_QueryInterface(device, &IID_IDirectInputDevice2W, (LPVOID*)&obj);
|
||||||
ok(SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputDevice7W) failed: %08x\n", hr);
|
ok(SUCCEEDED(hr), "IUnknown_QueryInterface(IID_IDirectInputDevice2W) failed: %08x\n", hr);
|
||||||
test_object_info(obj, data->hwnd);
|
test_object_info(obj, data->hwnd);
|
||||||
if (obj) IUnknown_Release(obj);
|
IUnknown_Release(obj);
|
||||||
|
|
||||||
IUnknown_Release(device);
|
IUnknown_Release(device);
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
|
||||||
hr = IDirectInputDevice_Unacquire(pKeyboard);
|
hr = IDirectInputDevice_Unacquire(pKeyboard);
|
||||||
ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr);
|
ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr);
|
||||||
|
|
||||||
if (pKeyboard) IUnknown_Release(pKeyboard);
|
IUnknown_Release(pKeyboard);
|
||||||
|
|
||||||
ActivateKeyboardLayout(hkl_orig, 0);
|
ActivateKeyboardLayout(hkl_orig, 0);
|
||||||
UnloadKeyboardLayout(hkl);
|
UnloadKeyboardLayout(hkl);
|
||||||
|
@ -272,7 +272,7 @@ static void test_get_prop(IDirectInputA *pDI, HWND hwnd)
|
||||||
hr = IDirectInputDevice_GetProperty(pKeyboard, DIPROP_RANGE, &diprg.diph);
|
hr = IDirectInputDevice_GetProperty(pKeyboard, DIPROP_RANGE, &diprg.diph);
|
||||||
ok(hr == DIERR_UNSUPPORTED, "IDirectInputDevice_GetProperty() did not return DIPROP_RANGE but: %08x\n", hr);
|
ok(hr == DIERR_UNSUPPORTED, "IDirectInputDevice_GetProperty() did not return DIPROP_RANGE but: %08x\n", hr);
|
||||||
|
|
||||||
if (pKeyboard) IUnknown_Release(pKeyboard);
|
IUnknown_Release(pKeyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
|
static void test_capabilities(IDirectInputA *pDI, HWND hwnd)
|
||||||
|
|
|
@ -198,7 +198,7 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
|
||||||
/* Granularity of Y axis should be 1! */
|
/* Granularity of Y axis should be 1! */
|
||||||
ok(hr == S_OK && di_op.dwData == 1, "GetProperty(): %08x, dwData: %i but should be 1.\n", hr, di_op.dwData);
|
ok(hr == S_OK && di_op.dwData == 1, "GetProperty(): %08x, dwData: %i but should be 1.\n", hr, di_op.dwData);
|
||||||
|
|
||||||
if (pMouse) IUnknown_Release(pMouse);
|
IUnknown_Release(pMouse);
|
||||||
|
|
||||||
DestroyWindow( hwnd2 );
|
DestroyWindow( hwnd2 );
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ static void test_mouse_EnumObjects(IDirectInputA *pDI)
|
||||||
hr = IDirectInputDevice_EnumObjects(pMouse, EnumAxes, NULL, DIDFT_ALL);
|
hr = IDirectInputDevice_EnumObjects(pMouse, EnumAxes, NULL, DIDFT_ALL);
|
||||||
ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %08x\n", hr);
|
ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %08x\n", hr);
|
||||||
|
|
||||||
if (pMouse) IUnknown_Release(pMouse);
|
IUnknown_Release(pMouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_tests(void)
|
static void mouse_tests(void)
|
||||||
|
|
Loading…
Reference in New Issue