apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r382029 - /apr/apr/trunk/test/testnames.c
Date Wed, 01 Mar 2006 14:28:47 GMT
Author: wrowe
Date: Wed Mar  1 06:28:46 2006
New Revision: 382029

URL: http://svn.apache.org/viewcvs?rev=382029&view=rev
Log:

  Proveup: Bug 38801 reported by <kevin_wise motorola.com>

Modified:
    apr/apr/trunk/test/testnames.c

Modified: apr/apr/trunk/test/testnames.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testnames.c?rev=382029&r1=382028&r2=382029&view=diff
==============================================================================
--- apr/apr/trunk/test/testnames.c (original)
+++ apr/apr/trunk/test/testnames.c Wed Mar  1 06:28:46 2006
@@ -203,6 +203,38 @@
     ABTS_STR_EQUAL(tc, "", path);
 }
 
+static void root_from_cwd_and_back(abts_case *tc, void *data)
+{
+    apr_status_t rv;
+    const char *root = NULL;
+    const char *path = "//";
+    char *origpath;
+    char *testpath;
+
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_filepath_get(&origpath, 0, p));
+    path = origpath;
+    rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p);
+
+#if defined(WIN32) || defined(OS2)
+    ABTS_INT_EQUAL(tc, origpath[0], root[0]);
+    ABTS_INT_EQUAL(tc, ':', root[1]);
+    ABTS_INT_EQUAL(tc, '/', root[2]);
+    ABTS_INT_EQUAL(tc, 0, root[3]);
+    ABTS_STR_EQUAL(tc, origpath + 3, path);
+#else
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_STR_EQUAL(tc, '/', root);
+    ABTS_STR_EQUAL(tc, origpath + 1, path);
+#endif
+
+    rv = apr_filepath_merge(&testpath, root, path, 
+                            APR_FILEPATH_TRUENAME
+                          | APR_FILEPATH_NOTABOVEROOT
+                          | APR_FILEPATH_NOTRELATIVE, p);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_STR_EQUAL(tc, origpath, testpath);
+}
+
 
 abts_suite *testnames(abts_suite *suite)
 {
@@ -221,6 +253,7 @@
     abts_run_test(suite, root_absolute, NULL);
     abts_run_test(suite, root_relative, NULL);
     abts_run_test(suite, root_from_slash, NULL);
+    abts_run_test(suite, root_from_cwd_and_back, NULL);
 
     return suite;
 }



Mime
View raw message