[PATCH libinput 6/7] test: add test for switch capability

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 23 23:32:28 UTC 2017


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/test-switch.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/test-switch.c b/test/test-switch.c
index b310a0c..3fbd244 100644
--- a/test/test-switch.c
+++ b/test/test-switch.c
@@ -42,6 +42,16 @@ START_TEST(switch_has_lid_switch)
 }
 END_TEST
 
+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(switch_toggle)
 {
 	struct litest_device *dev = litest_current_device();
@@ -482,6 +492,7 @@ void
 litest_setup_tests_lid(void)
 {
 	litest_add("switch:has", switch_has_lid_switch, LITEST_SWITCH, LITEST_ANY);
+	litest_add("switch:has", switch_has_cap, LITEST_SWITCH, LITEST_ANY);
 	litest_add("switch:toggle", switch_toggle, LITEST_SWITCH, LITEST_ANY);
 	litest_add("switch:toggle", switch_toggle_double, LITEST_SWITCH, LITEST_ANY);
 	litest_add("switch:toggle", switch_down_on_init, LITEST_SWITCH, LITEST_ANY);
-- 
2.9.3



More information about the wayland-devel mailing list