test: tighten a helper function

Make sure we can pass only the right axis in

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1268>
This commit is contained in:
Peter Hutterer 2025-07-14 11:00:32 +10:00
parent 09acce4ce8
commit c7ec39f51e

View file

@ -704,6 +704,15 @@ test_wheel_event(struct litest_device *dev, int which, int amount)
struct libinput *li = dev->libinput;
int event_amount = amount;
switch (which) {
case REL_WHEEL:
case REL_HWHEEL:
break;
default:
litest_assert_msg("Invalid axis for %s", __func__);
break;
}
/* mouse scroll wheels are 'upside down' */
if (which == REL_WHEEL)
event_amount *= -1;