r14214@rob-kinyons-computer (orig r8081): rkinyon | 2006-11-17 20:51:21 -0500
[dbsrgits/DBM-Deep.git] / t / 11_optimize.t
index 523c994..0ae0ed8 100644 (file)
@@ -53,8 +53,6 @@ ok( $after < $before, "file size has shrunk" ); # make sure file shrunk
 is( $db->{key1}, 'value1', "key1's value is still there after optimize" );
 is( $db->{a}{c}, 'value2', "key2's value is still there after optimize" );
 
-#print keys %{$db->{a}}, $/;
-
 ##
 # now for the tricky one -- try to store a new key while file is being
 # optimized and locked by another process.  filehandle should be invalidated, 
@@ -70,7 +68,7 @@ SKIP: {
     # first things first, get us about 1000 keys so the optimize() will take 
     # at least a few seconds on any machine, and re-open db with locking
     ##
-    for (11..11) { $db->STORE( $_, $_ +1 ); }
+    for (1..1000) { $db->STORE( $_, $_ +1 ); }
     undef $db;
 
     ##
@@ -93,7 +91,6 @@ SKIP: {
 
         exit( 0 );
     }
-=pod
     # parent fork
     ok( defined($pid), "fork was successful" ); # make sure fork was successful
     
@@ -113,15 +110,14 @@ SKIP: {
     # see if it was stored successfully
     is( $db->{parentfork}, "hello", "stored key while optimize took place" );
 
-#    undef $db;
-#    $db = DBM::Deep->new(
-#        file => $filename,
-#        autoflush => 1,
-#        locking => 1
-#    );
+    undef $db;
+    $db = DBM::Deep->new(
+        file => $filename,
+        autoflush => 1,
+        locking => 1
+    );
     
     # now check some existing values from before
     is( $db->{key1}, 'value1', "key1's value is still there after optimize" );
     is( $db->{a}{c}, 'value2', "key2's value is still there after optimize" );
-=cut
 }