summaryrefslogtreecommitdiff
path: root/test/test-switch.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-04-21 16:57:39 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-09-06 09:24:29 +1000
commitd9a729e1a77335d72296f7e44dc906b70e801ac8 (patch)
tree3df5d62488c6b86f94559a7a6570a39ccbf34076 /test/test-switch.c
parente242ad219ae89a709995e81719032fa8e9e06889 (diff)
Add libinput_device_switch_has_switch()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-switch.c')
-rw-r--r--test/test-switch.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-switch.c b/test/test-switch.c
index b7d69bc7..45efeb02 100644
--- a/test/test-switch.c
+++ b/test/test-switch.c
@@ -39,6 +39,16 @@ START_TEST(switch_has_cap)
}
END_TEST
+START_TEST(switch_has)
+{
+ struct litest_device *dev = litest_current_device();
+
+ ck_assert_int_eq(libinput_device_switch_has_switch(dev->libinput_device,
+ LIBINPUT_SWITCH_LID),
+ 1);
+}
+END_TEST
+
START_TEST(switch_toggle)
{
struct litest_device *dev = litest_current_device();
@@ -605,6 +615,7 @@ void
litest_setup_tests_lid(void)
{
litest_add("switch:has", switch_has_cap, LITEST_SWITCH, LITEST_ANY);
+ litest_add("switch:has", switch_has, 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);