wrowe 2002/12/31 09:51:21
Modified: test testnames.c
Log:
ABS_ROOT is simpler to follow if it is what its name implies
Revision Changes Path
1.13 +16 -16 apr/test/testnames.c
Index: testnames.c
===================================================================
RCS file: /home/cvs/apr/test/testnames.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- testnames.c 17 Dec 2002 20:34:22 -0000 1.12
+++ testnames.c 31 Dec 2002 17:51:21 -0000 1.13
@@ -61,9 +61,9 @@
#include "apr_lib.h"
#if WIN32
-#define ABS_ROOT "C:"
+#define ABS_ROOT "C:/"
#else
-#define ABS_ROOT
+#define ABS_ROOT "/"
#endif
static void merge_aboveroot(CuTest *tc)
@@ -72,7 +72,7 @@
char *dstpath = NULL;
char errmsg[256];
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/bar",
APR_FILEPATH_NOTABOVEROOT,
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar",
APR_FILEPATH_NOTABOVEROOT,
p);
apr_strerror(rv, errmsg, sizeof(errmsg));
CuAssertPtrEquals(tc, NULL, dstpath);
@@ -85,11 +85,11 @@
apr_status_t rv;
char *dstpath = NULL;
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar",
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar",
APR_FILEPATH_NOTABOVEROOT, p);
CuAssertPtrNotNull(tc, dstpath);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
+ CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath);
}
static void merge_noflag(CuTest *tc)
@@ -97,10 +97,10 @@
apr_status_t rv;
char *dstpath = NULL;
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar", 0,
p);
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0,
p);
CuAssertPtrNotNull(tc, dstpath);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
+ CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath);
}
static void merge_dotdot(CuTest *tc)
@@ -108,10 +108,10 @@
apr_status_t rv;
char *dstpath = NULL;
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz", 0, p);
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p);
CuAssertPtrNotNull(tc, dstpath);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
+ CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath);
}
static void merge_secure(CuTest *tc)
@@ -119,10 +119,10 @@
apr_status_t rv;
char *dstpath = NULL;
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../bar/baz", 0,
p);
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p);
CuAssertPtrNotNull(tc, dstpath);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/foo/bar/baz", dstpath);
+ CuAssertStrEquals(tc, ABS_ROOT"foo/bar/baz", dstpath);
}
static void merge_notrel(CuTest *tc)
@@ -130,11 +130,11 @@
apr_status_t rv;
char *dstpath = NULL;
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz",
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz",
APR_FILEPATH_NOTRELATIVE, p);
CuAssertPtrNotNull(tc, dstpath);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
+ CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath);
}
static void merge_notrelfail(CuTest *tc)
@@ -158,7 +158,7 @@
char *dstpath = NULL;
char errmsg[256];
- rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz",
+ rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz",
APR_FILEPATH_NOTABSOLUTE, p);
apr_strerror(rv, errmsg, sizeof(errmsg));
@@ -184,13 +184,13 @@
{
apr_status_t rv;
const char *root = NULL;
- const char *path = ABS_ROOT"/foo/bar";
+ const char *path = ABS_ROOT"foo/bar";
rv = apr_filepath_root(&root, &path, 0, p);
CuAssertPtrNotNull(tc, root);
CuAssertIntEquals(tc, APR_SUCCESS, rv);
- CuAssertStrEquals(tc, ABS_ROOT"/", root);
+ CuAssertStrEquals(tc, ABS_ROOT, root);
}
static void root_relative(CuTest *tc)