mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 16:20:05 +01:00
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:
parent
09acce4ce8
commit
c7ec39f51e
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue