From 5adf0aa2ad75295a317d3e57a402f96d9ed5ed7b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 Dec 2014 11:47:32 +1000 Subject: [PATCH] test: run clickfinger test for all clickpad-capable devices Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- test/touchpad.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/touchpad.c b/test/touchpad.c index 9cbf99e..1b0e121 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -794,8 +794,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); @@ -812,15 +817,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); @@ -839,8 +847,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 @@ -2706,8 +2712,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.7.4