[PATCH libinput 4/5] test: run clickfinger test for all clickpad-capable devices
Peter Hutterer
peter.hutterer at who-t.net
Tue Dec 9 20:15:14 PST 2014
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/touchpad.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/test/touchpad.c b/test/touchpad.c
index 01dabfd..44b403b 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -828,8 +828,13 @@ END_TEST
START_TEST(touchpad_1fg_clickfinger)
{
- struct litest_device *dev = litest_create_device(LITEST_BCM5974);
+ struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
+ enum libinput_config_status status;
+
+ status = libinput_device_config_click_set_method(dev->libinput_device,
+ LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
+ ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
litest_drain_events(li);
@@ -846,15 +851,18 @@ START_TEST(touchpad_1fg_clickfinger)
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li, BTN_LEFT,
LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_delete_device(dev);
}
END_TEST
START_TEST(touchpad_2fg_clickfinger)
{
- struct litest_device *dev = litest_create_device(LITEST_BCM5974);
+ struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
+ enum libinput_config_status status;
+
+ status = libinput_device_config_click_set_method(dev->libinput_device,
+ LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
+ ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
litest_drain_events(li);
@@ -873,8 +881,6 @@ START_TEST(touchpad_2fg_clickfinger)
LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li, BTN_RIGHT,
LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_delete_device(dev);
}
END_TEST
@@ -2180,8 +2186,8 @@ int main(int argc, char **argv) {
litest_add("touchpad:tap", clickpad_1fg_tap_click, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:tap", clickpad_2fg_tap_click, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
- litest_add_no_device("touchpad:clickfinger", touchpad_1fg_clickfinger);
- litest_add_no_device("touchpad:clickfinger", touchpad_2fg_clickfinger);
+ litest_add("touchpad:clickfinger", touchpad_1fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY);
+ litest_add("touchpad:clickfinger", touchpad_2fg_clickfinger, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:click", touchpad_click_defaults_clickfinger, LITEST_APPLE_CLICKPAD, LITEST_ANY);
litest_add("touchpad:click", touchpad_click_defaults_btnarea, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD);
--
2.1.0
More information about the wayland-devel
mailing list