apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r592607 - /apr/apr/branches/1.2.x/test/testdir.c
Date Wed, 07 Nov 2007 04:30:48 GMT
Author: wrowe
Date: Tue Nov  6 20:30:47 2007
New Revision: 592607

URL: http://svn.apache.org/viewvc?rev=592607&view=rev
Log:
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.


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/viewvc/apr/apr/branches/1.2.x/test/testdir.c?rev=592607&r1=592606&r2=592607&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testdir.c (original)
+++ apr/apr/branches/1.2.x/test/testdir.c Tue Nov  6 20:30:47 2007
@@ -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,9 +234,20 @@
 
     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");
+    }
 }
 
 



Mime
View raw message