From a014df1081be133a730f8bcfd9967d400bd505fb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 3 Aug 2020 15:23:51 +1000 Subject: [PATCH] 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 --- test/test-switch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test-switch.c b/test/test-switch.c index 3c6275a..4dc06f1 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); -- 2.7.4