From commits-return-9166-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Wed Nov 07 04:31:10 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 62356 invoked from network); 7 Nov 2007 04:31:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2007 04:31:10 -0000 Received: (qmail 34031 invoked by uid 500); 7 Nov 2007 04:30:57 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 34016 invoked by uid 500); 7 Nov 2007 04:30:57 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 34005 invoked by uid 99); 7 Nov 2007 04:30:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 20:30:57 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 04:31:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BDE8F1A9832; Tue, 6 Nov 2007 20:30:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r592607 - /apr/apr/branches/1.2.x/test/testdir.c Date: Wed, 07 Nov 2007 04:30:48 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071107043048.BDE8F1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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"); + } }