test: fetch the is-touchpad in arbitration tests from a input property

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-01-04 14:21:38 +10:00
parent 9b42872ee6
commit d4e6a6aadc

View file

@ -4225,8 +4225,7 @@ END_TEST
static void static void
touch_arbitration(struct litest_device *dev, touch_arbitration(struct litest_device *dev,
enum litest_device_type other, enum litest_device_type other)
bool is_touchpad)
{ {
struct litest_device *finger; struct litest_device *finger;
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
@ -4235,10 +4234,13 @@ touch_arbitration(struct litest_device *dev,
{ ABS_PRESSURE, 0 }, { ABS_PRESSURE, 0 },
{ -1, -1 } { -1, -1 }
}; };
bool is_touchpad;
finger = litest_add_device(li, other); finger = litest_add_device(li, other);
litest_drain_events(li); litest_drain_events(li);
is_touchpad = !libevdev_has_property(finger->evdev, INPUT_PROP_DIRECT);
litest_tablet_proximity_in(dev, 10, 10, axes); litest_tablet_proximity_in(dev, 10, 10, axes);
litest_tablet_motion(dev, 10, 10, axes); litest_tablet_motion(dev, 10, 10, axes);
litest_tablet_motion(dev, 20, 40, axes); litest_tablet_motion(dev, 20, 40, axes);
@ -4281,22 +4283,20 @@ touch_arbitration(struct litest_device *dev,
START_TEST(intuos_touch_arbitration) START_TEST(intuos_touch_arbitration)
{ {
touch_arbitration(litest_current_device(), LITEST_WACOM_FINGER, true); touch_arbitration(litest_current_device(), LITEST_WACOM_FINGER);
} }
END_TEST END_TEST
START_TEST(cintiq_touch_arbitration) START_TEST(cintiq_touch_arbitration)
{ {
touch_arbitration(litest_current_device(), touch_arbitration(litest_current_device(),
LITEST_WACOM_CINTIQ_13HDT_FINGER, LITEST_WACOM_CINTIQ_13HDT_FINGER);
false);
} }
END_TEST END_TEST
static void static void
touch_arbitration_stop_touch(struct litest_device *dev, touch_arbitration_stop_touch(struct litest_device *dev,
enum litest_device_type other, enum litest_device_type other)
bool is_touchpad)
{ {
struct litest_device *finger; struct litest_device *finger;
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
@ -4305,8 +4305,12 @@ touch_arbitration_stop_touch(struct litest_device *dev,
{ ABS_PRESSURE, 0 }, { ABS_PRESSURE, 0 },
{ -1, -1 } { -1, -1 }
}; };
bool is_touchpad;
finger = litest_add_device(li, other); finger = litest_add_device(li, other);
is_touchpad = !libevdev_has_property(finger->evdev, INPUT_PROP_DIRECT);
litest_touch_down(finger, 0, 30, 30); litest_touch_down(finger, 0, 30, 30);
litest_touch_move_to(finger, 0, 30, 30, 80, 80, 10); litest_touch_move_to(finger, 0, 30, 30, 80, 80, 10);
@ -4361,23 +4365,20 @@ touch_arbitration_stop_touch(struct litest_device *dev,
START_TEST(intuos_touch_arbitration_stop_touch) START_TEST(intuos_touch_arbitration_stop_touch)
{ {
touch_arbitration_stop_touch(litest_current_device(), touch_arbitration_stop_touch(litest_current_device(),
LITEST_WACOM_FINGER, LITEST_WACOM_FINGER);
true);
} }
END_TEST END_TEST
START_TEST(cintiq_touch_arbitration_stop_touch) START_TEST(cintiq_touch_arbitration_stop_touch)
{ {
touch_arbitration_stop_touch(litest_current_device(), touch_arbitration_stop_touch(litest_current_device(),
LITEST_WACOM_CINTIQ_13HDT_FINGER, LITEST_WACOM_CINTIQ_13HDT_FINGER);
false);
} }
END_TEST END_TEST
static void static void
touch_arbitration_suspend_touch(struct litest_device *dev, touch_arbitration_suspend_touch(struct litest_device *dev,
enum litest_device_type other, enum litest_device_type other)
bool is_touchpad)
{ {
struct litest_device *tablet; struct litest_device *tablet;
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
@ -4387,9 +4388,12 @@ touch_arbitration_suspend_touch(struct litest_device *dev,
{ ABS_PRESSURE, 0 }, { ABS_PRESSURE, 0 },
{ -1, -1 } { -1, -1 }
}; };
bool is_touchpad;
tablet = litest_add_device(li, other); tablet = litest_add_device(li, other);
is_touchpad = !libevdev_has_property(dev->evdev, INPUT_PROP_DIRECT);
/* we can't force a device suspend, but we can at least make sure /* we can't force a device suspend, but we can at least make sure
the device doesn't send events */ the device doesn't send events */
status = libinput_device_config_send_events_set_mode( status = libinput_device_config_send_events_set_mode(
@ -4449,23 +4453,20 @@ touch_arbitration_suspend_touch(struct litest_device *dev,
START_TEST(intuos_touch_arbitration_suspend_touch_device) START_TEST(intuos_touch_arbitration_suspend_touch_device)
{ {
touch_arbitration_suspend_touch(litest_current_device(), touch_arbitration_suspend_touch(litest_current_device(),
LITEST_WACOM_INTUOS, LITEST_WACOM_INTUOS);
true);
} }
END_TEST END_TEST
START_TEST(cintiq_touch_arbitration_suspend_touch_device) START_TEST(cintiq_touch_arbitration_suspend_touch_device)
{ {
touch_arbitration_suspend_touch(litest_current_device(), touch_arbitration_suspend_touch(litest_current_device(),
LITEST_WACOM_CINTIQ_13HDT_PEN, LITEST_WACOM_CINTIQ_13HDT_PEN);
false);
} }
END_TEST END_TEST
static void static void
touch_arbitration_remove_touch(struct litest_device *dev, touch_arbitration_remove_touch(struct litest_device *dev,
enum litest_device_type other, enum litest_device_type other)
bool is_touchpad)
{ {
struct litest_device *finger; struct litest_device *finger;
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
@ -4496,23 +4497,20 @@ touch_arbitration_remove_touch(struct litest_device *dev,
START_TEST(intuos_touch_arbitration_remove_touch) START_TEST(intuos_touch_arbitration_remove_touch)
{ {
touch_arbitration_remove_touch(litest_current_device(), touch_arbitration_remove_touch(litest_current_device(),
LITEST_WACOM_FINGER, LITEST_WACOM_FINGER);
true);
} }
END_TEST END_TEST
START_TEST(cintiq_touch_arbitration_remove_touch) START_TEST(cintiq_touch_arbitration_remove_touch)
{ {
touch_arbitration_remove_touch(litest_current_device(), touch_arbitration_remove_touch(litest_current_device(),
LITEST_WACOM_CINTIQ_13HDT_FINGER, LITEST_WACOM_CINTIQ_13HDT_FINGER);
false);
} }
END_TEST END_TEST
static void static void
touch_arbitration_remove_tablet(struct litest_device *dev, touch_arbitration_remove_tablet(struct litest_device *dev,
enum litest_device_type other, enum litest_device_type other)
bool is_touchpad)
{ {
struct litest_device *tablet; struct litest_device *tablet;
struct libinput *li = dev->libinput; struct libinput *li = dev->libinput;
@ -4521,8 +4519,12 @@ touch_arbitration_remove_tablet(struct litest_device *dev,
{ ABS_PRESSURE, 0 }, { ABS_PRESSURE, 0 },
{ -1, -1 } { -1, -1 }
}; };
bool is_touchpad;
tablet = litest_add_device(li, other); tablet = litest_add_device(li, other);
is_touchpad = !libevdev_has_property(dev->evdev, INPUT_PROP_DIRECT);
libinput_dispatch(li); libinput_dispatch(li);
litest_tablet_proximity_in(tablet, 10, 10, axes); litest_tablet_proximity_in(tablet, 10, 10, axes);
litest_tablet_motion(tablet, 10, 10, axes); litest_tablet_motion(tablet, 10, 10, axes);
@ -4560,16 +4562,14 @@ touch_arbitration_remove_tablet(struct litest_device *dev,
START_TEST(intuos_touch_arbitration_remove_tablet) START_TEST(intuos_touch_arbitration_remove_tablet)
{ {
touch_arbitration_remove_tablet(litest_current_device(), touch_arbitration_remove_tablet(litest_current_device(),
LITEST_WACOM_INTUOS, LITEST_WACOM_INTUOS);
true);
} }
END_TEST END_TEST
START_TEST(cintiq_touch_arbitration_remove_tablet) START_TEST(cintiq_touch_arbitration_remove_tablet)
{ {
touch_arbitration_remove_tablet(litest_current_device(), touch_arbitration_remove_tablet(litest_current_device(),
LITEST_WACOM_CINTIQ_13HDT_PEN, LITEST_WACOM_CINTIQ_13HDT_PEN);
false);
} }
END_TEST END_TEST