summaryrefslogtreecommitdiff
path: root/test/testnames.c
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-05-16 03:52:01 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-05-16 03:52:01 +0000
commitf840fae371681fe69a5ec4b74ad1a6e1e7351f58 (patch)
treef2ca5062a1a4274e40b50aa3d547d34d1427b66a /test/testnames.c
parent9a4d9bcf674826a95828f2e9a5a57a7cfd79b0cc (diff)
downloadapr-f840fae371681fe69a5ec4b74ad1a6e1e7351f58.tar.gz
Hmmm... been sitting on this little test bench a while, time to share.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61648 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testnames.c')
-rw-r--r--test/testnames.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/testnames.c b/test/testnames.c
index 3468b423e..f14550342 100644
--- a/test/testnames.c
+++ b/test/testnames.c
@@ -70,6 +70,21 @@ static void closeapr(void)
apr_terminate();
}
+static void root_result(char *path)
+{
+ apr_status_t status;
+ char errmsg[256];
+ char *root = NULL;
+ status = apr_filepath_root(&root, &path, context);
+ apr_strerror(status, errmsg, sizeof(errmsg));
+ if (root)
+ fprintf(stderr, "\tRoot \"%s\" Path \"%s\" (%s)\n",
+ root, path, errmsg);
+ else
+ fprintf(stderr, "\tPath \"%s\" Error (%s)\n",
+ path, errmsg);
+}
+
static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, char *tdesc)
{
char errmsg[256];
@@ -82,12 +97,6 @@ static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, ch
apr_strerror(status, errmsg, sizeof(errmsg));
if (dstpath) {
fprintf(stderr, "%s result for %s\n\tResult Path \"%s\"\n", errmsg, tdesc, dstpath);
- srcpath = dstpath;
- status = apr_filepath_root(&dstpath, &srcpath, context);
- if (srcpath != dstpath) {
- apr_strerror(status, errmsg, sizeof(errmsg));
- fprintf(stderr, "\tRoot of \"%s\" (%s)\n", dstpath, errmsg);
- }
}
else {
fprintf(stderr, "%s result for %s\n", errmsg, tdesc);
@@ -132,6 +141,8 @@ int main(void)
merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT);
merge_result(rootpath, addpath, APR_FILEPATH_NOTABSOLUTE);
merge_result(rootpath, addpath, APR_FILEPATH_NOTRELATIVE);
+ root_result(rootpath);
+ root_result(addpath);
}
return (0);
}