test: add missing check for tripletap
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 19 Feb 2020 03:08:32 +0000 (13:08 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 19 Feb 2020 03:11:02 +0000 (13:11 +1000)
We don't actually expect to get this one, hence the assert a few lines later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-libevdev-events.c

index 7ed543b..5844874 100644 (file)
@@ -839,8 +839,7 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
                { .value = ABS_MT_SLOT, .maximum = num_slots },
                { .value = ABS_MT_TRACKING_ID, .minimum = -1, .maximum = 0xffff },
        };
-       bool have_tripletap = false,
-            have_doubletap = false,
+       bool have_doubletap = false,
             have_quadtap = false,
             have_quinttap = false;
 
@@ -972,6 +971,9 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
                        have_quinttap = true;
                }
 
+               if (libevdev_event_is_code(&ev, EV_KEY, BTN_TOOL_TRIPLETAP))
+                      ck_abort();
+
                if (libevdev_event_is_code(&ev, EV_KEY, BTN_TOOL_DOUBLETAP)) {
                        ck_assert(!have_doubletap);
                        assert_event(&ev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
@@ -985,12 +987,10 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
                if (libevdev_event_is_code(&ev, EV_SYN, SYN_REPORT)) {
                        ck_assert(have_doubletap);
                        ck_assert(have_quinttap);
-                       ck_assert(!have_tripletap);
                        break;
                }
        }
 
-       have_tripletap = false;
        have_doubletap = false;
        have_quadtap = false;
 
@@ -1003,6 +1003,9 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
                        have_quadtap = true;
                }
 
+               if (libevdev_event_is_code(&ev, EV_KEY, BTN_TOOL_TRIPLETAP))
+                      ck_abort();
+
                if (libevdev_event_is_code(&ev, EV_KEY, BTN_TOOL_DOUBLETAP)) {
                        ck_assert(!have_doubletap);
                        assert_event(&ev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);