diff options
author | Benjamin Berg <bberg@redhat.com> | 2022-05-30 17:00:01 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2022-05-31 14:33:16 +0200 |
commit | ae38f38cc3fc98acecfd2967741a30bad3e99411 (patch) | |
tree | 63328e4ef0b1425f668cdc5b0b8b10a3ad354d62 | |
parent | 71b2fda04dd71c637361e8ead103980ad6f27ed5 (diff) | |
download | libgudev-ae38f38cc3fc98acecfd2967741a30bad3e99411.tar.gz |
tests: Verify that trailing newlines are removed by udev
-rw-r--r-- | tests/test-sysfsattr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-sysfsattr.c b/tests/test-sysfsattr.c index 12e45ef..9c2f769 100644 --- a/tests/test-sysfsattr.c +++ b/tests/test-sysfsattr.c @@ -42,6 +42,7 @@ test_uncached_sysfs_attr (void) lapmode_path = g_build_filename (g_udev_device_get_sysfs_path (dev), "dytc_lapmode", NULL); /* First access */ g_assert_true (g_udev_device_get_sysfs_attr_as_boolean (dev, "dytc_lapmode")); + g_assert_cmpstr (g_udev_device_get_sysfs_attr (dev, "dytc_lapmode"), ==, "1"); sysfsfp = fopen (lapmode_path, "w"); fprintf (sysfsfp, "%s\n", "0"); fclose (sysfsfp); @@ -50,6 +51,7 @@ test_uncached_sysfs_attr (void) /* This is uncached, and updates the cache */ g_assert_false (g_udev_device_get_sysfs_attr_as_boolean_uncached (dev, "dytc_lapmode")); g_assert_false (g_udev_device_get_sysfs_attr_as_boolean (dev, "dytc_lapmode")); + g_assert_cmpstr (g_udev_device_get_sysfs_attr (dev, "dytc_lapmode"), ==, "0"); /* Test N/Y and trailing linefeeds */ g_assert_true (g_udev_device_get_sysfs_attr_as_boolean (dev, "console")); |