summaryrefslogtreecommitdiffstats
path: root/src/test/test-unit-name.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-05-10 18:47:33 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-05-10 18:47:33 +0200
commit945403e6edbe6bf98015aabb38b281aa89334d0a (patch)
tree83f64d3cb247b4e5070ca673b4fdf30e7a275843 /src/test/test-unit-name.c
parentcore: merge duplicated functions (diff)
downloadsystemd-945403e6edbe6bf98015aabb38b281aa89334d0a.tar.xz
systemd-945403e6edbe6bf98015aabb38b281aa89334d0a.zip
path-util: introduce empty_to_root() and use it many places
Diffstat (limited to 'src/test/test-unit-name.c')
-rw-r--r--src/test/test-unit-name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 300a1c5a82..b46925be80 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -96,7 +96,7 @@ static void test_unit_name_from_path_one(const char *path, const char *suffix, c
_cleanup_free_ char *k = NULL;
assert_se(unit_name_to_path(t, &k) == 0);
puts(strna(k));
- assert_se(path_equal(k, isempty(path) ? "/" : path));
+ assert_se(path_equal(k, empty_to_root(path)));
}
}
@@ -124,7 +124,7 @@ static void test_unit_name_from_path_instance_one(const char *pattern, const cha
assert_se(unit_name_to_instance(t, &k) > 0);
assert_se(unit_name_path_unescape(k, &v) == 0);
- assert_se(path_equal(v, isempty(path) ? "/" : path));
+ assert_se(path_equal(v, empty_to_root(path)));
}
}