apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r291925 - /apr/apr/trunk/test/testdir.c
Date Tue, 27 Sep 2005 12:54:27 GMT
Author: jorton
Date: Tue Sep 27 05:54:24 2005
New Revision: 291925

URL: http://svn.apache.org/viewcvs?rev=291925&view=rev
Log:
* test/testdir.c (test_rmkdir_nocwd): Avoid failures on platforms
where directories in use cannot be removed.

Modified:
    apr/apr/trunk/test/testdir.c

Modified: apr/apr/trunk/test/testdir.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/test/testdir.c?rev=291925&r1=291924&r2=291925&view=diff
==============================================================================
--- apr/apr/trunk/test/testdir.c (original)
+++ apr/apr/trunk/test/testdir.c Tue Sep 27 05:54:24 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");
+    }
 }
 
 



Mime
View raw message