test: add test for libevdev_is_event_code(EV_SYN...)
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 23 Aug 2013 00:57:50 +0000 (10:57 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 29 Aug 2013 01:36:20 +0000 (11:36 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-event-names.c

index 9b07e32..23a59e7 100644 (file)
@@ -266,6 +266,11 @@ START_TEST(test_event_code)
        }
        ck_assert_int_eq(libevdev_is_event_code(&ev, EV_MAX + 1, ev.code), 0);
        ck_assert_int_eq(libevdev_is_event_code(&ev, EV_REL, REL_MAX + 1), 0);
+
+       ev.type = EV_SYN;
+       ev.code = SYN_REPORT;
+       ck_assert_int_eq(libevdev_is_event_code(&ev, EV_SYN, SYN_REPORT), 1);
+       ck_assert_int_eq(libevdev_is_event_code(&ev, EV_SYN, SYN_DROPPED), 0);
 }
 END_TEST