[PATCH] dinput/tests: Remove unrequired pointer checks (Coverity)
Also fixes a few test strings. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/dinput/tests/device.c | 8 ++++---- dlls/dinput/tests/keyboard.c | 4 ++-- dlls/dinput/tests/mouse.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/tests/device.c b/dlls/dinput/tests/device.c index fa9b6f1436..a2a5a65686 100644 --- a/dlls/dinput/tests/device.c +++ b/dlls/dinput/tests/device.c @@ -190,15 +190,15 @@ static BOOL CALLBACK enum_devices(const DIDEVICEINSTANCEA *lpddi, void *pvRef) trace("Testing device %p \"%s\"\n", device, lpddi->tszInstanceName); 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); - if (obj) IUnknown_Release(obj); + IUnknown_Release(obj); obj = NULL; 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); - if (obj) IUnknown_Release(obj); + IUnknown_Release(obj); IUnknown_Release(device); } diff --git a/dlls/dinput/tests/keyboard.c b/dlls/dinput/tests/keyboard.c index 0e399f021c..84e6fed078 100644 --- a/dlls/dinput/tests/keyboard.c +++ b/dlls/dinput/tests/keyboard.c @@ -182,7 +182,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) hr = IDirectInputDevice_Unacquire(pKeyboard); ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr); - if (pKeyboard) IUnknown_Release(pKeyboard); + IUnknown_Release(pKeyboard); ActivateKeyboardLayout(hkl_orig, 0); UnloadKeyboardLayout(hkl); @@ -272,7 +272,7 @@ static void test_get_prop(IDirectInputA *pDI, HWND hwnd) hr = IDirectInputDevice_GetProperty(pKeyboard, DIPROP_RANGE, &diprg.diph); 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) diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c index 11da951d10..19d1c3708b 100644 --- a/dlls/dinput/tests/mouse.c +++ b/dlls/dinput/tests/mouse.c @@ -198,7 +198,7 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd) /* 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); - if (pMouse) IUnknown_Release(pMouse); + IUnknown_Release(pMouse); DestroyWindow( hwnd2 ); } @@ -259,7 +259,7 @@ static void test_mouse_EnumObjects(IDirectInputA *pDI) hr = IDirectInputDevice_EnumObjects(pMouse, EnumAxes, NULL, DIDFT_ALL); ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %08x\n", hr); - if (pMouse) IUnknown_Release(pMouse); + IUnknown_Release(pMouse); } static void mouse_tests(void) -- 2.23.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58068 Your paranoid android. === w2003std (32 bit report) === dinput: 01e8:mouse: unhandled exception c0000005 at 722C7C57 === debian10 (32 bit report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit French report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit Japanese:Japan report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit Chinese:China report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit WoW report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (64 bit WoW report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0
I'm a little confused. The report show that this passed on the testbot. (The other failures are known issues). === w2003std (32 bit report) === dinput: 01e8:mouse: unhandled exception c0000005 at 722C7C57 Regards Alistair ________________________________ From: Marvin <testbot(a)winehq.org> Sent: Sunday, 20 October 2019 9:14 PM To: leslie_alistair(a)hotmail.com <leslie_alistair(a)hotmail.com> Cc: wine-devel(a)winehq.org <wine-devel(a)winehq.org> Subject: Re: [PATCH] dinput/tests: Remove unrequired pointer checks (Coverity) Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftestbot.winehq.org%2FJobDetails.pl%3FKey%3D58068&data=02%7C01%7C%7Cb5bb150e52084640be4e08d755482a68%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637071640753782004&sdata=loN%2B%2FI5lh8RC9DzI3%2Fn%2BisbO4uv1g5KB35Ytx4hlcF4%3D&reserved=0 Your paranoid android. === w2003std (32 bit report) === dinput: 01e8:mouse: unhandled exception c0000005 at 722C7C57 === debian10 (32 bit report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit French report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit Japanese:Japan report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit Chinese:China report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (32 bit WoW report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0 === debian10 (64 bit WoW report) === dinput: mouse.c:167: Test failed: GetDeviceData() failed: 00000000 cnt:0
participants (2)
-
Alistair Leslie-Hughes -
Marvin