mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 03:30:05 +01:00
test: fix a bunch of tests expecting BTN_TOOL_TRIPLETAP
A device may have 1 or 2 slots without setting BTN_TOOL_TRIPLETAP, those
devices will fail those tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 803a99ac05)
This commit is contained in:
parent
652e8e4e56
commit
05eb41b8cc
2 changed files with 14 additions and 11 deletions
|
|
@ -173,6 +173,7 @@ START_TEST(gestures_swipe_3fg_btntool)
|
|||
};
|
||||
|
||||
if (libevdev_get_num_slots(dev->evdev) > 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP) ||
|
||||
!libinput_device_has_capability(dev->libinput_device,
|
||||
LIBINPUT_DEVICE_CAP_GESTURE))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -936,8 +936,8 @@ START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev,
|
||||
ABS_MT_SLOT) > 2)
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
litest_enable_tap(dev->libinput_device);
|
||||
|
|
@ -1676,7 +1676,8 @@ START_TEST(touchpad_3fg_tap_pressure_btntool)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
/* libinput doesn't export when it uses pressure detection, so we
|
||||
|
|
@ -1736,8 +1737,9 @@ START_TEST(touchpad_3fg_tap_hover_btntool)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
|
||||
return;
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
/* libinput doesn't export when it uses pressure detection, so we
|
||||
* need to reconstruct this here. Specifically, semi-mt devices are
|
||||
|
|
@ -1789,8 +1791,8 @@ START_TEST(touchpad_3fg_tap_btntool)
|
|||
enum libinput_config_tap_button_map map = _i; /* ranged test */
|
||||
unsigned int button = 0;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev,
|
||||
ABS_MT_SLOT) > 2)
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
litest_enable_tap(dev->libinput_device);
|
||||
|
|
@ -1839,8 +1841,8 @@ START_TEST(touchpad_3fg_tap_btntool_inverted)
|
|||
enum libinput_config_tap_button_map map = _i; /* ranged test */
|
||||
unsigned int button = 0;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev,
|
||||
ABS_MT_SLOT) > 2)
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
litest_enable_tap(dev->libinput_device);
|
||||
|
|
@ -1889,8 +1891,8 @@ START_TEST(touchpad_3fg_tap_btntool_pointerjump)
|
|||
enum libinput_config_tap_button_map map = _i; /* ranged test */
|
||||
unsigned int button = 0;
|
||||
|
||||
if (libevdev_get_abs_maximum(dev->evdev,
|
||||
ABS_MT_SLOT) > 2)
|
||||
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
|
||||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
|
||||
return;
|
||||
|
||||
litest_enable_tap(dev->libinput_device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue