test: correct two capability checks

We have one test device that only has a horizontal scroll wheel but not
a vertical one, causing these tests to run unexpectedly.

One test needs both enabled (not strictly so but let's not bother) and
the other one only needs the vertical wheel.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1251>
This commit is contained in:
Peter Hutterer 2025-06-27 18:37:57 +10:00 committed by Marge Bot
parent e77239f0c7
commit d458b86240

View file

@ -849,7 +849,7 @@ START_TEST(pointer_scroll_wheel_inhibit_small_deltas)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!libevdev_has_event_code(dev->evdev, EV_REL, REL_WHEEL_HI_RES) &&
if (!libevdev_has_event_code(dev->evdev, EV_REL, REL_WHEEL_HI_RES) ||
!libevdev_has_event_code(dev->evdev, EV_REL, REL_HWHEEL_HI_RES))
return LITEST_NOT_APPLICABLE;
@ -899,8 +899,7 @@ START_TEST(pointer_scroll_wheel_inhibit_dir_change)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!libevdev_has_event_code(dev->evdev, EV_REL, REL_WHEEL_HI_RES) &&
!libevdev_has_event_code(dev->evdev, EV_REL, REL_HWHEEL_HI_RES))
if (!libevdev_has_event_code(dev->evdev, EV_REL, REL_WHEEL_HI_RES))
return LITEST_NOT_APPLICABLE;
litest_drain_events(dev->libinput);