mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 10:08:05 +02:00
test: abort when we detect a touch jump during the tests
We never want to accidentally trigger this one. Where we trigger them on purpose, we can swap the log handler out first. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7768d7d981
commit
65f890a352
3 changed files with 8 additions and 0 deletions
|
|
@ -622,6 +622,10 @@ litest_log_handler(struct libinput *libinput,
|
||||||
!strstr(format, "offset negative"))
|
!strstr(format, "offset negative"))
|
||||||
litest_abort_msg("libinput bug triggered, aborting.\n");
|
litest_abort_msg("libinput bug triggered, aborting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strstr(format, "Touch jump detected and discarded")) {
|
||||||
|
litest_abort_msg("libinput touch jump triggered, aborting.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
|
|
||||||
|
|
@ -1926,6 +1926,7 @@ START_TEST(touchpad_3fg_tap_slot_release_btntool)
|
||||||
msleep(2);
|
msleep(2);
|
||||||
|
|
||||||
/* touch 2 up, coordinate jump + ends slot 1, TRIPLETAP stays */
|
/* touch 2 up, coordinate jump + ends slot 1, TRIPLETAP stays */
|
||||||
|
litest_disable_log_handler(li);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 2500);
|
litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 2500);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3800);
|
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3800);
|
||||||
|
|
@ -1955,6 +1956,7 @@ START_TEST(touchpad_3fg_tap_slot_release_btntool)
|
||||||
litest_event(dev, EV_ABS, ABS_PRESSURE, 78);
|
litest_event(dev, EV_ABS, ABS_PRESSURE, 78);
|
||||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
|
litest_restore_log_handler(li);
|
||||||
|
|
||||||
/* now end all three */
|
/* now end all three */
|
||||||
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
||||||
|
|
|
||||||
|
|
@ -5350,6 +5350,7 @@ START_TEST(touchpad_tool_tripletap_touch_count_late)
|
||||||
msleep(10);
|
msleep(10);
|
||||||
|
|
||||||
/* touch 2 up, coordinate jump + ends slot 1, TRIPLETAP stays */
|
/* touch 2 up, coordinate jump + ends slot 1, TRIPLETAP stays */
|
||||||
|
litest_disable_log_handler(li);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 4000);
|
litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 4000);
|
||||||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 4000);
|
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 4000);
|
||||||
|
|
@ -5383,6 +5384,7 @@ START_TEST(touchpad_tool_tripletap_touch_count_late)
|
||||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||||
libinput_dispatch(li);
|
libinput_dispatch(li);
|
||||||
msleep(10);
|
msleep(10);
|
||||||
|
litest_restore_log_handler(li);
|
||||||
|
|
||||||
/* now a click should trigger middle click */
|
/* now a click should trigger middle click */
|
||||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue