summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/lib/syslfs.t46
-rw-r--r--t/op/lfs.t46
2 files changed, 68 insertions, 24 deletions
diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t
index c9d7120101..4d38a8e779 100644
--- a/t/lib/syslfs.t
+++ b/t/lib/syslfs.t
@@ -102,7 +102,7 @@ sub fail () {
$fail++;
}
-print "1..8\n";
+print "1..17\n";
my $fail = 0;
@@ -112,38 +112,60 @@ 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";
+
sysopen(BIG, "big", O_RDONLY) or do { warn "sysopen failed: $!\n"; bye };
-sysseek(BIG, 4_500_000_000, SEEK_SET);
+fail unless sysseek(BIG, 4_500_000_000, SEEK_SET) == 4_500_000_000;
+print "ok 5\n";
fail unless sysseek(BIG, 0, SEEK_CUR) == 4_500_000_000;
-print "ok 3\n";
+print "ok 6\n";
-sysseek(BIG, 1, SEEK_CUR);
+fail unless sysseek(BIG, 1, SEEK_CUR) == 4_500_000_001;
+print "ok 7\n";
fail unless sysseek(BIG, 0, SEEK_CUR) == 4_500_000_001;
-print "ok 4\n";
+print "ok 8\n";
-sysseek(BIG, -1, SEEK_CUR);
+fail unless sysseek(BIG, -1, SEEK_CUR) == 4_500_000_000;
+print "ok 9\n";
fail unless sysseek(BIG, 0, SEEK_CUR) == 4_500_000_000;
-print "ok 5\n";
+print "ok 10\n";
-sysseek(BIG, -3, SEEK_END);
+fail unless sysseek(BIG, -3, SEEK_END) == 5_000_000_000;
+print "ok 11\n";
fail unless sysseek(BIG, 0, SEEK_CUR) == 5_000_000_000;
-print "ok 6\n";
+print "ok 12\n";
my $big;
fail unless sysread(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
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