summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2006-07-24 05:41:53 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2006-07-24 05:41:53 +0000
commit41a46910571f98f8819f66a6ca5153f1afee4053 (patch)
tree7822afd0342a5c88ce627dda4d6e336dc048a1dd /test
parentb21dcb267ec416fda168190a29779779e3c5ef3e (diff)
downloadlibapr-41a46910571f98f8819f66a6ca5153f1afee4053.tar.gz
From svn issue 1869, test for ../../../ as submitted, plus i've added
the pattern ../../.. which breaks the reporter's assumptions about the fix. Reviewing the bug now. Submitted by: Lieven Govaerts <lgo mobsol.be> Backports: 424831 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@424911 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/testnames.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/testnames.c b/test/testnames.c
index 6ef8f6b6b..3377de210 100644
--- a/test/testnames.c
+++ b/test/testnames.c
@@ -91,6 +91,24 @@ static void merge_dotdot(CuTest *tc)
CuAssertStrEquals(tc, "../test", dstpath);
}
+static void merge_dotdot_dotdot_dotdot(CuTest *tc)
+{
+ apr_status_t rv;
+ char *dstpath = NULL;
+
+ rv = apr_filepath_merge(&dstpath, "",
+ "../../..", APR_FILEPATH_TRUENAME, p);
+ CuAssertPtrNotNull(tc, dstpath);
+ CuAssertIntEquals(tc, APR_SUCCESS, rv);
+ CuAssertStrEquals(tc, "../../..", dstpath);
+
+ rv = apr_filepath_merge(&dstpath, "",
+ "../../../", APR_FILEPATH_TRUENAME, p);
+ CuAssertPtrNotNull(tc, dstpath);
+ CuAssertIntEquals(tc, APR_SUCCESS, rv);
+ CuAssertStrEquals(tc, "../../../", dstpath);
+}
+
static void merge_secure(CuTest *tc)
{
apr_status_t rv;
@@ -232,6 +250,7 @@ CuSuite *testnames(void)
SUITE_ADD_TEST(suite, merge_notrelfail);
SUITE_ADD_TEST(suite, merge_notabs);
SUITE_ADD_TEST(suite, merge_notabsfail);
+ SUITE_ADD_TEST(suite, merge_dotdot_dotdot_dotdot);
SUITE_ADD_TEST(suite, root_absolute);
SUITE_ADD_TEST(suite, root_relative);