summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2007-11-07 04:30:47 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2007-11-07 04:30:47 +0000
commitb2c0564017942ee421445960a3a25e7534af9903 (patch)
treece8765c00d140bff106124702b47b1974de32c25
parent4b3672f5d2aa99f3b00b32385243c2ff58c440ab (diff)
downloadapr-b2c0564017942ee421445960a3a25e7534af9903.tar.gz
Revert to r428331;
this backported, now reverted code remains on trunk for a discussion of "when does a nonportable unit test belong in test/'s, when is it a candidate for test/internal/, and why aren't we testing the function itself?" But we don't care for that discussion to hold up a release. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@592607 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--test/testdir.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/testdir.c b/test/testdir.c
index 63a2f1722..82f145d6f 100644
--- a/test/testdir.c
+++ b/test/testdir.c
@@ -222,6 +222,7 @@ static void test_uncleared_errno(abts_case *tc, void *data)
static void test_rmkdir_nocwd(abts_case *tc, void *data)
{
char *cwd, *path;
+ apr_status_t rv;
APR_ASSERT_SUCCESS(tc, "make temp dir",
apr_dir_make("dir3", APR_OS_DEFAULT, p));
@@ -233,9 +234,20 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p));
+ rv = apr_dir_remove(path, p);
+ /* Some platforms cannot remove a directory which is in use. */
+ if (rv == APR_SUCCESS) {
+ ABTS_ASSERT(tc, "fail to create dir",
+ apr_dir_make_recursive("foobar", APR_OS_DEFAULT,
+ p) != APR_SUCCESS);
+ }
+
APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p));
- APR_ASSERT_SUCCESS(tc, "remove cwd", apr_dir_remove(path, p));
+ if (rv) {
+ apr_dir_remove(path, p);
+ ABTS_NOT_IMPL(tc, "cannot remove in-use directory");
+ }
}