summaryrefslogtreecommitdiffstats
path: root/src/test/test-watch-pid.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
commitfc53809803cd2bc2434e312b19a18fa36776da12 (patch)
treeb4b43bd6538f51965ce32856e9c053d0f90919c8 /src/test/test-watch-pid.c
parentAdding upstream version 255.5. (diff)
downloadsystemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz
systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-watch-pid.c')
-rw-r--r--src/test/test-watch-pid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test-watch-pid.c b/src/test/test-watch-pid.c
index b0c2c06..423a9be 100644
--- a/src/test/test-watch-pid.c
+++ b/src/test/test-watch-pid.c
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
if (getuid() != 0)
return log_tests_skipped("not root");
r = enter_cgroup_subroot(NULL);
- if (r == -ENOMEDIUM)
+ if (r < 0)
return log_tests_skipped("cgroupfs not available");
_cleanup_free_ char *unit_dir = NULL;
@@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
assert_se(pid >= 0);
assert_se(hashmap_isempty(m->watch_pids));
- assert_se(manager_get_unit_by_pid(m, pid) == NULL);
+ ASSERT_NULL(manager_get_unit_by_pid(m, pid));
assert_se(unit_watch_pid(a, pid, false) >= 0);
assert_se(manager_get_unit_by_pid(m, pid) == a);
@@ -93,10 +93,10 @@ int main(int argc, char *argv[]) {
assert_se(manager_get_unit_by_pid(m, pid) == c);
unit_unwatch_pid(c, pid);
- assert_se(manager_get_unit_by_pid(m, pid) == NULL);
+ ASSERT_NULL(manager_get_unit_by_pid(m, pid));
unit_unwatch_pid(c, pid);
- assert_se(manager_get_unit_by_pid(m, pid) == NULL);
+ ASSERT_NULL(manager_get_unit_by_pid(m, pid));
return 0;
}