summaryrefslogtreecommitdiff
path: root/src/test/test-cgroup-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-30 12:33:35 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-30 12:33:35 +0200
commitc96cc5822c165e86be78ed96dac6573986032fab (patch)
tree49431ec74b6c53333036fec9909bbc394f0ee85f /src/test/test-cgroup-util.c
parent6bd68a1aa2c4a6250308882caf1025100908b15f (diff)
downloadsystemd-c96cc5822c165e86be78ed96dac6573986032fab.tar.gz
core: catch some special cases in cg_slice_to_path()
Diffstat (limited to 'src/test/test-cgroup-util.c')
-rw-r--r--src/test/test-cgroup-util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index 79c11e297e..efe99cb34b 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -268,9 +268,14 @@ static void test_slice_to_path(void) {
test_slice_to_path_one("foobar.slice", "foobar.slice", 0);
test_slice_to_path_one("foobar-waldo.slice", "foobar.slice/foobar-waldo.slice", 0);
test_slice_to_path_one("foobar-waldo.service", NULL, -EINVAL);
- test_slice_to_path_one("-.slice", NULL, -EINVAL);
+ test_slice_to_path_one("-.slice", "", 0);
+ test_slice_to_path_one("--.slice", NULL, -EINVAL);
+ test_slice_to_path_one("-", NULL, -EINVAL);
test_slice_to_path_one("-foo-.slice", NULL, -EINVAL);
test_slice_to_path_one("-foo.slice", NULL, -EINVAL);
+ test_slice_to_path_one("foo-.slice", NULL, -EINVAL);
+ test_slice_to_path_one("foo--bar.slice", "foo.slice/foo-.slice/foo--bar.slice", 0);
+ test_slice_to_path_one("foo.slice/foo--bar.slice", NULL, -EINVAL);
test_slice_to_path_one("a-b.slice", "a.slice/a-b.slice", 0);
test_slice_to_path_one("a-b-c-d-e.slice", "a.slice/a-b.slice/a-b-c.slice/a-b-c-d.slice/a-b-c-d-e.slice", 0);
}