From: Andreas König Date: Sat, 29 Dec 2001 21:42:37 +0000 (+0100) Subject: cleaner close on tests, take 2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05a54443881edbdd9642c814968256dccb1f4e5f;p=p5sagit%2Fp5-mst-13.2.git cleaner close on tests, take 2 Message-ID: (the DB_File patches) p4raw-id: //depot/perl@13942 --- diff --git a/ext/DB_File/t/db-btree.t b/ext/DB_File/t/db-btree.t index 62cccd7..ef05de6 100755 --- a/ext/DB_File/t/db-btree.t +++ b/ext/DB_File/t/db-btree.t @@ -156,6 +156,7 @@ ok(18, $@ =~ /^DB_File::BTREEINFO::FETCH - Unknown element 'fred' at/ ) ; my ($X, %h) ; ok(19, $X = tie(%h, 'DB_File',$Dfile, O_RDWR|O_CREAT, 0640, $DB_BTREE )) ; +die "Could not tie: $!" unless $X; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat($Dfile); @@ -525,9 +526,9 @@ $dbh3->{compare} = sub { length $_[0] <=> length $_[1] } ; my (%g, %k); -tie(%h, 'DB_File',$Dfile1, O_RDWR|O_CREAT, 0640, $dbh1 ) ; -tie(%g, 'DB_File',$Dfile2, O_RDWR|O_CREAT, 0640, $dbh2 ) ; -tie(%k, 'DB_File',$Dfile3, O_RDWR|O_CREAT, 0640, $dbh3 ) ; +tie(%h, 'DB_File',$Dfile1, O_RDWR|O_CREAT, 0640, $dbh1 ) or die $!; +tie(%g, 'DB_File',$Dfile2, O_RDWR|O_CREAT, 0640, $dbh2 ) or die $!; +tie(%k, 'DB_File',$Dfile3, O_RDWR|O_CREAT, 0640, $dbh3 ) or die $!; my @Keys = qw( 0123 12 -1234 9 987654321 def ) ; my (@srt_1, @srt_2, @srt_3); diff --git a/ext/DB_File/t/db-hash.t b/ext/DB_File/t/db-hash.t index 81851e1..931b03c 100755 --- a/ext/DB_File/t/db-hash.t +++ b/ext/DB_File/t/db-hash.t @@ -125,6 +125,7 @@ ok(14, $@ =~ /^DB_File::HASHINFO::FETCH - Unknown element 'fred' at/ ); # Now check the interface to HASH my ($X, %h); ok(15, $X = tie(%h, 'DB_File',$Dfile, O_RDWR|O_CREAT, 0640, $DB_HASH ) ); +die "Could not tie: $!" unless $X; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat($Dfile); diff --git a/ext/DB_File/t/db-recno.t b/ext/DB_File/t/db-recno.t index a676759..339baec 100755 --- a/ext/DB_File/t/db-recno.t +++ b/ext/DB_File/t/db-recno.t @@ -444,7 +444,7 @@ unlink $Dfile; 1 ; EOM - close FILE ; + close FILE or die "Could not close: $!"; BEGIN { push @INC, '.'; } eval 'use SubDB ; '; @@ -454,6 +454,7 @@ EOM eval ' $X = tie(@h, "SubDB","recno.tmp", O_RDWR|O_CREAT, 0640, $DB_RECNO ); ' ; + die "Could not tie: $!" unless $X; main::ok(68, $@ eq "") ;