From 9ae514c7b4ab3b7e91705f662cb632775c49d767 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Oct 2024 20:17:27 +1000 Subject: [PATCH] test: mark the pad group tests as basically broken by expectation Since our implementation uses the sysfs LED files and we don't have those, all our test devices have the single fallback mode and no more. Add a comment to all these tests to make that clear and enforce a single mode only so it's more obvious. Part-of: --- test/test-pad.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/test-pad.c b/test/test-pad.c index 27b60af7..437bed1b 100644 --- a/test/test-pad.c +++ b/test/test-pad.c @@ -784,6 +784,9 @@ START_TEST(pad_mode_groups) int ngroups; unsigned int i; + /* libinput relies on the LED sysfs files to init on pad group mode + toggles. Since we don't have those in tests we expect all devices to have + one mode only. */ ngroups = libinput_device_tablet_pad_get_num_mode_groups(device); litest_assert_int_eq(ngroups, 1); @@ -847,8 +850,11 @@ START_TEST(pad_mode_group_mode) int ngroups; unsigned int nmodes, mode; + /* libinput relies on the LED sysfs files to init on pad group mode + toggles. Since we don't have those in tests we expect all devices to have + one mode only. */ ngroups = libinput_device_tablet_pad_get_num_mode_groups(device); - litest_assert_int_ge(ngroups, 1); + litest_assert_int_eq(ngroups, 1); group = libinput_device_tablet_pad_get_mode_group(device, 0); @@ -868,8 +874,11 @@ START_TEST(pad_mode_group_has) int ngroups, nbuttons, nrings, nstrips; int i, b, r, s; + /* libinput relies on the LED sysfs files to init on pad group mode + toggles. Since we don't have those in tests we expect all devices to have + one mode only. */ ngroups = libinput_device_tablet_pad_get_num_mode_groups(device); - litest_assert_int_ge(ngroups, 1); + litest_assert_int_eq(ngroups, 1); nbuttons = libinput_device_tablet_pad_get_num_buttons(device); nrings = libinput_device_tablet_pad_get_num_rings(device); @@ -928,8 +937,11 @@ START_TEST(pad_mode_group_has_invalid) int i; int rc; + /* libinput relies on the LED sysfs files to init on pad group mode + toggles. Since we don't have those in tests we expect all devices to have + one mode only. */ ngroups = libinput_device_tablet_pad_get_num_mode_groups(device); - litest_assert_int_ge(ngroups, 1); + litest_assert_int_eq(ngroups, 1); nbuttons = libinput_device_tablet_pad_get_num_buttons(device); nrings = libinput_device_tablet_pad_get_num_rings(device); @@ -984,8 +996,11 @@ START_TEST(pad_mode_group_has_no_toggle) int ngroups, nbuttons; int i, b; + /* libinput relies on the LED sysfs files to init on pad group mode + toggles. Since we don't have those in tests we expect all devices to have + one mode only. */ ngroups = libinput_device_tablet_pad_get_num_mode_groups(device); - litest_assert_int_ge(ngroups, 1); + litest_assert_int_eq(ngroups, 1); /* Button must not be toggle buttons */ nbuttons = libinput_device_tablet_pad_get_num_buttons(device); -- 2.34.1