You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by je...@apache.org on 2005/09/28 00:36:03 UTC

svn commit: r292064 - in /apr/apr-util/trunk: CHANGES test/testbuckets.c

Author: jerenkrantz
Date: Tue Sep 27 15:36:00 2005
New Revision: 292064

URL: http://svn.apache.org/viewcvs?rev=292064&view=rev
Log:
Mac OS X HFS doesn't support sparse files; therefore, the test_insertfile case
would cause an 8GB file to be written to disk.  Ouch.  Instead, truncate the
file before closing.

* test/testbuckets.c
  (test_insertfile): Truncate file before closing.

Modified:
    apr/apr-util/trunk/CHANGES
    apr/apr-util/trunk/test/testbuckets.c

Modified: apr/apr-util/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/CHANGES?rev=292064&r1=292063&r2=292064&view=diff
==============================================================================
--- apr/apr-util/trunk/CHANGES (original)
+++ apr/apr-util/trunk/CHANGES Tue Sep 27 15:36:00 2005
@@ -1,5 +1,8 @@
 Changes with APR-util 1.3.0
 
+  *) Fix bug in test suite that cause testbuckets to write 8GB file
+     on Mac OS X.  [Justin Erenkrantz]
+
   *) Teach configure how to find the Novell LDAP SDK. [Graham Leggett]
 
   *) Fix GMT offset for several date formats and add a new format.

Modified: apr/apr-util/trunk/test/testbuckets.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/test/testbuckets.c?rev=292064&r1=292063&r2=292064&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testbuckets.c (original)
+++ apr/apr-util/trunk/test/testbuckets.c Tue Sep 27 15:36:00 2005
@@ -344,8 +344,16 @@
     }
 
     ABTS_ASSERT(tc, "total size of buckets incorrect", count == bignum);
-    
+
     apr_brigade_destroy(bb);
+
+    /* Truncate the file to zero size before close() so that we don't
+     * actually write out the large file if we are on a non-sparse file
+     * system - like Mac OS X's HFS.  Otherwise, pity the poor user who
+     * has to wait for the 8GB file to be written to disk.
+     */
+    apr_file_trunc(f, 0);
+
     apr_file_close(f);
     apr_bucket_alloc_destroy(ba);
     apr_file_remove(TIF_FNAME, p);