summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2024-10-24 20:17:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2024-10-31 10:28:08 +1000
commit9ae514c7b4ab3b7e91705f662cb632775c49d767 (patch)
tree393cf8ab58f0b103520564c1ed20e58f5b206574
parent6c350ab26945dc740d09a7769ecc5b6afeb60040 (diff)
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: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1070>
-rw-r--r--test/test-pad.c23
1 files 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);