summaryrefslogtreecommitdiff
path: root/test/testnames.c
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2006-07-23 21:45:55 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2006-07-23 21:45:55 +0000
commit65212997ba555c76cd1b64dc4056728c15362a33 (patch)
tree184fb163fe3d8390f74fb339069172e752b5d2fd /test/testnames.c
parentc7948d078cb9e1e8dac5e98a63735090f4a5d1b5 (diff)
downloadapr-65212997ba555c76cd1b64dc4056728c15362a33.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> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@424831 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testnames.c')
-rw-r--r--test/testnames.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/testnames.c b/test/testnames.c
index 68aa44480..c888af5a3 100644
--- a/test/testnames.c
+++ b/test/testnames.c
@@ -91,6 +91,24 @@ static void merge_dotdot(abts_case *tc, void *data)
ABTS_STR_EQUAL(tc, "../test", dstpath);
}
+static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data)
+{
+ apr_status_t rv;
+ char *dstpath = NULL;
+
+ rv = apr_filepath_merge(&dstpath, "",
+ "../../..", APR_FILEPATH_TRUENAME, p);
+ ABTS_PTR_NOTNULL(tc, dstpath);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ ABTS_STR_EQUAL(tc, "../../..", dstpath);
+
+ rv = apr_filepath_merge(&dstpath, "",
+ "../../../", APR_FILEPATH_TRUENAME, p);
+ ABTS_PTR_NOTNULL(tc, dstpath);
+ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ ABTS_STR_EQUAL(tc, "../../../", dstpath);
+}
+
static void merge_secure(abts_case *tc, void *data)
{
apr_status_t rv;
@@ -249,6 +267,7 @@ abts_suite *testnames(abts_suite *suite)
abts_run_test(suite, merge_notrelfail, NULL);
abts_run_test(suite, merge_notabs, NULL);
abts_run_test(suite, merge_notabsfail, NULL);
+ abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL);
abts_run_test(suite, root_absolute, NULL);
abts_run_test(suite, root_relative, NULL);