diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-06-20 09:26:44 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-06-20 09:26:44 +1000 |
commit | 28f75d9f9debf4fcc78029e2ddca5c7feac06571 (patch) | |
tree | 12955d3bc612996b4f06d160db3c5147ac109c80 /test | |
parent | 9bb0cfd8785294a735407c862d7b59621a4ec98d (diff) | |
parent | 48473994c8e60189356feae7b7eae25288e5ac28 (diff) |
Merge branch 'wip/touchpad-drop-hysteresis'
Diffstat (limited to 'test')
-rw-r--r-- | test/litest-device-synaptics-x1-carbon-3rd.c | 1 | ||||
-rw-r--r-- | test/litest.c | 34 | ||||
-rw-r--r-- | test/litest.h | 7 | ||||
-rw-r--r-- | test/touchpad.c | 69 |
4 files changed, 10 insertions, 101 deletions
diff --git a/test/litest-device-synaptics-x1-carbon-3rd.c b/test/litest-device-synaptics-x1-carbon-3rd.c index 9d4034d..23d9c5b 100644 --- a/test/litest-device-synaptics-x1-carbon-3rd.c +++ b/test/litest-device-synaptics-x1-carbon-3rd.c @@ -121,7 +121,6 @@ static const char udev_rule[] = "\n" "ATTRS{name}==\"litest SynPS/2 Synaptics TouchPad X1C3rd\"," " ENV{LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD}=\"1\"\n" -" ENV{LIBINPUT_MODEL_PRECISE_TOUCHPAD}=\"1\"\n" "\n" "LABEL=\"touchpad_end\""; diff --git a/test/litest.c b/test/litest.c index cb98f7f..d5e33dc 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1504,39 +1504,23 @@ litest_touch_move_extended(struct litest_device *d, } void -litest_touch_move_to_extended(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - double x_to, double y_to, - struct axis_replacement *axes, - int steps, int sleep_ms) +litest_touch_move_to(struct litest_device *d, + unsigned int slot, + double x_from, double y_from, + double x_to, double y_to, + int steps, int sleep_ms) { for (int i = 0; i < steps - 1; i++) { - litest_touch_move_extended(d, slot, - x_from + (x_to - x_from)/steps * i, - y_from + (y_to - y_from)/steps * i, - axes); + litest_touch_move(d, slot, + x_from + (x_to - x_from)/steps * i, + y_from + (y_to - y_from)/steps * i); if (sleep_ms) { libinput_dispatch(d->libinput); msleep(sleep_ms); libinput_dispatch(d->libinput); } } - litest_touch_move_extended(d, slot, x_to, y_to, axes); -} - -void -litest_touch_move_to(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - double x_to, double y_to, - int steps, int sleep_ms) -{ - litest_touch_move_to_extended(d, slot, - x_from, y_from, - x_to, y_to, - NULL, - steps, sleep_ms); + litest_touch_move(d, slot, x_to, y_to); } static int diff --git a/test/litest.h b/test/litest.h index 9841918..c830928 100644 --- a/test/litest.h +++ b/test/litest.h @@ -412,13 +412,6 @@ litest_touch_move_to(struct litest_device *d, double x_from, double y_from, double x_to, double y_to, int steps, int sleep_ms); -void -litest_touch_move_to_extended(struct litest_device *d, - unsigned int slot, - double x_from, double y_from, - double x_to, double y_to, - struct axis_replacement *axes, - int steps, int sleep_ms); void litest_touch_move_two_touches(struct litest_device *d, diff --git a/test/touchpad.c b/test/touchpad.c index 0b1cd0e..5c63202 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -3650,7 +3650,7 @@ START_TEST(touchpad_thumb_edgescroll) libinput_dispatch(li); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); - litest_touch_move_to_extended(dev, 0, 99, 55, 99, 70, axes, 10, 0); + litest_touch_move_to(dev, 0, 99, 55, 99, 70, 10, 0); litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); } @@ -3980,72 +3980,6 @@ START_TEST(touchpad_tool_tripletap_touch_count) } END_TEST -START_TEST(touchpad_t450_motion_drops) -{ - struct litest_device *dev = litest_current_device(); - struct libinput *li = dev->libinput; - struct libinput_event *event; - struct libinput_event_pointer *ptrev; - int i; - double d; - - /* In some areas on the touchpad we only get pressure events. - * https://bugs.freedesktop.org/show_bug.cgi?id=94379 - */ - litest_drain_events(li); - - litest_touch_down(dev, 0, 50, 50); - - for (i = 0; i < 10; i++) { - litest_event(dev, EV_ABS, ABS_MT_SLOT, 0); - litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 3000 - i); - litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3000 - i); - litest_event(dev, EV_ABS, ABS_MT_PRESSURE, 30); - litest_event(dev, EV_ABS, ABS_X, 3000 - i); - litest_event(dev, EV_ABS, ABS_Y, 3000 - i); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - litest_drain_events(li); - } - - /* several pressure-only events */ - - for (i = 0; i< 20; i++) { - litest_event(dev, EV_ABS, ABS_MT_PRESSURE, 30 + i % 2); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30 + i % 2); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - litest_assert_empty_queue(li); - } - - /* a 100 unit jump followed by fine-grained motion, we expect small - * motions without the jump */ - - for (i = 0; i < 10; i++) { - litest_event(dev, EV_ABS, ABS_MT_SLOT, 0); - litest_event(dev, EV_ABS, ABS_MT_POSITION_X, 3100 + i); - litest_event(dev, EV_ABS, ABS_MT_POSITION_Y, 3100 + i); - litest_event(dev, EV_ABS, ABS_X, 3100 + i); - litest_event(dev, EV_ABS, ABS_Y, 3100 + i); - litest_event(dev, EV_ABS, ABS_PRESSURE, 30); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - libinput_dispatch(li); - } - - event = libinput_get_event(li); - ck_assert_notnull(event); - while (event) { - ptrev = litest_is_motion_event(event); - d = libinput_event_pointer_get_dx(ptrev); - litest_assert_double_lt(d, 1.0); - d = libinput_event_pointer_get_dy(ptrev); - litest_assert_double_lt(d, 1.0); - libinput_event_destroy(event); - - event = libinput_get_event(li); - } -} -END_TEST - START_TEST(touchpad_time_usec) { struct litest_device *dev = litest_current_device(); @@ -4236,7 +4170,6 @@ litest_setup_tests(void) litest_add("touchpad:thumb", touchpad_thumb_tap_hold_2ndfg_tap, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH); litest_add_for_device("touchpad:bugs", touchpad_tool_tripletap_touch_count, LITEST_SYNAPTICS_TOPBUTTONPAD); - litest_add_for_device("touchpad:bugs", touchpad_t450_motion_drops, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS); litest_add("touchpad:time", touchpad_time_usec, LITEST_TOUCHPAD, LITEST_ANY); |