summaryrefslogtreecommitdiffstats
path: root/src/test/test-mountpoint-util.c
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-12-26 20:21:48 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-12-27 11:15:48 +0100
commit6f8b3838c9fcb644dca47d56b64058a6678069ff (patch)
treeb329d0ca52e6cf5d4b1d5025ea50dea7fbefa23d /src/test/test-mountpoint-util.c
parenttree-wide: use IN_SET() more (diff)
downloadsystemd-6f8b3838c9fcb644dca47d56b64058a6678069ff.tar.xz
systemd-6f8b3838c9fcb644dca47d56b64058a6678069ff.zip
test: use IN_SET()/ERRNO_IS_NEG_*() more
Diffstat (limited to 'src/test/test-mountpoint-util.c')
-rw-r--r--src/test/test-mountpoint-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
index 0c1b849c89..1f71a25859 100644
--- a/src/test/test-mountpoint-util.c
+++ b/src/test/test-mountpoint-util.c
@@ -328,23 +328,23 @@ TEST(mount_option_supported) {
r = mount_option_supported("tmpfs", "size", "64M");
log_info("tmpfs supports size=64M: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r > 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r > 0 || r == -EAGAIN || ERRNO_IS_NEG_PRIVILEGE(r));
r = mount_option_supported("ext4", "discard", NULL);
log_info("ext4 supports discard: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r > 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r > 0 || r == -EAGAIN || ERRNO_IS_NEG_PRIVILEGE(r));
r = mount_option_supported("tmpfs", "idontexist", "64M");
log_info("tmpfs supports idontexist: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r == 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(IN_SET(r, 0, -EAGAIN) || ERRNO_IS_NEG_PRIVILEGE(r));
r = mount_option_supported("tmpfs", "ialsodontexist", NULL);
log_info("tmpfs supports ialsodontexist: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r == 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(IN_SET(r, 0, -EAGAIN) || ERRNO_IS_NEG_PRIVILEGE(r));
r = mount_option_supported("proc", "hidepid", "1");
log_info("proc supports hidepid=1: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r >= 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r >= 0 || r == -EAGAIN || ERRNO_IS_NEG_PRIVILEGE(r));
}
TEST(fstype_can_discard) {