mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 03:08:01 +02: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;
|
struct libinput *li = dev->libinput;
|
||||||
int event_amount = amount;
|
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' */
|
/* mouse scroll wheels are 'upside down' */
|
||||||
if (which == REL_WHEEL)
|
if (which == REL_WHEEL)
|
||||||
event_amount *= -1;
|
event_amount *= -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue