summaryrefslogtreecommitdiff
path: root/t/op/lfs.t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-09-01 13:16:11 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-01 13:16:11 +0000
commit77166d5172a44cfc550ab7460a594b9190352364 (patch)
tree544852bbf1343ea133357c9fdbb5de7ddeec1444 /t/op/lfs.t
parent10f9c03dadf6f1b8284a5636eec24431c23a2c13 (diff)
downloadperl-77166d5172a44cfc550ab7460a594b9190352364.tar.gz
Enhance lfs tests: check every seek and sysseek
and test also that -e and -f detect largefiles. p4raw-id: //depot/cfgperl@4063
Diffstat (limited to 't/op/lfs.t')
-rw-r--r--t/op/lfs.t46
1 files changed, 34 insertions, 12 deletions
diff --git a/t/op/lfs.t b/t/op/lfs.t
index 46d410da0a..ae6aac6079 100644
--- a/t/op/lfs.t
+++ b/t/op/lfs.t
@@ -107,7 +107,7 @@ sub fail () {
$fail++;
}
-print "1..8\n";
+print "1..17\n";
my $fail = 0;
@@ -117,39 +117,61 @@ print "ok 1\n";
fail unless -s "big" == 5_000_000_003; # exercizes pp_ftsize
print "ok 2\n";
+fail unless -e "big";
+print "ok 3\n";
+
+fail unless -f "big";
+print "ok 4\n";
+
open(BIG, "big") or do { warn "open failed: $!\n"; bye };
binmode BIG;
-seek(BIG, 4_500_000_000, $SEEK_SET);
+fail unless seek(BIG, 4_500_000_000, $SEEK_SET);
+print "ok 5\n";
fail unless tell(BIG) == 4_500_000_000;
-print "ok 3\n";
+print "ok 6\n";
-seek(BIG, 1, $SEEK_CUR);
+fail unless seek(BIG, 1, $SEEK_CUR);
+print "ok 7\n";
fail unless tell(BIG) == 4_500_000_001;
-print "ok 4\n";
+print "ok 8\n";
-seek(BIG, -1, $SEEK_CUR);
+fail unless seek(BIG, -1, $SEEK_CUR);
+print "ok 9\n";
fail unless tell(BIG) == 4_500_000_000;
-print "ok 5\n";
+print "ok 10\n";
-seek(BIG, -3, $SEEK_END);
+fail unless seek(BIG, -3, $SEEK_END);
+print "ok 11\n";
fail unless tell(BIG) == 5_000_000_000;
-print "ok 6\n";
+print "ok 12\n";
my $big;
fail unless read(BIG, $big, 3) == 3;
-print "ok 7\n";
+print "ok 13\n";
fail unless $big eq "big";
-print "ok 8\n";
+print "ok 14\n";
+
+# 705_032_704 = (I32)5_000_000_000
+fail unless seek(BIG, 705_032_704, $SEEK_SET);
+print "ok 15\n";
+
+my $zero;
+
+fail unless read(BIG, $zero, 3) == 3;
+print "ok 16\n";
+
+fail unless $zero eq "\0\0\0";
+print "ok 17\n";
explain if $fail;
-bye();
+bye(); # does the necessary cleanup
# eof