On 19.03.2021 10:15, RĂ©mi Bernon wrote:
- if (size == 0)
- {
gamepad = (IGamepad *)0xdeadbeef;
hr = IVectorView_Gamepad_GetAt(gamepads, 0, &gamepad);
ok(hr == E_BOUNDS, "IVectorView_Gamepad_GetAt failed, hr %#x\n", hr);
ok(gamepad == NULL, "IVectorView_Gamepad_GetAt returned %p\n", gamepad);
size = 0xdeadbeef;
found = TRUE;
hr = IVectorView_Gamepad_IndexOf(gamepads, gamepad, &size, &found);
ok(hr == S_OK, "IVectorView_Gamepad_IndexOf failed, hr %#x\n", hr);
ok(size == 0 && found == FALSE, "IVectorView_Gamepad_IndexOf returned size %d, found %d\n", size, found);
- }
Could you just use size as an index so that you can always test an out of bounds call regardless of size value?
Jacek