summaryrefslogtreecommitdiff
path: root/srclib/apr/test/testnames.c
diff options
context:
space:
mode:
Diffstat (limited to 'srclib/apr/test/testnames.c')
-rw-r--r--srclib/apr/test/testnames.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/srclib/apr/test/testnames.c b/srclib/apr/test/testnames.c
index db28923f..fca79f3e 100644
--- a/srclib/apr/test/testnames.c
+++ b/srclib/apr/test/testnames.c
@@ -1,9 +1,9 @@
-/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -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;
@@ -221,6 +239,18 @@ static void root_from_cwd_and_back(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, '/', root[2]);
ABTS_INT_EQUAL(tc, 0, root[3]);
ABTS_STR_EQUAL(tc, origpath + 3, path);
+#elif defined(NETWARE)
+ ABTS_INT_EQUAL(tc, origpath[0], root[0]);
+ {
+ char *pt = strchr(root, ':');
+ ABTS_PTR_NOTNULL(tc, pt);
+ ABTS_INT_EQUAL(tc, ':', pt[0]);
+ ABTS_INT_EQUAL(tc, '/', pt[1]);
+ ABTS_INT_EQUAL(tc, 0, pt[2]);
+ pt = strchr(origpath, ':');
+ ABTS_PTR_NOTNULL(tc, pt);
+ ABTS_STR_EQUAL(tc, (pt+2), path);
+ }
#else
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_STR_EQUAL(tc, "/", root);
@@ -249,6 +279,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);