test: mark the pad group tests as basically broken by expectation
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 24 Oct 2024 10:17:27 +0000 (20:17 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 31 Oct 2024 00:28:08 +0000 (10:28 +1000)
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>

test/test-pad.c

index 27b60af791cbc76c85a03f0544e688af410e24a1..437bed1b1486e688cdc01dda5b625ec0629aad6a 100644 (file)
@@ -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);