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 <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Hans de Goede 2015-03-12 20:05:24 +01:00 committed by Peter Hutterer
parent 8ffc213408
commit 2ab0db9ee9

View file

@ -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);