test: add test for switch capability
authorPeter Hutterer <peter.hutterer@who-t.net>
Sun, 23 Apr 2017 22:22:08 +0000 (08:22 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 5 Sep 2017 00:48:19 +0000 (10:48 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-switch.c

index 108b3a8571642ee8bd55551a9d3072b8fac49a81..bdd1899f1dc1cdfa956859028be9e9b6e64d5937 100644 (file)
 #include "libinput-util.h"
 #include "litest.h"
 
+START_TEST(switch_has_cap)
+{
+       struct litest_device *dev = litest_current_device();
+
+       ck_assert(libinput_device_has_capability(dev->libinput_device,
+                                                LIBINPUT_DEVICE_CAP_SWITCH));
+
+}
+END_TEST
+
 START_TEST(lid_switch)
 {
        struct litest_device *dev = litest_current_device();
@@ -618,6 +628,7 @@ END_TEST
 void
 litest_setup_tests_lid(void)
 {
+       litest_add("switch:has", switch_has_cap, LITEST_SWITCH, LITEST_ANY);
        litest_add("lid:switch", lid_switch, LITEST_SWITCH, LITEST_ANY);
        litest_add("lid:switch", lid_switch_double, LITEST_SWITCH, LITEST_ANY);
        litest_add("lid:switch", lid_switch_down_on_init, LITEST_SWITCH, LITEST_ANY);