From 2ab0db9ee9d933d18916f95d43ed06a3878b717d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 12 Mar 2015 20:05:24 +0100 Subject: [PATCH] litest: Make touchpad_2fg_scroll_slow_distance take resolution into account Currently touchpad_2fg_scroll_slow_distance always moves the touches 10% of the touchpad height during the test. On the wacom-intuos-finger test device this is a much larger distance then on the synaptics test device, triggering ck_assert(axisval < 5.0) errors with further patches in this set, this commit fixes this. Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- test/touchpad.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/touchpad.c b/test/touchpad.c index ff4edb04..36fe6e43 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -1864,13 +1864,24 @@ START_TEST(touchpad_2fg_scroll_slow_distance) struct libinput *li = dev->libinput; struct libinput_event *event; struct libinput_event_pointer *ptrev; + const struct input_absinfo *y; + double y_move; + + /* We want to move > 5 mm. */ + y = libevdev_get_abs_info(dev->evdev, ABS_Y); + if (y->resolution) { + y_move = 7.0 * y->resolution / + (y->maximum - y->minimum) * 100; + } else { + y_move = 10.0; + } litest_drain_events(li); litest_touch_down(dev, 0, 20, 30); litest_touch_down(dev, 1, 40, 30); - litest_touch_move_to(dev, 0, 20, 30, 20, 40, 70, 10); - litest_touch_move_to(dev, 1, 40, 30, 40, 40, 70, 10); + litest_touch_move_to(dev, 0, 20, 30, 20, 30 + y_move, 70, 10); + litest_touch_move_to(dev, 1, 40, 30, 40, 30 + y_move, 70, 10); litest_touch_up(dev, 1); litest_touch_up(dev, 0); libinput_dispatch(li);