test: enable tapping before verifying correct tap events
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 4 Mar 2015 01:20:34 +0000 (11:20 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 5 Mar 2015 03:30:49 +0000 (13:30 +1000)
These tests make sure we don't get tapping events in certain situations
(finger movement, timeouts, ...). Tapping must be enabled for that to be a
valid test.

The tests can't work on semi-mt devices because we can't end slots
independently. Disable the tests there.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
test/touchpad.c

index d4dc2d1..57027ab 100644 (file)
@@ -508,6 +508,8 @@ START_TEST(touchpad_no_2fg_tap_after_move)
        struct litest_device *dev = litest_current_device();
        struct libinput *li = dev->libinput;
 
+       libinput_device_config_tap_set_enabled(dev->libinput_device,
+                                              LIBINPUT_CONFIG_TAP_ENABLED);
        litest_drain_events(dev->libinput);
 
        /* one finger down, move past threshold,
@@ -530,6 +532,8 @@ START_TEST(touchpad_no_2fg_tap_after_timeout)
        struct litest_device *dev = litest_current_device();
        struct libinput *li = dev->libinput;
 
+       libinput_device_config_tap_set_enabled(dev->libinput_device,
+                                              LIBINPUT_CONFIG_TAP_ENABLED);
        litest_drain_events(dev->libinput);
 
        /* one finger down, wait past tap timeout,
@@ -555,6 +559,9 @@ START_TEST(touchpad_no_first_fg_tap_after_move)
        struct libinput *li = dev->libinput;
        struct libinput_event *event;
 
+       libinput_device_config_tap_set_enabled(dev->libinput_device,
+                                              LIBINPUT_CONFIG_TAP_ENABLED);
+
        litest_drain_events(dev->libinput);
 
        /* one finger down, second finger down,
@@ -3344,8 +3351,8 @@ int main(int argc, char **argv) {
        litest_add("touchpad:tap", touchpad_2fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_SINGLE_TOUCH|LITEST_CLICKPAD);
 
        litest_add("touchpad:tap", touchpad_2fg_tap_click_apple, LITEST_APPLE_CLICKPAD, LITEST_ANY);
-       litest_add("touchpad:tap", touchpad_no_2fg_tap_after_move, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
-       litest_add("touchpad:tap", touchpad_no_2fg_tap_after_timeout, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
+       litest_add("touchpad:tap", touchpad_no_2fg_tap_after_move, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
+       litest_add("touchpad:tap", touchpad_no_2fg_tap_after_timeout, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
        litest_add("touchpad:tap", touchpad_no_first_fg_tap_after_move, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
        litest_add("touchpad:tap", touchpad_no_first_fg_tap_after_move, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
        litest_add("touchpad:tap", touchpad_3fg_tap_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);