From: Jarkko Hietaniemi Date: Sat, 14 Aug 1999 11:31:58 +0000 (+0000) Subject: Catch the case of filesize limits. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fcbfa962e80dc16f8db1afaeb5287e8a393d3942;p=p5sagit%2Fp5-mst-13.2.git Catch the case of filesize limits. p4raw-id: //depot/cfgperl@3989 --- diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t index 458b626..084ec31 100644 --- a/t/lib/syslfs.t +++ b/t/lib/syslfs.t @@ -26,6 +26,20 @@ sub bye { exit(0); } +sub explain { + print STDERR <big") or do { warn "open failed: $!\n"; bye }; binmode BIG; seek(BIG, 5_000_000_000, $SEEK_SET); -print BIG "big"; -close BIG; +# Either the print or (more likely, thanks to buffering) the close will +# fail if there are are filesize limitations (process or fs). +my $print = print BIG "big"; +my $close = close BIG if $print; +unless ($print && $close) { + $ENV{LC_ALL} = "C"; + if ($! =~/File too large/) { + print "1..0\n# writing past 2GB failed\n"; + explain(); + } + bye(); +} @s = stat("big"); @@ -86,6 +106,10 @@ sub fail () { $fail++; } +print "1..8\n"; + +my $fail = 0; + fail unless $s[7] == 5_000_000_003; # exercizes pp_stat print "ok 1\n"; @@ -123,16 +147,7 @@ print "ok 7\n"; fail unless $big eq "big"; print "ok 8\n"; -if ($fail) { - print STDERR <