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:
Peter Hutterer 2018-08-28 10:00:12 +10:00
parent 7768d7d981
commit 65f890a352
3 changed files with 8 additions and 0 deletions

View file

@ -622,6 +622,10 @@ litest_log_handler(struct libinput *libinput,
!strstr(format, "offset negative"))
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 *

View file

@ -1926,6 +1926,7 @@ START_TEST(touchpad_3fg_tap_slot_release_btntool)
msleep(2);
/* 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_POSITION_X, 2500);
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_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_restore_log_handler(li);
/* now end all three */
litest_event(dev, EV_ABS, ABS_MT_SLOT, 0);

View file

@ -5350,6 +5350,7 @@ START_TEST(touchpad_tool_tripletap_touch_count_late)
msleep(10);
/* 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_POSITION_X, 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);
libinput_dispatch(li);
msleep(10);
litest_restore_log_handler(li);
/* now a click should trigger middle click */
litest_event(dev, EV_KEY, BTN_LEFT, 1);