summaryrefslogtreecommitdiffstats
path: root/path_utils/path_utils_ut.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-03-06 11:34:41 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-03-06 15:46:21 -0500
commitbb90be1e23e419e92eff404208ecf175796f4eba (patch)
treef0203d37ef69cb9694d4b3d940c293cd69fa491c /path_utils/path_utils_ut.c
parent7b1d48d4e1cbd83a2d228e500f376c516b1c93b0 (diff)
downloadding-libs2-bb90be1e23e419e92eff404208ecf175796f4eba.tar.gz
ding-libs2-bb90be1e23e419e92eff404208ecf175796f4eba.tar.xz
ding-libs2-bb90be1e23e419e92eff404208ecf175796f4eba.zip
path_utils: Handle "/" in path_concat
Diffstat (limited to 'path_utils/path_utils_ut.c')
-rw-r--r--path_utils/path_utils_ut.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/path_utils/path_utils_ut.c b/path_utils/path_utils_ut.c
index fbefcab..34462cf 100644
--- a/path_utils/path_utils_ut.c
+++ b/path_utils/path_utils_ut.c
@@ -229,6 +229,15 @@ START_TEST(test_path_concat)
fail_unless(path_concat(p, PATH_MAX, "", "foo") == SUCCESS);
fail_unless_str_equal(p, "foo");
+ fail_unless(path_concat(p, PATH_MAX, "/", "foo") == SUCCESS);
+ fail_unless_str_equal(p, "/foo");
+
+ fail_unless(path_concat(p, PATH_MAX, "/foo", "/") == SUCCESS);
+ fail_unless_str_equal(p, "/foo/");
+
+ fail_unless(path_concat(p, PATH_MAX, "/foo", "bar/") == SUCCESS);
+ fail_unless_str_equal(p, "/foo/bar/");
+
fail_unless(path_concat(p, PATH_MAX, NULL, "foo") == SUCCESS);
fail_unless_str_equal(p, "foo");