summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-08-03 15:23:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-08-03 15:24:45 +1000
commita014df1081be133a730f8bcfd9967d400bd505fb (patch)
treeb88624cfb5a2624f494e051529f570aa29b27da9
parent0e7beaa058229ba2a8f5f386bdfd6db78e1d1a02 (diff)
downloadlibinput-a014df1081be133a730f8bcfd9967d400bd505fb.tar.gz
test: semi-fix the switch_suspend_with_touchpad test
This used to do nothing, now at least it does the same thing as the corresponding keyboard test. It merely tests the switch going on/off while a touchpad is present, so short of an unexpected error message or a crash this test doesn't actually test for any specific behavior. Fixes #502 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--test/test-switch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test-switch.c b/test/test-switch.c
index 3c6275a9..4dc06f16 100644
--- a/test/test-switch.c
+++ b/test/test-switch.c
@@ -692,10 +692,15 @@ START_TEST(switch_suspend_with_touchpad)
litest_drain_events(li);
touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
- litest_delete_device(touchpad);
- touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
litest_drain_events(li);
+ litest_grab_device(sw);
+ litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_ON);
+ litest_drain_events(li);
+ litest_switch_action(sw, which, LIBINPUT_SWITCH_STATE_OFF);
+ litest_drain_events(li);
+ litest_ungrab_device(sw);
+
litest_delete_device(sw);
litest_drain_events(li);
litest_delete_device(touchpad);