mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 20:30:27 +01:00
test: add litest_dispatch() for better test debugging
Wraps libinput_dispatch() with a location which will make things a bit easier to track. Output (in --verbose) is something like: gestures_swipe_3fg_unaccel_fn():1346 - dispatching Which makes it easier to associate the various calls to libinput dispatch with the other output from libinput. This patch switches all uses of libinput_dispatch() in test cases over but not the litest functions that may call dispatch too. Remains to be seen if that is necessary. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1048>
This commit is contained in:
parent
27e3897420
commit
86c47be816
20 changed files with 1219 additions and 1186 deletions
|
|
@ -283,6 +283,30 @@ struct litest_device *litest_current_device(void)
|
|||
return current_device;
|
||||
}
|
||||
|
||||
int
|
||||
_litest_dispatch(struct libinput *li,
|
||||
const char *func,
|
||||
int line)
|
||||
{
|
||||
static int dispatch_counter = 0;
|
||||
|
||||
++dispatch_counter;
|
||||
|
||||
_litest_checkpoint(func, line,
|
||||
"┌──────────────────── dispatch %3d ────────────────────┐",
|
||||
dispatch_counter);
|
||||
int rc = libinput_dispatch(li);
|
||||
enum libinput_event_type type = libinput_next_event_type(li);
|
||||
|
||||
|
||||
const char *evtype = type == LIBINPUT_EVENT_NONE ? "NONE" : litest_event_type_str(type);
|
||||
_litest_checkpoint(func, line,
|
||||
"└──────────────────── /dispatch %3d ────────────────────┘ pending %s",
|
||||
dispatch_counter,
|
||||
evtype);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void
|
||||
grab_device(struct litest_device *device, bool mode)
|
||||
{
|
||||
|
|
@ -3115,7 +3139,7 @@ _litest_drain_events_of_type(struct libinput *li, ...)
|
|||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
const char *
|
||||
litest_event_type_str(enum libinput_event_type type)
|
||||
{
|
||||
const char *str = NULL;
|
||||
|
|
|
|||
|
|
@ -586,6 +586,15 @@ litest_ungrab_device(struct litest_device *d);
|
|||
void
|
||||
litest_delete_device(struct litest_device *d);
|
||||
|
||||
const char *
|
||||
litest_event_type_str(enum libinput_event_type type);
|
||||
|
||||
int
|
||||
_litest_dispatch(struct libinput *li, const char *func, int line);
|
||||
|
||||
#define litest_dispatch(li_) \
|
||||
_litest_dispatch(li_, __func__, __LINE__)
|
||||
|
||||
void
|
||||
litest_event(struct litest_device *t,
|
||||
unsigned int type,
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ START_TEST(device_disable)
|
|||
litest_event(dev, EV_REL, REL_X, 10);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
ck_assert_int_eq(libinput_event_get_type(event),
|
||||
|
|
@ -205,7 +205,7 @@ START_TEST(device_disable_tablet)
|
|||
litest_tablet_proximity_in(dev, 60, 60, axes);
|
||||
for (int i = 60; i < 70; i++) {
|
||||
litest_tablet_motion(dev, i, i, axes);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_tablet_proximity_out(dev);
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ START_TEST(device_disable_touch_during_touch)
|
|||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
||||
/* after disabling sendevents we require a touch up */
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_CANCEL);
|
||||
libinput_event_destroy(event);
|
||||
|
|
@ -349,7 +349,7 @@ START_TEST(device_disable_events_pending)
|
|||
litest_event(dev, EV_REL, REL_X, 10);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
status = libinput_device_config_send_events_set_mode(device,
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
|
||||
|
|
@ -446,7 +446,7 @@ START_TEST(device_reenable_syspath_changed)
|
|||
litest_event(litest_device, EV_REL, REL_Y, 1);
|
||||
litest_event(litest_device, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
while ((event = libinput_get_event(li))) {
|
||||
ck_assert(libinput_event_get_device(event) != device1);
|
||||
libinput_event_destroy(event);
|
||||
|
|
@ -577,7 +577,7 @@ START_TEST(device_disable_release_tap)
|
|||
litest_touch_down(dev, 0, 50, 50);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
status = libinput_device_config_send_events_set_mode(device,
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
|
||||
|
|
@ -599,7 +599,7 @@ START_TEST(device_disable_release_tap)
|
|||
status = libinput_device_config_send_events_set_mode(device,
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED);
|
||||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
}
|
||||
|
|
@ -622,15 +622,15 @@ START_TEST(device_disable_release_tap_n_drag)
|
|||
litest_touch_down(dev, 0, 50, 50);
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_tap();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
status = libinput_device_config_send_events_set_mode(device,
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
|
||||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
|
|
@ -682,7 +682,7 @@ START_TEST(device_disable_release_softbutton)
|
|||
status = libinput_device_config_send_events_set_mode(device,
|
||||
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED);
|
||||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
}
|
||||
|
|
@ -1208,7 +1208,7 @@ START_TEST(device_nonpointer_rel)
|
|||
libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_REL, REL_Y, -1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_restore_log_handler(li);
|
||||
|
||||
|
|
@ -1249,7 +1249,7 @@ START_TEST(device_touchpad_rel)
|
|||
libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_REL, REL_Y, -1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_destroy_context(li);
|
||||
|
|
@ -1289,7 +1289,7 @@ START_TEST(device_touch_rel)
|
|||
libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_REL, REL_Y, -1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_restore_log_handler(li);
|
||||
|
||||
|
|
@ -1326,7 +1326,7 @@ START_TEST(device_abs_rel)
|
|||
libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_REL, REL_Y, -1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_destroy_context(li);
|
||||
|
|
@ -1350,7 +1350,7 @@ START_TEST(device_quirks_no_abs_mt_y)
|
|||
|
||||
litest_event(dev, EV_REL, REL_HWHEEL, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* both high and low scroll end events must be sent */
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
|
@ -1711,15 +1711,15 @@ START_TEST(device_button_down_remove)
|
|||
* press */
|
||||
if (libevdev_has_property(lidev->evdev, INPUT_PROP_BUTTONPAD)) {
|
||||
litest_touch_down(dev, 0, 20, 90);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_event(dev, EV_KEY, code, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(event) !=
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ test_gesture_swipe_3fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_down(dev, 0, 40, 40);
|
||||
litest_touch_down(dev, 1, 50, 40);
|
||||
litest_touch_down(dev, 2, 60, 40);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
||||
litest_touch_move_three_touches(dev, 40, 40, 50, 40, 60, 40, dir_x,
|
||||
dir_y, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
litest_assert_gesture_event(li,
|
||||
|
|
@ -141,7 +141,7 @@ test_gesture_swipe_3fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_END,
|
||||
|
|
@ -183,7 +183,7 @@ test_gesture_swipe_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_down(dev, 1, 50, 40);
|
||||
litest_touch_down(dev, 2, 60, 40);
|
||||
litest_touch_down(dev, 3, 70, 40);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -211,10 +211,10 @@ test_gesture_swipe_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
70 + dir_x,
|
||||
40 + dir_y);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
litest_assert_gesture_event(li,
|
||||
|
|
@ -279,7 +279,7 @@ test_gesture_swipe_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
litest_touch_up(dev, 3);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_END,
|
||||
|
|
@ -334,7 +334,7 @@ test_gesture_pinch_2fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
|
||||
litest_touch_down(dev, 0, 50 + dir_x, 50 + dir_y);
|
||||
litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -358,7 +358,7 @@ test_gesture_pinch_2fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
50 - dir_x,
|
||||
50 - dir_y);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
|
|
@ -397,12 +397,12 @@ test_gesture_pinch_2fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
ck_assert_double_le(fabs(angle), 1.0);
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_PINCH_END,
|
||||
|
|
@ -445,7 +445,7 @@ test_gesture_pinch_3fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_down(dev, 0, 50 + dir_x, 50 + dir_y);
|
||||
litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y);
|
||||
litest_touch_down(dev, 2, 51 - dir_x, 51 - dir_y);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -473,7 +473,7 @@ test_gesture_pinch_3fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
51 - dir_x,
|
||||
51 - dir_y);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
|
|
@ -511,13 +511,13 @@ test_gesture_pinch_3fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
ck_assert_double_le(fabs(angle), 1.0);
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_PINCH_END,
|
||||
|
|
@ -561,7 +561,7 @@ test_gesture_pinch_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y);
|
||||
litest_touch_down(dev, 2, 51 - dir_x, 51 - dir_y);
|
||||
litest_touch_down(dev, 3, 52 - dir_x, 52 - dir_y);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -593,7 +593,7 @@ test_gesture_pinch_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
52 - dir_x,
|
||||
52 - dir_y);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
|
|
@ -632,14 +632,14 @@ test_gesture_pinch_4fg(int cardinal, enum hold_gesture_behaviour hold)
|
|||
ck_assert_double_le(fabs(angle), 1.0);
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
litest_touch_up(dev, 3);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_PINCH_END,
|
||||
|
|
@ -694,7 +694,7 @@ test_gesture_spread(int cardinal, enum hold_gesture_behaviour hold)
|
|||
|
||||
litest_touch_down(dev, 0, 50 + dir_x, 50 + dir_y);
|
||||
litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -718,7 +718,7 @@ test_gesture_spread(int cardinal, enum hold_gesture_behaviour hold)
|
|||
50 - dir_x,
|
||||
50 - dir_y);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
|
|
@ -755,12 +755,12 @@ test_gesture_spread(int cardinal, enum hold_gesture_behaviour hold)
|
|||
ck_assert_double_le(fabs(angle), 1.0);
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_PINCH_END,
|
||||
|
|
@ -786,7 +786,7 @@ test_gesture_3fg_buttonarea_scroll(enum hold_gesture_behaviour hold)
|
|||
litest_touch_down(dev, 1, 30, 20);
|
||||
/* third finger in btnarea */
|
||||
litest_touch_down(dev, 2, 50, 99);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE)
|
||||
litest_timeout_gesture_hold();
|
||||
|
|
@ -795,7 +795,7 @@ test_gesture_3fg_buttonarea_scroll(enum hold_gesture_behaviour hold)
|
|||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (hold == HOLD_GESTURE_REQUIRE) {
|
||||
litest_assert_gesture_event(li,
|
||||
|
|
@ -838,7 +838,7 @@ test_gesture_hold(int nfingers)
|
|||
break;
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_hold();
|
||||
|
||||
if (libinput_device_has_capability(dev->libinput_device,
|
||||
|
|
@ -865,7 +865,7 @@ test_gesture_hold(int nfingers)
|
|||
break;
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
if (libinput_device_has_capability(dev->libinput_device,
|
||||
LIBINPUT_DEVICE_CAP_GESTURE)) {
|
||||
litest_assert_gesture_event(li,
|
||||
|
|
@ -903,7 +903,7 @@ test_gesture_hold_cancel(int nfingers)
|
|||
break;
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_hold();
|
||||
|
||||
litest_touch_up(dev, last_finger);
|
||||
|
|
@ -989,9 +989,9 @@ START_TEST(gestures_swipe_3fg_btntool)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_two_touches(dev, 40, 40, 50, 40, dir_x, dir_y, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
|
|
@ -1045,7 +1045,7 @@ START_TEST(gestures_swipe_3fg_btntool)
|
|||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_END,
|
||||
|
|
@ -1078,9 +1078,9 @@ START_TEST(gestures_swipe_3fg_btntool_pinch_like)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_to(dev, 0, 20, 60, 10, 80, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_gesture_event(event, LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN, 3);
|
||||
|
|
@ -1095,7 +1095,7 @@ START_TEST(gestures_swipe_3fg_btntool_pinch_like)
|
|||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_END,
|
||||
|
|
@ -1149,9 +1149,9 @@ START_TEST(gestures_swipe_4fg_btntool)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_two_touches(dev, 40, 40, 50, 40, dir_x, dir_y, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
|
|
@ -1205,7 +1205,7 @@ START_TEST(gestures_swipe_4fg_btntool)
|
|||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_END,
|
||||
|
|
@ -1259,11 +1259,11 @@ START_TEST(gestures_time_usec)
|
|||
litest_touch_down(dev, 0, 40, 40);
|
||||
litest_touch_down(dev, 1, 50, 40);
|
||||
litest_touch_down(dev, 2, 60, 40);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_three_touches(dev, 40, 40, 50, 40, 60, 40, 0, 30,
|
||||
30);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
gevent = litest_is_gesture_event(event,
|
||||
LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
|
||||
|
|
@ -1299,11 +1299,11 @@ START_TEST(gestures_3fg_buttonarea_scroll_btntool)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_to(dev, 1, 30, 20, 30, 70, 10);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_scroll(li,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_FINGER,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
||||
|
|
@ -1343,14 +1343,14 @@ START_TEST(gestures_swipe_3fg_unaccel)
|
|||
litest_touch_down(dev, 0, 40, 20);
|
||||
litest_touch_down(dev, 1, 50, 20);
|
||||
litest_touch_down(dev, 2, 60, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_move_three_touches(dev,
|
||||
40, 20,
|
||||
50, 20,
|
||||
60, 20,
|
||||
30, 40,
|
||||
10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_gesture_event(event,
|
||||
|
|
@ -1594,10 +1594,10 @@ START_TEST(gestures_hold_once_on_double_tap)
|
|||
|
||||
/* First tap, a hold gesture must be generated */
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_quick_hold();
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_gesture_event(li,
|
||||
LIBINPUT_EVENT_GESTURE_HOLD_BEGIN,
|
||||
|
|
@ -1614,7 +1614,7 @@ START_TEST(gestures_hold_once_on_double_tap)
|
|||
/* Double tap, don't generate an extra hold gesture */
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_quick_hold();
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
|
|
@ -1669,7 +1669,7 @@ START_TEST(gestures_hold_once_tap_n_drag)
|
|||
litest_touch_down(dev, 0, 40, 30);
|
||||
break;
|
||||
}
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_quick_hold();
|
||||
|
||||
switch (nfingers) {
|
||||
|
|
@ -1683,7 +1683,7 @@ START_TEST(gestures_hold_once_tap_n_drag)
|
|||
litest_touch_up(dev, 0);
|
||||
break;
|
||||
}
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* "Quick" hold gestures are only generated when using 1 or 2 fingers */
|
||||
if (nfingers == 1 || nfingers == 2) {
|
||||
|
|
@ -1698,14 +1698,14 @@ START_TEST(gestures_hold_once_tap_n_drag)
|
|||
/* Tap and drag, don't generate an extra hold gesture */
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -1725,11 +1725,11 @@ START_TEST(gestures_hold_and_motion_before_timeout)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 50, 50, 51, 51, 1);
|
||||
litest_touch_move_to(dev, 0, 51, 51, 50, 50, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_timeout_gesture_quick_hold();
|
||||
|
||||
|
|
@ -1740,7 +1740,7 @@ START_TEST(gestures_hold_and_motion_before_timeout)
|
|||
1);
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_gesture_event(li,
|
||||
LIBINPUT_EVENT_GESTURE_HOLD_END,
|
||||
|
|
@ -1761,7 +1761,7 @@ START_TEST(gestures_hold_and_motion_after_timeout)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_quick_hold();
|
||||
|
||||
litest_assert_gesture_event(li,
|
||||
|
|
@ -1770,11 +1770,11 @@ START_TEST(gestures_hold_and_motion_after_timeout)
|
|||
|
||||
litest_touch_move_to(dev, 0, 50, 50, 51, 51, 1);
|
||||
litest_touch_move_to(dev, 0, 51, 51, 50, 50, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_gesture_event(li,
|
||||
LIBINPUT_EVENT_GESTURE_HOLD_END,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
for (i = 0; i < num_devices; ++i)
|
||||
litest_keyboard_key(devices[i], KEY_A, true);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
kev = litest_is_keyboard_event(ev,
|
||||
KEY_A,
|
||||
|
|
@ -67,7 +67,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
ck_assert_int_eq(expected_key_button_count, seat_key_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(seat_key_count, num_devices);
|
||||
|
|
@ -75,7 +75,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
for (i = 0; i < num_devices; ++i)
|
||||
litest_keyboard_key(devices[i], KEY_A, false);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
kev = libinput_event_get_keyboard_event(ev);
|
||||
ck_assert_notnull(kev);
|
||||
|
|
@ -89,7 +89,7 @@ START_TEST(keyboard_seat_key_count)
|
|||
ck_assert_int_eq(expected_key_button_count, seat_key_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(seat_key_count, 0);
|
||||
|
|
@ -138,7 +138,7 @@ START_TEST(keyboard_ignore_no_pressed_release)
|
|||
litest_keyboard_key(dev, KEY_A, true);
|
||||
litest_keyboard_key(dev, KEY_A, false);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
|
||||
ARRAY_FOR_EACH(expected_states, state) {
|
||||
event = libinput_get_event(libinput);
|
||||
|
|
@ -151,7 +151,7 @@ START_TEST(keyboard_ignore_no_pressed_release)
|
|||
ck_assert_int_eq(libinput_event_keyboard_get_key_state(kevent),
|
||||
*state);
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
litest_assert_empty_queue(libinput);
|
||||
|
|
@ -209,7 +209,7 @@ START_TEST(keyboard_key_auto_release)
|
|||
litest_event(dev, EV_KEY, key, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
|
||||
event = libinput_get_event(libinput);
|
||||
litest_is_keyboard_event(event,
|
||||
|
|
@ -312,7 +312,7 @@ START_TEST(keyboard_time_usec)
|
|||
litest_drain_events(dev->libinput);
|
||||
|
||||
litest_keyboard_key(dev, KEY_A, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
kev = litest_is_keyboard_event(event,
|
||||
|
|
@ -348,7 +348,7 @@ START_TEST(keyboard_no_buttons)
|
|||
|
||||
litest_keyboard_key(dev, code, true);
|
||||
litest_keyboard_key(dev, code, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_keyboard_event(event,
|
||||
|
|
@ -378,7 +378,7 @@ START_TEST(keyboard_frame_order)
|
|||
litest_event(dev, EV_KEY, KEY_LEFTSHIFT, 1);
|
||||
litest_event(dev, EV_KEY, KEY_A, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_key_event(li,
|
||||
KEY_LEFTSHIFT,
|
||||
|
|
@ -388,7 +388,7 @@ START_TEST(keyboard_frame_order)
|
|||
litest_event(dev, EV_KEY, KEY_LEFTSHIFT, 0);
|
||||
litest_event(dev, EV_KEY, KEY_A, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_key_event(li,
|
||||
KEY_LEFTSHIFT,
|
||||
|
|
@ -398,7 +398,7 @@ START_TEST(keyboard_frame_order)
|
|||
litest_event(dev, EV_KEY, KEY_A, 1);
|
||||
litest_event(dev, EV_KEY, KEY_LEFTSHIFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_PRESSED);
|
||||
litest_assert_key_event(li,
|
||||
|
|
@ -408,14 +408,14 @@ START_TEST(keyboard_frame_order)
|
|||
litest_event(dev, EV_KEY, KEY_A, 0);
|
||||
litest_event(dev, EV_KEY, KEY_LEFTSHIFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_RELEASED);
|
||||
litest_assert_key_event(li,
|
||||
KEY_LEFTSHIFT,
|
||||
LIBINPUT_KEY_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ START_TEST(log_axisrange_warning)
|
|||
abs->maximum * 2 + i);
|
||||
litest_event(dev, EV_ABS, axis, abs->maximum * 2);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
/* Expect only one message per 5 min */
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ START_TEST(event_conversion_device_notify)
|
|||
litest_restore_log_handler(li); /* use the default litest handler */
|
||||
libinput_path_add_device(li, libevdev_uinput_get_devnode(uinput));
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
libinput_suspend(li);
|
||||
libinput_resume(li);
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ START_TEST(event_conversion_pointer)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -221,7 +221,7 @@ START_TEST(event_conversion_pointer_abs)
|
|||
litest_event(dev, EV_ABS, ABS_Y, 30);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -270,7 +270,7 @@ START_TEST(event_conversion_key)
|
|||
litest_event(dev, EV_KEY, KEY_A, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -309,7 +309,7 @@ START_TEST(event_conversion_touch)
|
|||
struct libinput_event *event;
|
||||
int touch = 0;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_FINGER, 1);
|
||||
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
|
||||
|
|
@ -321,7 +321,7 @@ START_TEST(event_conversion_touch)
|
|||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 10);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -362,11 +362,11 @@ START_TEST(event_conversion_gesture)
|
|||
int gestures = 0;
|
||||
int i;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_touch_down(dev, 0, 70, 30);
|
||||
litest_touch_down(dev, 1, 30, 70);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_gesture_hold();
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
|
|
@ -374,7 +374,7 @@ START_TEST(event_conversion_gesture)
|
|||
litest_touch_move(dev, 0, 70 - i * 5, 30 + i * 5);
|
||||
litest_touch_move(dev, 1, 30 + i * 5, 70 - i * 5);
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -423,7 +423,7 @@ START_TEST(event_conversion_tablet)
|
|||
litest_button_click(dev, BTN_STYLUS, true);
|
||||
litest_button_click(dev, BTN_STYLUS, false);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -466,7 +466,7 @@ START_TEST(event_conversion_tablet_pad)
|
|||
litest_pad_ring_start(dev, 10);
|
||||
litest_pad_ring_end(dev);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -512,7 +512,7 @@ START_TEST(event_conversion_switch)
|
|||
litest_switch_action(dev,
|
||||
LIBINPUT_SWITCH_LID,
|
||||
LIBINPUT_SWITCH_STATE_OFF);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -630,7 +630,7 @@ START_TEST(fd_no_event_leak)
|
|||
libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_path_remove_device(device);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_drain_events(li);
|
||||
|
||||
/* Device is removed, but fd is still open. Queue an event, add a
|
||||
|
|
@ -638,10 +638,10 @@ START_TEST(fd_no_event_leak)
|
|||
* by libinput */
|
||||
libevdev_uinput_write_event(uinput, EV_REL, REL_Y, 1);
|
||||
libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
libinput_path_add_device(li, path);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_int_eq(libinput_event_get_type(event),
|
||||
LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
|
|
@ -685,7 +685,7 @@ START_TEST(timer_offset_bug_warning)
|
|||
|
||||
user_data->private = &warning_triggered;
|
||||
libinput_log_set_handler(li, timer_offset_warning);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* triggered for touch down and touch up */
|
||||
ck_assert_int_eq(warning_triggered, 2);
|
||||
|
|
@ -722,7 +722,7 @@ START_TEST(timer_delay_bug_warning)
|
|||
litest_event(dev, EV_REL, REL_X, -1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
msleep(21);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
ck_assert_int_ge(warning_triggered, 1);
|
||||
|
|
@ -739,17 +739,17 @@ START_TEST(timer_flush)
|
|||
|
||||
touchpad = litest_add_device(li, LITEST_SYNAPTICS_TOUCHPAD);
|
||||
litest_enable_tap(touchpad->libinput_device);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_drain_events(li);
|
||||
|
||||
/* make sure tapping works */
|
||||
litest_touch_down(touchpad, 0, 50, 50);
|
||||
litest_touch_up(touchpad, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_tap();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -760,12 +760,12 @@ START_TEST(timer_flush)
|
|||
/* make sure dwt-tap is ignored */
|
||||
litest_keyboard_key(keyboard, KEY_A, true);
|
||||
litest_keyboard_key(keyboard, KEY_A, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_touch_down(touchpad, 0, 50, 50);
|
||||
litest_touch_up(touchpad, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_tap();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
||||
|
||||
/* Ignore 'timer offset negative' warnings */
|
||||
|
|
@ -775,7 +775,7 @@ START_TEST(timer_flush)
|
|||
- send a key event
|
||||
- expire dwt
|
||||
- send a tap
|
||||
and then call libinput_dispatch(). libinput should notice that
|
||||
and then call litest_dispatch(). libinput should notice that
|
||||
the tap event came in after the timeout and thus acknowledge the
|
||||
tap.
|
||||
*/
|
||||
|
|
@ -784,9 +784,9 @@ START_TEST(timer_flush)
|
|||
litest_timeout_dwt_long();
|
||||
litest_touch_down(touchpad, 0, 50, 50);
|
||||
litest_touch_up(touchpad, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_tap();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_restore_log_handler(li);
|
||||
|
||||
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_PRESSED);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ START_TEST(pad_time)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ START_TEST(pad_time)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
ck_assert_int_eq(libinput_event_get_type(ev),
|
||||
|
|
@ -206,7 +206,7 @@ START_TEST(pad_button_intuos)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
count++;
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ START_TEST(pad_button_bamboo)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
count++;
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ START_TEST(pad_button_libwacom)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_pad_button_event(li,
|
||||
i,
|
||||
|
|
@ -345,7 +345,7 @@ START_TEST(pad_button_mode_groups)
|
|||
|
||||
litest_button_click(dev, code, 1);
|
||||
litest_button_click(dev, code, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
switch (code) {
|
||||
case BTN_STYLUS:
|
||||
|
|
@ -431,7 +431,7 @@ START_TEST(pad_ring)
|
|||
*/
|
||||
for (val = 0; val < 100.0; val += 1) {
|
||||
litest_pad_ring_change(dev, val);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
if (!ev)
|
||||
|
|
@ -471,7 +471,7 @@ START_TEST(pad_ring_finger_up)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_pad_ring_end(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
pev = litest_is_pad_ring_event(ev,
|
||||
|
|
@ -520,7 +520,7 @@ START_TEST(pad_dial_low_res)
|
|||
if (code == REL_WHEEL)
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, direction * 120);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
struct libinput_event *ev = libinput_get_event(li);
|
||||
struct libinput_event_tablet_pad *pev = litest_is_pad_dial_event(ev, 0);
|
||||
|
|
@ -559,7 +559,7 @@ START_TEST(pad_dial_hi_res)
|
|||
if (accumulated % 120 == 0)
|
||||
litest_event(dev, EV_REL, REL_WHEEL, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
struct libinput_event *ev = libinput_get_event(li);
|
||||
struct libinput_event_tablet_pad *pev = litest_is_pad_dial_event(ev, 0);
|
||||
|
|
@ -601,7 +601,7 @@ START_TEST(pad_strip)
|
|||
* value. */
|
||||
for (val = 0; val < 100; val += 9.5) {
|
||||
litest_pad_strip_change(dev, val);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
pev = litest_is_pad_strip_event(ev,
|
||||
|
|
@ -622,7 +622,7 @@ START_TEST(pad_strip)
|
|||
}
|
||||
|
||||
litest_pad_strip_change(dev, 100);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
pev = litest_is_pad_strip_event(ev,
|
||||
|
|
@ -648,7 +648,7 @@ START_TEST(pad_strip_finger_up)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_pad_strip_end(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
pev = litest_is_pad_strip_event(ev,
|
||||
|
|
@ -756,7 +756,7 @@ START_TEST(pad_left_handed_ring)
|
|||
|
||||
for (val = 0; val < 100; val += 10) {
|
||||
litest_pad_ring_change(dev, val);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
pev = litest_is_pad_ring_event(ev,
|
||||
|
|
@ -1044,29 +1044,29 @@ START_TEST(pad_keys)
|
|||
|
||||
key = KEY_BUTTONCONFIG;
|
||||
pad_key_down(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_PRESSED);
|
||||
|
||||
pad_key_up(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_RELEASED);
|
||||
|
||||
key = KEY_ONSCREEN_KEYBOARD;
|
||||
pad_key_down(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_PRESSED);
|
||||
|
||||
pad_key_up(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_RELEASED);
|
||||
|
||||
key = KEY_CONTROLPANEL;
|
||||
pad_key_down(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_PRESSED);
|
||||
|
||||
pad_key_up(dev, key);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_pad_key_event(li, key, LIBINPUT_KEY_STATE_RELEASED);
|
||||
}
|
||||
END_TEST
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ START_TEST(path_added_seat)
|
|||
const char *seat_name;
|
||||
enum libinput_event_type type;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -331,7 +331,7 @@ START_TEST(path_seat_change)
|
|||
const char *seat2_name = "new seat";
|
||||
int rc;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_int_eq(libinput_event_get_type(event),
|
||||
|
|
@ -352,7 +352,7 @@ START_TEST(path_seat_change)
|
|||
seat2_name);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -396,7 +396,7 @@ START_TEST(path_added_device)
|
|||
struct libinput_device *device;
|
||||
enum libinput_event_type type;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -418,7 +418,7 @@ START_TEST(path_add_device)
|
|||
char *sysname1 = NULL, *sysname2 = NULL;
|
||||
enum libinput_event_type type;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -435,7 +435,7 @@ START_TEST(path_add_device)
|
|||
libevdev_uinput_get_devnode(dev->uinput));
|
||||
ck_assert_notnull(device);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -465,7 +465,7 @@ START_TEST(path_add_invalid_path)
|
|||
litest_restore_log_handler(li);
|
||||
ck_assert(device == NULL);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ START_TEST(path_device_sysname)
|
|||
const char *sysname;
|
||||
enum libinput_event_type type;
|
||||
|
||||
libinput_dispatch(dev->libinput);
|
||||
litest_dispatch(dev->libinput);
|
||||
|
||||
ev = libinput_get_event(dev->libinput);
|
||||
ck_assert_notnull(ev);
|
||||
|
|
@ -514,7 +514,7 @@ START_TEST(path_remove_device)
|
|||
litest_drain_events(li);
|
||||
|
||||
libinput_path_remove_device(device);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -545,7 +545,7 @@ START_TEST(path_double_remove_device)
|
|||
|
||||
libinput_path_remove_device(device);
|
||||
libinput_path_remove_device(device);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -684,7 +684,7 @@ START_TEST(path_add_device_suspend_resume)
|
|||
ck_assert_notnull(device);
|
||||
libinput_path_add_device(li, libevdev_uinput_get_devnode(uinput2));
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -698,7 +698,7 @@ START_TEST(path_add_device_suspend_resume)
|
|||
ck_assert_int_eq(nevents, 2);
|
||||
|
||||
libinput_suspend(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -712,7 +712,7 @@ START_TEST(path_add_device_suspend_resume)
|
|||
ck_assert_int_eq(nevents, 2);
|
||||
|
||||
libinput_resume(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -764,7 +764,7 @@ START_TEST(path_add_device_suspend_resume_fail)
|
|||
libevdev_uinput_get_devnode(uinput2));
|
||||
ck_assert_notnull(device);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -778,7 +778,7 @@ START_TEST(path_add_device_suspend_resume_fail)
|
|||
ck_assert_int_eq(nevents, 2);
|
||||
|
||||
libinput_suspend(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -796,7 +796,7 @@ START_TEST(path_add_device_suspend_resume_fail)
|
|||
rc = libinput_resume(li);
|
||||
ck_assert_int_eq(rc, -1);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -851,7 +851,7 @@ START_TEST(path_add_device_suspend_resume_remove_device)
|
|||
libevdev_uinput_get_devnode(uinput2));
|
||||
|
||||
libinput_device_ref(device);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -865,7 +865,7 @@ START_TEST(path_add_device_suspend_resume_remove_device)
|
|||
ck_assert_int_eq(nevents, 2);
|
||||
|
||||
libinput_suspend(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -886,7 +886,7 @@ START_TEST(path_add_device_suspend_resume_remove_device)
|
|||
rc = libinput_resume(li);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
nevents = 0;
|
||||
while ((event = libinput_get_event(li))) {
|
||||
|
|
@ -929,7 +929,7 @@ START_TEST(path_device_gone)
|
|||
|
||||
libevdev_uinput_destroy(uinput);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -969,7 +969,7 @@ START_TEST(path_seat_recycle)
|
|||
libevdev_uinput_get_devnode(uinput));
|
||||
ck_assert_notnull(device);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
ck_assert_notnull(ev);
|
||||
|
|
@ -991,7 +991,7 @@ START_TEST(path_seat_recycle)
|
|||
|
||||
libinput_resume(li);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ev = libinput_get_event(li);
|
||||
ck_assert_notnull(ev);
|
||||
type = libinput_event_get_type(ev);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ test_relative_event(struct litest_device *dev, double dx, double dy)
|
|||
litest_event(dev, EV_REL, REL_Y, dy);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
@ -119,7 +119,7 @@ START_TEST(pointer_motion_relative)
|
|||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
litest_event(dev, EV_REL, REL_Y, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(dev->libinput);
|
||||
litest_dispatch(dev->libinput);
|
||||
|
||||
litest_drain_events(dev->libinput);
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ START_TEST(pointer_motion_relative_zero)
|
|||
litest_event(dev, EV_REL, REL_X, 0);
|
||||
litest_event(dev, EV_REL, REL_Y, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ START_TEST(pointer_motion_relative_zero)
|
|||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
litest_event(dev, EV_REL, REL_Y, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
libinput_event_destroy(libinput_get_event(li));
|
||||
litest_assert_empty_queue(li);
|
||||
|
|
@ -169,7 +169,7 @@ START_TEST(pointer_motion_relative_zero)
|
|||
litest_event(dev, EV_REL, REL_X, 0);
|
||||
litest_event(dev, EV_REL, REL_Y, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(dev->libinput);
|
||||
litest_dispatch(dev->libinput);
|
||||
}
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ START_TEST(pointer_motion_relative_min_decel)
|
|||
litest_event(dev, EV_REL, REL_X, dx);
|
||||
litest_event(dev, EV_REL, REL_Y, dy);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
@ -234,7 +234,7 @@ test_absolute_event(struct litest_device *dev, double x, double y)
|
|||
enum libinput_event_type type = LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE;
|
||||
|
||||
litest_touch_down(dev, 0, x, y);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_assert_notnull(event);
|
||||
|
|
@ -329,7 +329,7 @@ test_unaccel_event(struct litest_device *dev, int dx, int dy)
|
|||
litest_event(dev, EV_REL, REL_Y, dy);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
@ -677,7 +677,7 @@ test_wheel_event(struct litest_device *dev, int which, int amount)
|
|||
litest_event(dev, EV_REL, which, event_amount);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
test_high_and_low_wheel_events_value(dev, which, amount * 120);
|
||||
}
|
||||
|
|
@ -731,7 +731,7 @@ test_hi_res_wheel_event(struct litest_device *dev, int which, int v120_amount)
|
|||
abort();
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
test_high_and_low_wheel_events_value(dev, which, v120_amount);
|
||||
}
|
||||
|
|
@ -799,17 +799,17 @@ START_TEST(pointer_scroll_wheel_hires_send_only_lores)
|
|||
|
||||
litest_event(dev, EV_REL, lores_code, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, lores_code, direction * 120);
|
||||
|
||||
litest_event(dev, EV_REL, lores_code, -1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, lores_code, direction * -120);
|
||||
|
||||
litest_event(dev, EV_REL, lores_code, 2);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, lores_code, direction * 240);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
|
|
@ -832,19 +832,19 @@ START_TEST(pointer_scroll_wheel_inhibit_small_deltas)
|
|||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 15);
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 15);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
/* The accumulated scroll is 30, add 30 to trigger scroll */
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 30);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, REL_WHEEL_HI_RES, -60);
|
||||
|
||||
/* Once the threshold is reached, small scroll deltas are reported */
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 5);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, REL_WHEEL_HI_RES, -5);
|
||||
|
||||
/* When the scroll timeout is triggered, ignore small deltas again */
|
||||
|
|
@ -853,13 +853,13 @@ START_TEST(pointer_scroll_wheel_inhibit_small_deltas)
|
|||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, -15);
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, -15);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_event(dev, EV_REL, REL_HWHEEL_HI_RES, 15);
|
||||
litest_event(dev, EV_REL, REL_HWHEEL_HI_RES, 15);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -879,25 +879,25 @@ START_TEST(pointer_scroll_wheel_inhibit_dir_change)
|
|||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 120);
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 30);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, REL_WHEEL_HI_RES, -150);
|
||||
|
||||
/* Scroll below the threshold in the oposite direction should be ignored */
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, -30);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
/* But should be triggered if the scroll continues in the same direction */
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, -120);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, REL_WHEEL_HI_RES, 150);
|
||||
|
||||
/* Scroll above the threshold in the same dir should be triggered */
|
||||
litest_event(dev, EV_REL, REL_WHEEL_HI_RES, 80);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
test_high_and_low_wheel_events_value(dev, REL_WHEEL_HI_RES, -80);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -919,7 +919,7 @@ START_TEST(pointer_scroll_wheel_lenovo_scrollpoint)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_REL, REL_WHEEL, -60);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Hi-res scroll event first */
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -1052,7 +1052,7 @@ START_TEST(pointer_scroll_has_axis_invalid)
|
|||
litest_event(dev, EV_REL, REL_WHEEL, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
pev = litest_is_axis_event(event,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_WHEEL,
|
||||
|
|
@ -1126,12 +1126,12 @@ START_TEST(pointer_seat_button_count)
|
|||
BTN_LEFT,
|
||||
true);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_POINTER_BUTTON) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1148,7 +1148,7 @@ START_TEST(pointer_seat_button_count)
|
|||
ck_assert_int_eq(expected_seat_button_count, seat_button_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(seat_button_count, num_devices);
|
||||
|
|
@ -1159,12 +1159,12 @@ START_TEST(pointer_seat_button_count)
|
|||
BTN_LEFT,
|
||||
false);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
LIBINPUT_EVENT_POINTER_BUTTON) {
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1181,7 +1181,7 @@ START_TEST(pointer_seat_button_count)
|
|||
ck_assert_int_eq(expected_seat_button_count, seat_button_count);
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert_int_eq(seat_button_count, 0);
|
||||
|
|
@ -1287,7 +1287,7 @@ START_TEST(pointer_left_handed_during_click)
|
|||
|
||||
litest_drain_events(li);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Change while button is down, expect correct release event */
|
||||
status = libinput_device_config_left_handed_set(d, 1);
|
||||
|
|
@ -1318,7 +1318,7 @@ START_TEST(pointer_left_handed_during_click_multiple_buttons)
|
|||
|
||||
litest_drain_events(li);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
status = libinput_device_config_left_handed_set(d, 1);
|
||||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
|
@ -1354,13 +1354,13 @@ START_TEST(pointer_left_handed_disable_with_button_down)
|
|||
|
||||
litest_drain_events(li);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_RIGHT,
|
||||
|
|
@ -1481,7 +1481,7 @@ START_TEST(pointer_scroll_button_no_event_before_timeout)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_button_click_debounced(device, li, BTN_LEFT, false);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
|
|
@ -1517,20 +1517,20 @@ START_TEST(pointer_scroll_button_middle_emulation)
|
|||
|
||||
litest_button_click(dev, BTN_LEFT, 1);
|
||||
litest_button_click(dev, BTN_RIGHT, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
litest_event(dev, EV_REL, REL_Y, -1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_button_click(dev, BTN_LEFT, 0);
|
||||
litest_button_click(dev, BTN_RIGHT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_scroll(li,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS,
|
||||
|
|
@ -1564,11 +1564,11 @@ START_TEST(pointer_scroll_button_device_remove_while_down)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* delete the device while the timer is still active */
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_destroy_context(li);
|
||||
}
|
||||
|
|
@ -1609,7 +1609,7 @@ START_TEST(pointer_scroll_button_lock)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
|
|
@ -1617,11 +1617,11 @@ START_TEST(pointer_scroll_button_lock)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, true);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_scroll(li,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS,
|
||||
|
|
@ -1714,9 +1714,9 @@ START_TEST(pointer_scroll_button_lock_enable_while_down)
|
|||
/* but on the next button press we scroll lock */
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, true);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
|
|
@ -1780,9 +1780,9 @@ START_TEST(pointer_scroll_button_lock_enable_while_down_just_lock)
|
|||
/* but on the next button press we scroll lock */
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, true);
|
||||
litest_button_click_debounced(dev, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
|
|
@ -1824,7 +1824,7 @@ START_TEST(pointer_scroll_button_lock_otherbutton)
|
|||
litest_button_click_debounced(dev, li, BTN_LEFT, false);
|
||||
litest_assert_empty_queue(li);
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* other button passes on normally */
|
||||
litest_button_click_debounced(dev, li, BTN_RIGHT, true);
|
||||
|
|
@ -1997,10 +1997,10 @@ START_TEST(pointer_scroll_button_lock_middlebutton)
|
|||
abort();
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_middlebutton();
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* motion events are the same for all of them */
|
||||
for (int i = 0; i < 10; i++) {
|
||||
|
|
@ -2009,7 +2009,7 @@ START_TEST(pointer_scroll_button_lock_middlebutton)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
switch (buttonorder) {
|
||||
case LLRR:
|
||||
|
|
@ -2021,7 +2021,7 @@ START_TEST(pointer_scroll_button_lock_middlebutton)
|
|||
break;
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
switch (buttonorder) {
|
||||
case LLRR:
|
||||
|
|
@ -2253,7 +2253,7 @@ START_TEST(pointer_accel_direction_change)
|
|||
}
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
do {
|
||||
|
|
@ -2962,23 +2962,23 @@ START_TEST(middlebutton_button_scrolling)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* middle emulation discards */
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_timeout_middlebutton();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* scroll discards */
|
||||
litest_assert_empty_queue(li);
|
||||
litest_timeout_buttonscroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
litest_event(dev, EV_REL, REL_Y, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
|
|
@ -2996,7 +2996,7 @@ START_TEST(middlebutton_button_scrolling)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_axis_end_sequence(li,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS,
|
||||
|
|
@ -3038,7 +3038,7 @@ START_TEST(middlebutton_button_scrolling_middle)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_RIGHT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
|
|
@ -3048,7 +3048,7 @@ START_TEST(middlebutton_button_scrolling_middle)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_RIGHT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
|
|
@ -3079,7 +3079,7 @@ START_TEST(middlebutton_device_remove_while_down)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_RIGHT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
|
|
@ -3108,7 +3108,7 @@ START_TEST(middlebutton_device_remove_while_one_is_down)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_RIGHT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -3162,9 +3162,9 @@ START_TEST(debounce_bounce)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, button, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -3177,9 +3177,9 @@ START_TEST(debounce_bounce)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, button, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -3208,17 +3208,17 @@ START_TEST(debounce_bounce_high_delay)
|
|||
* each single event. */
|
||||
litest_event(dev, EV_KEY, button, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(15);
|
||||
litest_event(dev, EV_KEY, button, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(15);
|
||||
litest_event(dev, EV_KEY, button, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -3227,17 +3227,17 @@ START_TEST(debounce_bounce_high_delay)
|
|||
|
||||
litest_event(dev, EV_KEY, button, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(15);
|
||||
litest_event(dev, EV_KEY, button, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(15);
|
||||
litest_event(dev, EV_KEY, button, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -3285,9 +3285,9 @@ debounce_trigger_spurious(struct litest_device *dev, struct libinput *li)
|
|||
{
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3295,13 +3295,13 @@ debounce_trigger_spurious(struct litest_device *dev, struct libinput *li)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3313,9 +3313,9 @@ debounce_trigger_spurious(struct litest_device *dev, struct libinput *li)
|
|||
/* gets filtered now */
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -3341,16 +3341,16 @@ START_TEST(debounce_spurious)
|
|||
for (int i = 0; i < 3; i++) {
|
||||
litest_event(dev, EV_KEY, button, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Not all devices can disable middle button emulation, time out on
|
||||
* middle button here to make sure the initial button press event
|
||||
* was flushed.
|
||||
*/
|
||||
litest_timeout_middlebutton();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -3365,9 +3365,9 @@ START_TEST(debounce_spurious)
|
|||
|
||||
litest_event(dev, EV_KEY, button, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -3396,16 +3396,16 @@ START_TEST(debounce_spurious_multibounce)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
|
||||
/* Not all devices can disable middle button emulation, time out on
|
||||
* middle button here to make sure the initial button press event
|
||||
* was flushed.
|
||||
*/
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_middlebutton();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -3446,9 +3446,9 @@ START_TEST(debounce_spurious_trigger_high_delay)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3459,22 +3459,22 @@ START_TEST(debounce_spurious_trigger_high_delay)
|
|||
* each single event. */
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(5);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(5);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
msleep(5);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3486,18 +3486,18 @@ START_TEST(debounce_spurious_trigger_high_delay)
|
|||
/* gets filtered now */
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -3521,9 +3521,9 @@ START_TEST(debounce_spurious_dont_enable_on_otherbutton)
|
|||
/* Don't trigger spurious debouncing on otherbutton events */
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
|
@ -3536,7 +3536,7 @@ START_TEST(debounce_spurious_dont_enable_on_otherbutton)
|
|||
litest_event(dev, EV_KEY, BTN_RIGHT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3563,13 +3563,13 @@ START_TEST(debounce_spurious_dont_enable_on_otherbutton)
|
|||
/* Expect release to be immediate */
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -3596,9 +3596,9 @@ START_TEST(debounce_spurious_cancel_debounce_otherbutton)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* spurious debouncing is on but the release should get flushed by
|
||||
* the other button */
|
||||
|
|
@ -3613,7 +3613,7 @@ START_TEST(debounce_spurious_cancel_debounce_otherbutton)
|
|||
litest_event(dev, EV_KEY, BTN_RIGHT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3653,9 +3653,9 @@ START_TEST(debounce_spurious_switch_to_otherbutton)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
|
@ -3672,7 +3672,7 @@ START_TEST(debounce_spurious_switch_to_otherbutton)
|
|||
litest_event(dev, EV_KEY, BTN_RIGHT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
|
|
@ -3706,14 +3706,14 @@ START_TEST(debounce_remove_device_button_up)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* delete the device while the timer is still active */
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_destroy_context(li);
|
||||
}
|
||||
|
|
@ -3731,14 +3731,14 @@ START_TEST(debounce_remove_device_button_down)
|
|||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* delete the device the timer is still active */
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_timeout_debounce();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_destroy_context(li);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ START_TEST(switch_toggle)
|
|||
|
||||
litest_grab_device(dev);
|
||||
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -127,7 +127,7 @@ START_TEST(switch_toggle)
|
|||
}
|
||||
|
||||
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -154,7 +154,7 @@ START_TEST(switch_toggle_double)
|
|||
|
||||
litest_grab_device(dev);
|
||||
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
|
||||
|
|
@ -163,7 +163,7 @@ START_TEST(switch_toggle_double)
|
|||
/* This will be filtered by the kernel, so this test is a bit
|
||||
* useless */
|
||||
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
litest_ungrab_device(dev);
|
||||
|
|
@ -207,7 +207,7 @@ START_TEST(switch_down_on_init)
|
|||
li = litest_create_context();
|
||||
libinput_path_add_device(li,
|
||||
libevdev_uinput_get_devnode(dev->uinput));
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_SWITCH_TOGGLE);
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -221,7 +221,7 @@ START_TEST(switch_down_on_init)
|
|||
}
|
||||
|
||||
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
|
||||
libinput_event_destroy(event);
|
||||
|
|
@ -252,7 +252,7 @@ START_TEST(switch_not_down_on_init)
|
|||
li = litest_create_context();
|
||||
libinput_path_add_device(li,
|
||||
libevdev_uinput_get_devnode(dev->uinput));
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li)) != NULL) {
|
||||
ck_assert_int_ne(libinput_event_get_type(event),
|
||||
|
|
@ -367,18 +367,18 @@ START_TEST(switch_disable_touchpad_edge_scroll)
|
|||
litest_ungrab_device(sw);
|
||||
|
||||
litest_touch_down(touchpad, 0, 99, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_edgescroll();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_move_to(touchpad, 0, 99, 20, 99, 80, 60);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_move_to(touchpad, 0, 99, 80, 99, 20, 60);
|
||||
litest_touch_up(touchpad, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_delete_device(touchpad);
|
||||
|
|
@ -402,16 +402,16 @@ START_TEST(switch_disable_touchpad_edge_scroll_interrupt)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(touchpad, 0, 99, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_edgescroll();
|
||||
litest_touch_move_to(touchpad, 0, 99, 20, 99, 30, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_only_axis_events(li, LIBINPUT_EVENT_POINTER_SCROLL_FINGER);
|
||||
|
||||
litest_grab_device(sw);
|
||||
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
||||
litest_ungrab_device(sw);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_axis_end_sequence(li,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_FINGER,
|
||||
|
|
@ -573,7 +573,7 @@ START_TEST(lid_open_on_key)
|
|||
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(keyboard, EV_KEY, KEY_A, 0);
|
||||
litest_event(keyboard, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_switch_event(event,
|
||||
|
|
@ -625,7 +625,7 @@ START_TEST(lid_open_on_key_touchpad_enabled)
|
|||
litest_touch_down(touchpad, 0, 50, 50);
|
||||
litest_touch_move_to(touchpad, 0, 50, 50, 70, 70, 10);
|
||||
litest_touch_up(touchpad, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
||||
|
|
@ -654,10 +654,10 @@ START_TEST(switch_suspend_with_keyboard)
|
|||
abort();
|
||||
}
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
keyboard = litest_add_device(li, LITEST_KEYBOARD);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_grab_device(sw);
|
||||
litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
|
||||
|
|
@ -670,7 +670,7 @@ START_TEST(switch_suspend_with_keyboard)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_delete_device(sw);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_destroy_context(li);
|
||||
}
|
||||
|
|
@ -854,10 +854,10 @@ START_TEST(lid_update_hw_on_key_multiple_keyboards)
|
|||
|
||||
keyboard1 = litest_add_device(li,
|
||||
LITEST_KEYBOARD_BLADE_STEALTH_VIDEOSWITCH);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
keyboard2 = litest_add_device(li, LITEST_KEYBOARD_BLADE_STEALTH);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_grab_device(sw);
|
||||
litest_switch_action(sw,
|
||||
|
|
@ -909,7 +909,7 @@ START_TEST(lid_key_press)
|
|||
|
||||
litest_keyboard_key(sw, KEY_VOLUMEUP, true);
|
||||
litest_keyboard_key(sw, KEY_VOLUMEUP, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Check that we're routing key events from a lid device too */
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
||||
|
|
@ -979,7 +979,7 @@ START_TEST(tablet_mode_disable_touchpad_on_resume)
|
|||
LIBINPUT_SWITCH_STATE_ON);
|
||||
litest_drain_events(li);
|
||||
libinput_resume(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -1010,7 +1010,7 @@ START_TEST(tablet_mode_disable_touchpad_on_resume)
|
|||
litest_switch_action(sw,
|
||||
LIBINPUT_SWITCH_TABLET_MODE,
|
||||
LIBINPUT_SWITCH_STATE_OFF);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_switch_event(event,
|
||||
LIBINPUT_SWITCH_TABLET_MODE,
|
||||
|
|
@ -1051,7 +1051,7 @@ START_TEST(tablet_mode_enable_touchpad_on_resume)
|
|||
LIBINPUT_SWITCH_STATE_OFF);
|
||||
|
||||
libinput_resume(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
|
||||
|
|
@ -1066,7 +1066,7 @@ START_TEST(tablet_mode_enable_touchpad_on_resume)
|
|||
litest_switch_action(sw,
|
||||
LIBINPUT_SWITCH_TABLET_MODE,
|
||||
LIBINPUT_SWITCH_STATE_ON);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_switch_event(event,
|
||||
LIBINPUT_SWITCH_TABLET_MODE,
|
||||
|
|
@ -1097,7 +1097,7 @@ START_TEST(tablet_mode_disable_keyboard)
|
|||
litest_keyboard_key(keyboard, KEY_A, true);
|
||||
litest_keyboard_key(keyboard, KEY_A, false);
|
||||
litest_keyboard_key(keyboard, KEY_B, true); /* KEY_B down but not up */
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_PRESSED);
|
||||
litest_assert_key_event(li, KEY_A, LIBINPUT_KEY_STATE_RELEASED);
|
||||
|
|
@ -1196,7 +1196,7 @@ START_TEST(tablet_mode_disable_keyboard_on_resume)
|
|||
litest_drain_events(li);
|
||||
|
||||
libinput_resume(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
enum libinput_event_type type;
|
||||
|
|
@ -1262,7 +1262,7 @@ START_TEST(tablet_mode_enable_keyboard_on_resume)
|
|||
LIBINPUT_SWITCH_STATE_OFF);
|
||||
|
||||
libinput_resume(li);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
|
||||
litest_keyboard_key(keyboard, KEY_A, true);
|
||||
|
|
@ -1381,10 +1381,10 @@ START_TEST(dock_toggle)
|
|||
|
||||
litest_grab_device(sw);
|
||||
litest_event(sw, EV_SW, SW_DOCK, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(sw, EV_SW, SW_DOCK, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_ungrab_device(sw);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -47,7 +47,7 @@ START_TEST(totem_type)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(dev, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event,
|
||||
|
|
@ -71,7 +71,7 @@ START_TEST(totem_axes)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(dev, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event,
|
||||
|
|
@ -96,7 +96,7 @@ START_TEST(totem_proximity_in_out)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(dev, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event,
|
||||
|
|
@ -114,7 +114,7 @@ START_TEST(totem_proximity_in_out)
|
|||
|
||||
litest_assert_empty_queue(li);
|
||||
litest_tablet_proximity_out(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event,
|
||||
|
|
@ -154,7 +154,7 @@ START_TEST(totem_proximity_in_on_init)
|
|||
devnode = libevdev_uinput_get_devnode(dev->uinput);
|
||||
li = litest_create_context();
|
||||
libinput_path_add_device(li, devnode);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -214,7 +214,7 @@ START_TEST(totem_proximity_out_on_suspend)
|
|||
|
||||
libinput_suspend(li);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event,
|
||||
LIBINPUT_EVENT_TABLET_TOOL_TIP);
|
||||
|
|
@ -249,7 +249,7 @@ START_TEST(totem_motion)
|
|||
struct libinput_event_tablet_tool *t;
|
||||
|
||||
litest_tablet_motion(dev, x + 1, y + 1, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS);
|
||||
|
|
@ -293,7 +293,7 @@ START_TEST(totem_rotation)
|
|||
|
||||
litest_axis_set_value(axes, ABS_MT_ORIENTATION, 50 + i);
|
||||
litest_tablet_motion(dev, 50, 50, axes);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS);
|
||||
|
|
@ -317,7 +317,7 @@ START_TEST(totem_rotation)
|
|||
|
||||
litest_axis_set_value(axes, ABS_MT_ORIENTATION, 50 - i);
|
||||
litest_tablet_motion(dev, 50, 50, axes);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS);
|
||||
|
|
@ -346,7 +346,7 @@ START_TEST(totem_size)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(dev, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||
|
|
@ -374,7 +374,7 @@ START_TEST(totem_button)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_button_click(dev, BTN_0, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
|
||||
ck_assert_int_eq(libinput_event_tablet_tool_get_button(t), BTN_0);
|
||||
|
|
@ -385,7 +385,7 @@ START_TEST(totem_button)
|
|||
libinput_event_destroy(event);
|
||||
|
||||
litest_button_click(dev, BTN_0, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
|
||||
|
|
@ -413,7 +413,7 @@ START_TEST(totem_button_down_on_init)
|
|||
devnode = libevdev_uinput_get_devnode(dev->uinput);
|
||||
li = litest_create_context();
|
||||
libinput_path_add_device(li, devnode);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -439,15 +439,15 @@ START_TEST(totem_button_down_on_init)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_button_click(dev, BTN_0, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
/* but buttons after this should be sent */
|
||||
litest_button_click(dev, BTN_0, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_tablet_button_event(li, BTN_0, LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
litest_button_click(dev, BTN_0, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_tablet_button_event(li, BTN_0, LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
litest_destroy_context(li);
|
||||
|
|
@ -467,7 +467,7 @@ START_TEST(totem_button_up_on_delete)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_tablet_button_event(li,
|
||||
BTN_0,
|
||||
|
|
@ -492,16 +492,16 @@ START_TEST(totem_arbitration_below)
|
|||
|
||||
/* touches below the totem, cancelled once the totem is down */
|
||||
litest_touch_down(touch, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_down_frame(li);
|
||||
litest_touch_move_to(touch, 0, 50, 50, 50, 70, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
while (libinput_next_event_type(li)) {
|
||||
litest_assert_touch_motion_frame(li);
|
||||
}
|
||||
|
||||
litest_tablet_proximity_in(totem, 50, 70, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_tablet_proximity_event(li, LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN);
|
||||
litest_assert_tablet_tip_event(li, LIBINPUT_TABLET_TOOL_TIP_DOWN);
|
||||
|
|
@ -530,7 +530,7 @@ START_TEST(totem_arbitration_during)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(totem, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -556,7 +556,7 @@ START_TEST(totem_arbitration_outside_rect)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_tablet_proximity_in(totem, 50, 50, NULL);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ START_TEST(totem_arbitration_outside_rect)
|
|||
litest_touch_down(touch, 0, 81, 51);
|
||||
litest_touch_move_to(touch, 0, 81, 50, 90, 80, 10);
|
||||
litest_touch_up(touch, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_touch_sequence(li);
|
||||
}
|
||||
|
|
@ -573,7 +573,7 @@ START_TEST(totem_arbitration_outside_rect)
|
|||
litest_touch_down(touch, 0, 81, 51);
|
||||
litest_touch_move_to(touch, 0, 81, 50, 50, 50, 10);
|
||||
litest_touch_up(touch, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_touch_sequence(li);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ START_TEST(touch_frame_events)
|
|||
litest_drain_events(dev->libinput);
|
||||
|
||||
litest_touch_down(dev, 0, 10, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(event) == LIBINPUT_EVENT_TOUCH_FRAME)
|
||||
|
|
@ -53,7 +53,7 @@ START_TEST(touch_frame_events)
|
|||
ck_assert_int_eq(have_frame_event, 1);
|
||||
|
||||
litest_touch_down(dev, 1, 10, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((event = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(event) == LIBINPUT_EVENT_TOUCH_FRAME)
|
||||
|
|
@ -72,12 +72,12 @@ START_TEST(touch_downup_no_motion)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 10, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_touch_down_frame(li);
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_touch_up_frame(li);
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ START_TEST(touch_abs_transform)
|
|||
|
||||
litest_touch_down(dev, 0, 100, 100);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
if (libinput_event_get_type(ev) != LIBINPUT_EVENT_TOUCH_DOWN) {
|
||||
|
|
@ -142,7 +142,7 @@ touch_assert_seat_slot(struct libinput *li,
|
|||
struct libinput_event *ev;
|
||||
struct libinput_event_touch *tev;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ev = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(ev, type);
|
||||
slot = libinput_event_touch_get_slot(tev);
|
||||
|
|
@ -227,7 +227,7 @@ START_TEST(touch_many_slots)
|
|||
for (slot = 0; slot < num_tps; ++slot)
|
||||
litest_touch_up(dev, slot);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
type = libinput_event_get_type(ev);
|
||||
|
||||
|
|
@ -237,13 +237,13 @@ START_TEST(touch_many_slots)
|
|||
break;
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert_notnull(ev);
|
||||
ck_assert_int_gt(slot_count, 0);
|
||||
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
do {
|
||||
type = libinput_event_get_type(ev);
|
||||
ck_assert_int_ne(type, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
|
@ -251,7 +251,7 @@ START_TEST(touch_many_slots)
|
|||
slot_count--;
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
} while ((ev = libinput_get_event(libinput)));
|
||||
|
||||
ck_assert_int_eq(slot_count, 0);
|
||||
|
|
@ -278,7 +278,7 @@ START_TEST(touch_double_touch_down_up)
|
|||
litest_touch_down(dev, 0, 0, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
litest_restore_log_handler(libinput);
|
||||
|
||||
while ((ev = libinput_get_event(libinput))) {
|
||||
|
|
@ -297,7 +297,7 @@ START_TEST(touch_double_touch_down_up)
|
|||
}
|
||||
|
||||
libinput_event_destroy(ev);
|
||||
libinput_dispatch(libinput);
|
||||
litest_dispatch(libinput);
|
||||
}
|
||||
|
||||
ck_assert(got_down);
|
||||
|
|
@ -330,7 +330,7 @@ START_TEST(touch_calibration_scale)
|
|||
|
||||
litest_touch_down(dev, 0, 100, 100);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
|
@ -400,7 +400,7 @@ START_TEST(touch_calibration_rotation)
|
|||
|
||||
litest_touch_down(dev, 0, 80, 20);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ev = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
||||
|
|
@ -464,7 +464,7 @@ START_TEST(touch_calibration_translation)
|
|||
litest_touch_down(dev, 0, 100, 100);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ev = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
||||
|
|
@ -568,7 +568,7 @@ START_TEST(touch_calibrated_screen_udev)
|
|||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
struct libinput_device *d;
|
||||
|
|
@ -641,7 +641,7 @@ START_TEST(fake_mt_exists)
|
|||
struct libinput_event *event;
|
||||
struct libinput_device *device;
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
device = libinput_event_get_device(event);
|
||||
|
|
@ -706,7 +706,7 @@ START_TEST(touch_protocol_a_touch)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 5, 95);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
|
@ -721,7 +721,7 @@ START_TEST(touch_protocol_a_touch)
|
|||
libinput_event_destroy(ev);
|
||||
|
||||
litest_touch_move_to(dev, 0, 10, 90, 90, 10, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(ev) ==
|
||||
|
|
@ -746,7 +746,7 @@ START_TEST(touch_protocol_a_touch)
|
|||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ev = libinput_get_event(li);
|
||||
litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_UP);
|
||||
libinput_event_destroy(ev);
|
||||
|
|
@ -766,7 +766,7 @@ START_TEST(touch_protocol_a_2fg_touch)
|
|||
litest_touch_down(dev, 0, 5, 95);
|
||||
litest_touch_down(dev, 1, 95, 5);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_down_frame(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
|
|
@ -780,7 +780,7 @@ START_TEST(touch_protocol_a_2fg_touch)
|
|||
for (pos = 10; pos < 100; pos += 10) {
|
||||
litest_touch_move(dev, 0, pos, 100 - pos);
|
||||
litest_touch_move(dev, 1, 100 - pos, pos);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
tev = libinput_event_get_touch_event(ev);
|
||||
|
|
@ -802,11 +802,11 @@ START_TEST(touch_protocol_a_2fg_touch)
|
|||
}
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_up_frame(li);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_up_frame(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -847,8 +847,8 @@ START_TEST(touch_initial_state)
|
|||
litest_touch_down(dev, 0, 70, 60);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
libinput_dispatch(libinput1);
|
||||
libinput_dispatch(libinput2);
|
||||
litest_dispatch(libinput1);
|
||||
litest_dispatch(libinput2);
|
||||
|
||||
while (libinput_next_event_type(libinput1)) {
|
||||
ev1 = libinput_get_event(libinput1);
|
||||
|
|
@ -893,7 +893,7 @@ START_TEST(touch_time_usec)
|
|||
litest_drain_events(dev->libinput);
|
||||
|
||||
litest_touch_down(dev, 0, 10, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
tev = litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
|
@ -920,7 +920,7 @@ START_TEST(touch_fuzz)
|
|||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, y);
|
||||
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_DOWN);
|
||||
|
|
@ -942,7 +942,7 @@ START_TEST(touch_fuzz)
|
|||
litest_event(dev, EV_ABS, ABS_MT_POSITION_X, x);
|
||||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, y);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
}
|
||||
|
|
@ -989,7 +989,7 @@ START_TEST(touch_release_on_unplug)
|
|||
|
||||
/* Touch is still down when device is removed, expect a release */
|
||||
litest_delete_device(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
ev = libinput_get_event(li);
|
||||
litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_CANCEL);
|
||||
|
|
@ -1026,7 +1026,7 @@ START_TEST(touch_invalid_range_over)
|
|||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 5000);
|
||||
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Expect the mm to be correct regardless */
|
||||
ev = libinput_get_event(li);
|
||||
|
|
@ -1065,7 +1065,7 @@ START_TEST(touch_invalid_range_under)
|
|||
litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 1000);
|
||||
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Expect the mm to be correct regardless */
|
||||
ev = libinput_get_event(li);
|
||||
|
|
@ -1146,7 +1146,7 @@ START_TEST(touch_palm_detect_tool_palm)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to_extended(dev, 0, 50, 50, 70, 70, axes, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_cancel(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 70, 70, 50, 40, 10);
|
||||
|
|
@ -1173,7 +1173,7 @@ START_TEST(touch_palm_detect_tool_palm_on_off)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to_extended(dev, 0, 50, 50, 70, 70, axes, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_cancel(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 70, 70, 50, 40, 10);
|
||||
|
|
@ -1236,15 +1236,15 @@ START_TEST(touch_palm_detect_tool_palm_2fg)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to_extended(dev, 0, 50, 50, 70, 70, axes, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_cancel(li);
|
||||
|
||||
litest_touch_move_to(dev, 1, 50, 50, 70, 70, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_motion_frame(li);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_up_frame(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 70, 70, 50, 40, 10);
|
||||
|
|
@ -1272,11 +1272,11 @@ START_TEST(touch_palm_detect_tool_palm_on_off_2fg)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to_extended(dev, 0, 50, 50, 70, 70, axes, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_cancel(li);
|
||||
|
||||
litest_touch_move_to(dev, 1, 50, 50, 70, 70, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_motion_frame(li);
|
||||
|
||||
litest_axis_set_value(axes, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER);
|
||||
|
|
@ -1284,11 +1284,11 @@ START_TEST(touch_palm_detect_tool_palm_on_off_2fg)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_move_to(dev, 1, 70, 70, 50, 40, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_motion_frame(li);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_up_frame(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 70, 70, 50, 40, 10);
|
||||
|
|
@ -1318,7 +1318,7 @@ START_TEST(touch_palm_detect_tool_palm_keep_type_2fg)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_move_to(dev, 1, 50, 50, 70, 70, 10);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_motion_frame(li);
|
||||
|
||||
/* ABS_MT_TOOL_TYPE never reset to finger, so a new touch
|
||||
|
|
@ -1333,7 +1333,7 @@ START_TEST(touch_palm_detect_tool_palm_keep_type_2fg)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_touch_up_frame(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
|
|||
|
|
@ -43,12 +43,12 @@ START_TEST(touchpad_button)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_button_click(dev, BTN_LEFT, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
litest_button_click(dev, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li,
|
||||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -197,7 +197,7 @@ START_TEST(touchpad_1fg_clickfinger)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -226,7 +226,7 @@ START_TEST(touchpad_1fg_clickfinger_no_touch)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -249,7 +249,7 @@ START_TEST(touchpad_1fg_clickfinger_no_touch_phantomclicks)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ START_TEST(touchpad_2fg_clickfinger)
|
|||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -333,7 +333,7 @@ START_TEST(touchpad_3fg_clickfinger)
|
|||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -386,7 +386,7 @@ START_TEST(touchpad_3fg_clickfinger_btntool)
|
|||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
button,
|
||||
|
|
@ -422,7 +422,7 @@ START_TEST(touchpad_4fg_clickfinger)
|
|||
litest_touch_up(dev, 2);
|
||||
litest_touch_up(dev, 3);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -490,7 +490,7 @@ START_TEST(touchpad_4fg_clickfinger_btntool_3slots)
|
|||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -639,11 +639,11 @@ START_TEST(touchpad_3fg_clickfinger_distance_btntool)
|
|||
|
||||
litest_touch_down(dev, 0, 90, 15);
|
||||
litest_touch_down(dev, 1, 10, 15);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
|
|
@ -745,7 +745,7 @@ START_TEST(touchpad_clickfinger_to_area_method)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -763,7 +763,7 @@ START_TEST(touchpad_clickfinger_to_area_method)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -785,7 +785,7 @@ START_TEST(touchpad_clickfinger_to_area_method_while_down)
|
|||
litest_touch_down(dev, 0, 95, 95);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
||||
|
|
@ -794,7 +794,7 @@ START_TEST(touchpad_clickfinger_to_area_method_while_down)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -808,7 +808,7 @@ START_TEST(touchpad_clickfinger_to_area_method_while_down)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -834,7 +834,7 @@ START_TEST(touchpad_area_to_clickfinger_method)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -849,7 +849,7 @@ START_TEST(touchpad_area_to_clickfinger_method)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -880,7 +880,7 @@ START_TEST(touchpad_area_to_clickfinger_method_while_down)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
|
@ -891,7 +891,7 @@ START_TEST(touchpad_area_to_clickfinger_method_while_down)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -916,13 +916,13 @@ START_TEST(touchpad_clickfinger_3fg_tool_position)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -944,13 +944,13 @@ START_TEST(touchpad_clickfinger_4fg_tool_position)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_QUADTAP, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
|
|
@ -1000,7 +1000,7 @@ START_TEST(touchpad_clickfinger_appletouch_1fg)
|
|||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -1027,7 +1027,7 @@ START_TEST(touchpad_clickfinger_appletouch_2fg)
|
|||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -1056,7 +1056,7 @@ START_TEST(touchpad_clickfinger_appletouch_3fg)
|
|||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 2);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -1100,7 +1100,7 @@ START_TEST(touchpad_clickfinger_click_drag)
|
|||
|
||||
litest_button_click(dev, BTN_LEFT, true);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li, button,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
||||
|
|
@ -1120,7 +1120,7 @@ START_TEST(touchpad_clickfinger_click_drag)
|
|||
break;
|
||||
}
|
||||
litest_pop_event_frame(dev);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
|
||||
|
|
@ -1149,7 +1149,7 @@ START_TEST(touchpad_clickfinger_click_drag)
|
|||
litest_touch_up(dev, 0);
|
||||
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -1166,7 +1166,7 @@ START_TEST(touchpad_btn_left)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -1191,7 +1191,7 @@ START_TEST(clickpad_btn_left)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 0);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
|
||||
}
|
||||
END_TEST
|
||||
|
|
@ -1207,11 +1207,11 @@ START_TEST(clickpad_click_n_drag)
|
|||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_button_event(li, BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
|
||||
|
||||
/* now put a second finger down */
|
||||
|
|
@ -1307,7 +1307,7 @@ START_TEST(clickpad_softbutton_left)
|
|||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -1336,7 +1336,7 @@ START_TEST(clickpad_softbutton_middle)
|
|||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -1365,7 +1365,7 @@ START_TEST(clickpad_softbutton_right)
|
|||
BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -1485,15 +1485,15 @@ START_TEST(clickpad_softbutton_left_1st_fg_move)
|
|||
|
||||
/* move out of the area, then wait for softbutton timer */
|
||||
litest_touch_move_to(dev, 0, 20, 90, 50, 50, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_softbuttons();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_drain_events(li);
|
||||
|
||||
/* move down left, expect motion */
|
||||
litest_touch_move_to(dev, 0, 50, 50, 20, 90, 20);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
while (event) {
|
||||
|
|
@ -1512,7 +1512,7 @@ START_TEST(clickpad_softbutton_left_1st_fg_move)
|
|||
nevents++;
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
}
|
||||
|
||||
|
|
@ -1559,7 +1559,7 @@ START_TEST(clickpad_softbutton_left_2nd_fg_move)
|
|||
litest_touch_down(dev, 1, 20, 20);
|
||||
litest_touch_move_to(dev, 1, 20, 20, 80, 20, 25);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
while (event) {
|
||||
|
|
@ -1581,7 +1581,7 @@ START_TEST(clickpad_softbutton_left_2nd_fg_move)
|
|||
}
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
}
|
||||
litest_touch_up(dev, 1);
|
||||
|
|
@ -1590,7 +1590,7 @@ START_TEST(clickpad_softbutton_left_2nd_fg_move)
|
|||
litest_touch_down(dev, 1, 20, 20);
|
||||
litest_touch_move_to(dev, 1, 20, 20, 20, 80, 15);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
while (event) {
|
||||
|
|
@ -1608,7 +1608,7 @@ START_TEST(clickpad_softbutton_left_2nd_fg_move)
|
|||
ck_assert(y > 0);
|
||||
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
}
|
||||
|
||||
|
|
@ -1706,14 +1706,14 @@ START_TEST(clickpad_softbutton_hover_into_buttons)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_hover_start(dev, 0, 50, 50);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_hover_move_to(dev, 0, 50, 50, 90, 90, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 90, 90, 91, 91, 1);
|
||||
|
||||
litest_button_click(dev, BTN_LEFT, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_RIGHT,
|
||||
|
|
@ -1827,13 +1827,13 @@ START_TEST(clickpad_topsoftbuttons_move_out_leftclick_before_timeout)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 80, 5);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_softbuttons();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 80, 5, 80, 90, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
|
@ -1861,15 +1861,15 @@ START_TEST(clickpad_topsoftbuttons_move_out_leftclick)
|
|||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 80, 5);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_softbuttons();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_move_to(dev, 0, 80, 5, 80, 90, 20);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_timeout_softbuttons();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
|
|
@ -1988,7 +1988,7 @@ START_TEST(clickpad_middleemulation_config_delayed)
|
|||
litest_touch_down(dev, 0, 30, 95);
|
||||
litest_event(dev, EV_KEY, BTN_LEFT, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* actual config is delayed, but status is immediate */
|
||||
status = libinput_device_config_middle_emulation_set_enabled(device,
|
||||
|
|
@ -2033,7 +2033,7 @@ START_TEST(clickpad_middleemulation_click)
|
|||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -2064,7 +2064,7 @@ START_TEST(clickpad_middleemulation_click_middle_left)
|
|||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -2095,7 +2095,7 @@ START_TEST(clickpad_middleemulation_click_middle_right)
|
|||
BTN_RIGHT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
}
|
||||
|
|
@ -2127,7 +2127,7 @@ START_TEST(clickpad_middleemulation_click_enable_while_down)
|
|||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
|
|
@ -2145,7 +2145,7 @@ START_TEST(clickpad_middleemulation_click_enable_while_down)
|
|||
BTN_LEFT,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
@ -2178,7 +2178,7 @@ START_TEST(clickpad_middleemulation_click_disable_while_down)
|
|||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
|
|
@ -2196,7 +2196,7 @@ START_TEST(clickpad_middleemulation_click_disable_while_down)
|
|||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -139,7 +139,7 @@ START_TEST(trackball_rotation_x)
|
|||
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
@ -189,7 +189,7 @@ START_TEST(trackball_rotation_y)
|
|||
|
||||
litest_event(dev, EV_REL, REL_Y, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
@ -241,7 +241,7 @@ START_TEST(trackball_rotation_accel)
|
|||
litest_event(dev, EV_REL, REL_Y, 1);
|
||||
litest_event(dev, EV_REL, REL_X, 1);
|
||||
litest_event(dev, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ptrev = litest_is_motion_event(event);
|
||||
|
|
|
|||
|
|
@ -192,9 +192,9 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_trackpoint)
|
|||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
||||
litest_touch_down(touchpad, 0, 5, 5);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
|
|
@ -205,7 +205,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_trackpoint)
|
|||
libinput_event_destroy(event);
|
||||
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_RIGHT,
|
||||
|
|
@ -237,9 +237,9 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_touchpad)
|
|||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
||||
litest_touch_down(touchpad, 0, 5, 5);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
|
|
@ -248,7 +248,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_touchpad)
|
|||
libinput_event_destroy(event);
|
||||
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_LEFT,
|
||||
|
|
@ -283,9 +283,9 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both)
|
|||
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||
|
||||
litest_touch_down(touchpad, 0, 5, 5);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, true);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
|
|
@ -296,7 +296,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both)
|
|||
libinput_event_destroy(event);
|
||||
|
||||
litest_button_click_debounced(touchpad, li, BTN_LEFT, false);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
litest_is_button_event(event,
|
||||
BTN_RIGHT,
|
||||
|
|
@ -348,7 +348,7 @@ START_TEST(trackpoint_palmdetect)
|
|||
litest_event(trackpoint, EV_REL, REL_X, 1);
|
||||
litest_event(trackpoint, EV_REL, REL_Y, 1);
|
||||
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ START_TEST(trackpoint_palmdetect)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_timeout_trackpoint();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_touch_down(touchpad, 0, 30, 30);
|
||||
litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10);
|
||||
|
|
@ -387,7 +387,7 @@ START_TEST(trackpoint_palmdetect_dwtp_disabled)
|
|||
litest_event(trackpoint, EV_REL, REL_X, 1);
|
||||
litest_event(trackpoint, EV_REL, REL_Y, 1);
|
||||
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -419,7 +419,7 @@ START_TEST(trackpoint_palmdetect_resume_touch)
|
|||
litest_event(trackpoint, EV_REL, REL_X, 1);
|
||||
litest_event(trackpoint, EV_REL, REL_Y, 1);
|
||||
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
}
|
||||
litest_drain_events(li);
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ START_TEST(trackpoint_palmdetect_resume_touch)
|
|||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_timeout_trackpoint();
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* touch started after last tp event, expect resume */
|
||||
litest_touch_move_to(touchpad, 0, 80, 80, 30, 30, 10);
|
||||
|
|
@ -457,7 +457,7 @@ START_TEST(trackpoint_palmdetect_require_min_events)
|
|||
litest_event(trackpoint, EV_REL, REL_X, 1);
|
||||
litest_event(trackpoint, EV_REL, REL_Y, 1);
|
||||
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(touchpad, 0, 30, 30);
|
||||
|
|
@ -488,7 +488,7 @@ START_TEST(trackpoint_palmdetect_require_min_events_timeout)
|
|||
litest_event(trackpoint, EV_REL, REL_X, 1);
|
||||
litest_event(trackpoint, EV_REL, REL_Y, 1);
|
||||
litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(touchpad, 0, 30, 30);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ START_TEST(udev_create_seat0)
|
|||
ck_assert_int_ge(fd, 0);
|
||||
|
||||
/* expect at least one event */
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ START_TEST(udev_create_empty_seat)
|
|||
fd = libinput_get_fd(li);
|
||||
ck_assert_int_ge(fd, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert(event == NULL);
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ START_TEST(udev_added_seat_default)
|
|||
li = libinput_udev_create_context(&simple_interface, NULL, udev);
|
||||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Drop any events from other devices */
|
||||
litest_drain_events(li);
|
||||
|
|
@ -235,7 +235,7 @@ START_TEST(udev_change_seat)
|
|||
li = libinput_udev_create_context(&simple_interface, NULL, udev);
|
||||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
/* Drop any events from other devices */
|
||||
litest_drain_events(li);
|
||||
|
|
@ -262,7 +262,7 @@ START_TEST(udev_change_seat)
|
|||
seat2_name);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_int_eq(libinput_event_get_type(event),
|
||||
|
|
@ -313,7 +313,7 @@ START_TEST(udev_double_suspend)
|
|||
ck_assert_int_ge(fd, 0);
|
||||
|
||||
/* expect at least one event */
|
||||
ck_assert_int_ge(libinput_dispatch(li), 0);
|
||||
ck_assert_int_ge(litest_dispatch(li), 0);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
||||
|
|
@ -345,7 +345,7 @@ START_TEST(udev_double_resume)
|
|||
ck_assert_int_ge(fd, 0);
|
||||
|
||||
/* expect at least one event */
|
||||
ck_assert_int_ge(libinput_dispatch(li), 0);
|
||||
ck_assert_int_ge(litest_dispatch(li), 0);
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
||||
|
|
@ -397,19 +397,19 @@ START_TEST(udev_suspend_resume)
|
|||
ck_assert_int_ge(fd, 0);
|
||||
|
||||
/* Check that at least one device was discovered after creation. */
|
||||
ck_assert_int_ge(libinput_dispatch(li), 0);
|
||||
ck_assert_int_ge(litest_dispatch(li), 0);
|
||||
process_events_count_devices(li, &num_devices);
|
||||
ck_assert_int_gt(num_devices, 0);
|
||||
|
||||
/* Check that after a suspend, no devices are left. */
|
||||
libinput_suspend(li);
|
||||
ck_assert_int_ge(libinput_dispatch(li), 0);
|
||||
ck_assert_int_ge(litest_dispatch(li), 0);
|
||||
process_events_count_devices(li, &num_devices);
|
||||
ck_assert_int_eq(num_devices, 0);
|
||||
|
||||
/* Check that after a resume, at least one device is discovered. */
|
||||
libinput_resume(li);
|
||||
ck_assert_int_ge(libinput_dispatch(li), 0);
|
||||
ck_assert_int_ge(litest_dispatch(li), 0);
|
||||
process_events_count_devices(li, &num_devices);
|
||||
ck_assert_int_gt(num_devices, 0);
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ START_TEST(udev_device_sysname)
|
|||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
if (libinput_event_get_type(ev) !=
|
||||
|
|
@ -516,7 +516,7 @@ START_TEST(udev_seat_recycle)
|
|||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
switch (libinput_event_get_type(ev)) {
|
||||
case LIBINPUT_EVENT_DEVICE_ADDED:
|
||||
|
|
@ -544,7 +544,7 @@ START_TEST(udev_seat_recycle)
|
|||
|
||||
libinput_resume(li);
|
||||
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
while ((ev = libinput_get_event(li))) {
|
||||
switch (libinput_event_get_type(ev)) {
|
||||
case LIBINPUT_EVENT_DEVICE_ADDED:
|
||||
|
|
@ -608,7 +608,7 @@ START_TEST(udev_path_remove_device)
|
|||
li = libinput_udev_create_context(&simple_interface, NULL, udev);
|
||||
ck_assert_notnull(li);
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_DEVICE_ADDED);
|
||||
event = libinput_get_event(li);
|
||||
|
|
@ -646,7 +646,7 @@ START_TEST(udev_ignore_device)
|
|||
litest_restore_log_handler(li);
|
||||
|
||||
ck_assert_int_eq(libinput_udev_assign_seat(li, "seat0"), 0);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
|
||||
event = libinput_get_event(li);
|
||||
ck_assert_notnull(event);
|
||||
|
|
@ -660,7 +660,7 @@ START_TEST(udev_ignore_device)
|
|||
ck_assert_str_ne(devname, name);
|
||||
}
|
||||
libinput_event_destroy(event);
|
||||
libinput_dispatch(li);
|
||||
litest_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue