29a_upcopy.t revision 1
1N/A# Unit tests of _upcopy function 1N/A# _upcopy($self, $source, $dest, $len) 1N/A# Take a block of data of leength $len at $source and copy it 1N/A# to $dest, which must be <= $source but which need not be <= $source - $len 1N/A# (That is, this will only copy a block to a position earlier in the file, 1N/A# but the source and destination regions may overlap.) 1N/Aprint "ok $N\n"; $N++;
1N/Amy @
subtests =
qw(x <x x> x><x <x> <x><x x><x> <x><x> <x><x><x> 0);
1N/A$FLEN =
40970;
# 2410 records of 17 chars each 1N/A# (2-7) Trivial non-moves at start of file 1N/A# (8-13) Trivial non-moves in middle of file 1N/A# (14) Trivial non-move at end of file 1N/A# (15-17) Trivial non-move of tail of file 1N/A# (18-24) Moves to start of file 1N/A# (25-31) Moves in middle of file 1N/A# (32-43) Moves from end of file 1N/A# (44-55) Moves from end of file when file ends on a block boundary 1N/A # The record has exactly 17 characters. This will help ensure that 1N/A # even if _upcopy screws up, the data doesn't coincidentally 1N/A # look good because the remainder accidentally lines up. 1N/A int(8192*5/length($d))+1; # at least 5 blocks' worth 1N/A # If len is specified, use that. If it's undef, 1N/A # then behave *as if* we had specified the whole rest of the file 1N/A print "# Timeout\n"; 1N/A print "not ok $N\n"; $N++; 1N/A# my $open = open FH, "< $file"; 1N/A print "not ok $N\n# expected <$x>, got <$a>\n"; 1N/A ? "ok $N\n" : "not ok $N\n";