You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/10/19 18:32:05 UTC

svn commit: r326602 - /apr/apr/branches/1.2.x/test/testdir.c

Author: jorton
Date: Wed Oct 19 09:32:01 2005
New Revision: 326602

URL: http://svn.apache.org/viewcvs?rev=326602&view=rev
Log:
Merge r291925 from trunk:

* test/testdir.c (test_rmkdir_nocwd): Avoid failures on platforms
where directories in use cannot be removed.

Modified:
    apr/apr/branches/1.2.x/test/testdir.c

Modified: apr/apr/branches/1.2.x/test/testdir.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/test/testdir.c?rev=326602&r1=326601&r2=326602&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testdir.c (original)
+++ apr/apr/branches/1.2.x/test/testdir.c Wed Oct 19 09:32:01 2005
@@ -222,6 +222,7 @@
 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,13 +234,20 @@
 
     APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p));
 
-    APR_ASSERT_SUCCESS(tc, "remove temp dir", apr_dir_remove(path, p));
-
-    ABTS_ASSERT(tc, "fail to create dir",
-                apr_dir_make_recursive("foobar", APR_OS_DEFAULT, 
-                                       p) != APR_SUCCESS);
+    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));
+
+    if (rv) {
+        apr_dir_remove(path, p);
+        ABTS_NOT_IMPL(tc, "cannot remove in-use directory");
+    }
 }