summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-26 17:30:56 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-27 13:25:55 +0100
commit5f311f8c0e51e2f13773823feb6a71f7c6f2838c (patch)
tree6edfc648016e7000715e11c1ede94fde32e88d82 /src/test
parente4e73a632524c382139034d4271f53b6089ab4cb (diff)
util: remove path_get_parent(), in favour of dirname_malloc()
We don't need two functions that do essentialy the same, hence drop path_get_parent(), and stick to dirname_malloc(), but move it to path-util.[ch].
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-path-util.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index 89129c9894..86d61b2efb 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -77,20 +77,6 @@ static void test_path(void) {
assert_se(streq(basename("/aa///file..."), "file..."));
assert_se(streq(basename("file.../"), ""));
-#define test_parent(x, y) { \
- _cleanup_free_ char *z = NULL; \
- int r = path_get_parent(x, &z); \
- printf("expected: %s\n", y ? y : "error"); \
- printf("actual: %s\n", r<0 ? "error" : z); \
- assert_se((y==NULL) ^ (r==0)); \
- assert_se(y==NULL || path_equal(z, y)); \
- }
-
- test_parent("./aa/bb/../file.da.", "./aa/bb/..");
- test_parent("/aa///.file", "/aa///");
- test_parent("/aa///file...", "/aa///");
- test_parent("file.../", NULL);
-
fd = open("/", O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY);
assert_se(fd >= 0);
assert_se(fd_is_mount_point(fd, "/", 0) > 0);