summaryrefslogtreecommitdiff
path: root/test/testnames.c
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2007-10-14 22:16:21 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2007-10-14 22:16:21 +0000
commita6a7e9988718f29ef5c220f059674716296dd13f (patch)
treea1d717ef90ce4d8acefad5460564ad44d0c5938a /test/testnames.c
parent6dc35b3241d3866062b7acc9af627988d93b87ec (diff)
downloadapr-a6a7e9988718f29ef5c220f059674716296dd13f.tar.gz
We are reasonably confident this behaves as expected,
and while we will continue to emit noise when the strings mismatch, apr_filepath_get didn't promise any canonicalized correct path. mingw/cygwin users requested the drive case check already since those can show up as lowercase (and we canonicalize these 26 values to uppercase for consistency), I just observed the same on Windows 2003 Server SP2. But worse, the string compare is bogus, since one can set their path to c:\Apache~.6 when canonically the path is c:\Apache2.2.6, and we didn't promise otherwise. We'll gently ignore this exception on OS2/Netware/Win32 where I presume the same can happen. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testnames.c')
-rw-r--r--test/testnames.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/testnames.c b/test/testnames.c
index dec227a85..b39d1080d 100644
--- a/test/testnames.c
+++ b/test/testnames.c
@@ -228,13 +228,18 @@ static void root_from_cwd_and_back(abts_case *tc, void *data)
const char *path = "//";
char *origpath;
char *testpath;
+ int hadfailed;
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]);
+ hadfailed = tc->failed;
+ /* It appears some mingw/cygwin and more modern builds can return
+ * a lowercase drive designation, but we canonicalize to uppercase
+ */
+ ABTS_INT_EQUAL(tc, toupper(origpath[0]), root[0]);
ABTS_INT_EQUAL(tc, ':', root[1]);
ABTS_INT_EQUAL(tc, '/', root[2]);
ABTS_INT_EQUAL(tc, 0, root[3]);
@@ -262,7 +267,16 @@ static void root_from_cwd_and_back(abts_case *tc, void *data)
| APR_FILEPATH_NOTABOVEROOT
| APR_FILEPATH_NOTRELATIVE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+ hadfailed = tc->failed;
+ /* The API doesn't promise equality!!!
+ * apr_filepath_get never promised a canonical filepath.
+ * We'll emit noise under verbose so the user is aware,
+ * but translate this back to success.
+ */
ABTS_STR_EQUAL(tc, origpath, testpath);
+#if defined(WIN32) || defined(OS2) || defined(NETWARE)
+ if (!hadfailed) tc->failed = 0;
+#endif
}