1N/A# Unit tests of _iwrite function 1N/A# _iwrite($self, $data, $start, $end) 1N/A# 'i' here is for 'insert'. This writes $data at absolute position $start 1N/A# in the file, copying the data at that position downwards--- 1N/A# but only down to position $end. Data at or past $end is not moved 1N/A# or even examined. Since there isn't enough room for the full copy 1N/A# (Because we inserted $data at the beginning) we copy as much as possible 1N/A# and return a string containing the remainder. 1N/Aprint "ok $N\n"; $N++;
1N/A$FLEN =
40970;
# Use files of this length 1N/Aprint "# MOF tests\n";
1N/A# (2-85) These were generated by 'gentests.pl' to cover all possible cases 1N/A# x: data is entirely contained within one block 1N/A# x>: data runs from the middle to the end of the block 1N/A# <x: data runs from the start to the middle of the block 1N/A# <x>: data occupies precisely one block 1N/A# x><x: data overlaps one block boundary 1N/A# <x><x: data runs from the start of one block into the middle of the next 1N/A# x><x>: data runs from the middle of one block to the end of the next 1N/A# <x><x>: data occupies two blocks exactly 1N/A# <x><x><x>: data occupies three blocks exactly 1N/A# For each possible alignment of the old and new data, we investigate 1N/A# up to three situations: old data is shorter, old and new data are the 1N/A# same length, and new data is shorter. 1N/A# try($pos, $old, $new) means to run a test where the area being 1N/A# written into starts at position $pos, the area being written into 1N/A# has length $old, and and the new data has length $new. 1N/Atry( 8605, 2394, 2394);
# old=x , new=x ; old = new 1N/Atry( 9768, 1361, 664);
# old=x , new=x ; old > new 1N/Atry( 9955, 6429, 6429);
# old=x> , new=x ; old = new 1N/Atry(10550, 5834, 4123);
# old=x> , new=x ; old > new 1N/Atry(14580, 6158, 851);
# old=x><x , new=x ; old > new 1N/Atry(13442, 11134, 1572);
# old=x><x> , new=x ; old > new 1N/Atry( 8192, 514, 514);
# old=<x , new=<x ; old = new 1N/Atry( 8192, 2196, 858);
# old=<x , new=<x ; old > new 1N/Atry( 8192, 8192, 8192);
# old=<x> , new=<x ; old = new 1N/Atry( 8192, 8192, 1290);
# old=<x> , new=<x ; old > new 1N/Atry( 8192, 10575, 6644);
# old=<x><x , new=<x ; old > new 1N/Atry( 8192, 16384, 5616);
# old=<x><x> , new=<x ; old > new 1N/Atry( 8192, 24576, 6253);
# old=<x><x><x>, new=<x ; old > new 1N/Atry( 9965, 6419, 6419);
# old=x> , new=x> ; old = new 1N/Atry(16059, 6102, 325);
# old=x><x , new=x> ; old > new 1N/Atry( 9503, 15073, 6881);
# old=x><x> , new=x> ; old > new 1N/Atry(16316, 1605, 1605);
# old=x><x , new=x><x ; old = new 1N/Atry(16093, 4074, 993);
# old=x><x , new=x><x ; old > new 1N/Atry(14739, 9837, 9837);
# old=x><x> , new=x><x ; old = new 1N/Atry(14071, 10505, 7344);
# old=x><x> , new=x><x ; old > new 1N/Atry( 8192, 8192, 8192);
# old=<x> , new=<x> ; old = new 1N/Atry( 8192, 14817, 8192);
# old=<x><x , new=<x> ; old > new 1N/Atry( 8192, 16384, 8192);
# old=<x><x> , new=<x> ; old > new 1N/Atry( 8192, 24576, 8192);
# old=<x><x><x>, new=<x> ; old > new 1N/Atry( 8192, 9001, 9001);
# old=<x><x , new=<x><x ; old = new 1N/Atry( 8192, 11760, 10274);
# old=<x><x , new=<x><x ; old > new 1N/Atry( 8192, 16384, 10781);
# old=<x><x> , new=<x><x ; old > new 1N/Atry( 8192, 24576, 9284);
# old=<x><x><x>, new=<x><x ; old > new 1N/Atry(14761, 9815, 9815);
# old=x><x> , new=x><x> ; old = new 1N/Atry( 8192, 16384, 16384);
# old=<x><x> , new=<x><x> ; old = new 1N/Atry( 8192, 24576, 16384);
# old=<x><x><x>, new=<x><x> ; old > new 1N/Atry( 8192, 24576, 24576);
# old=<x><x><x>, new=<x><x><x>; old = new 1N/Atry( 8771, 776, 0);
# old=x , new=0 ; old > new 1N/Atry( 8192, 2813, 0);
# old=<x , new=0 ; old > new 1N/Atry(13945, 2439, 0);
# old=x> , new=0 ; old > new 1N/Atry(14493, 6090, 0);
# old=x><x , new=0 ; old > new 1N/Atry( 8192, 8192, 0);
# old=<x> , new=0 ; old > new 1N/Atry( 8192, 10030, 0);
# old=<x><x , new=0 ; old > new 1N/Atry(14983, 9593, 0);
# old=x><x> , new=0 ; old > new 1N/Atry( 8192, 16384, 0);
# old=<x><x> , new=0 ; old > new 1N/Atry( 8192, 24576, 0);
# old=<x><x><x>, new=0 ; old > new 1N/Atry(10489, 0, 0);
# old=0 , new=0 ; old = new 1N/Aprint "# SOF tests\n";
1N/A# These tests all take place at the start of the file 1N/Atry( 0, 4868, 4868);
# old=<x , new=<x ; old = new 1N/Atry( 0, 147, 118);
# old=<x , new=<x ; old > new 1N/Atry( 0, 8192, 8192);
# old=<x> , new=<x ; old = new 1N/Atry( 0, 8192, 4574);
# old=<x> , new=<x ; old > new 1N/Atry( 0, 11891, 1917);
# old=<x><x , new=<x ; old > new 1N/Atry( 0, 16384, 5155);
# old=<x><x> , new=<x ; old > new 1N/Atry( 0, 24576, 2953);
# old=<x><x><x>, new=<x ; old > new 1N/Atry( 0, 8192, 8192);
# old=<x> , new=<x> ; old = new 1N/Atry( 0, 11083, 8192);
# old=<x><x , new=<x> ; old > new 1N/Atry( 0, 16384, 8192);
# old=<x><x> , new=<x> ; old > new 1N/Atry( 0, 24576, 8192);
# old=<x><x><x>, new=<x> ; old > new 1N/Atry( 0, 14126, 14126);
# old=<x><x , new=<x><x ; old = new 1N/Atry( 0, 12002, 9034);
# old=<x><x , new=<x><x ; old > new 1N/Atry( 0, 16384, 13258);
# old=<x><x> , new=<x><x ; old > new 1N/Atry( 0, 24576, 14367);
# old=<x><x><x>, new=<x><x ; old > new 1N/Atry( 0, 16384, 16384);
# old=<x><x> , new=<x><x> ; old = new 1N/Atry( 0, 24576, 16384);
# old=<x><x><x>, new=<x><x> ; old > new 1N/Atry( 0, 24576, 24576);
# old=<x><x><x>, new=<x><x><x>; old = new 1N/Atry( 0, 6530, 0);
# old=<x , new=0 ; old > new 1N/Atry( 0, 8192, 0);
# old=<x> , new=0 ; old > new 1N/Atry( 0, 14707, 0);
# old=<x><x , new=0 ; old > new 1N/Atry( 0, 16384, 0);
# old=<x><x> , new=0 ; old > new 1N/Atry( 0, 24576, 0);
# old=<x><x><x>, new=0 ; old > new 1N/Atry( 0, 0, 0);
# old=0 , new=0 ; old = new 1N/Aprint "# EOF tests 1\n";
1N/A# These tests all take place at the end of the file 1N/A$FLEN =
40960;
# Force the file to be exactly 40960 bytes long 1N/Atry(32768, 8192, 8192);
# old=<x> , new=<x ; old = new 1N/Atry(32768, 8192, 4026);
# old=<x> , new=<x ; old > new 1N/Atry(24576, 16384, 1917);
# old=<x><x> , new=<x ; old > new 1N/Atry(16384, 24576, 3818);
# old=<x><x><x>, new=<x ; old > new 1N/Atry(32768, 8192, 8192);
# old=<x> , new=<x> ; old = new 1N/Atry(24576, 16384, 8192);
# old=<x><x> , new=<x> ; old > new 1N/Atry(16384, 24576, 8192);
# old=<x><x><x>, new=<x> ; old > new 1N/Atry(24576, 16384, 12221);
# old=<x><x> , new=<x><x ; old > new 1N/Atry(16384, 24576, 15030);
# old=<x><x><x>, new=<x><x ; old > new 1N/Atry(24576, 16384, 16384);
# old=<x><x> , new=<x><x> ; old = new 1N/Atry(16384, 24576, 16384);
# old=<x><x><x>, new=<x><x> ; old > new 1N/Atry(16384, 24576, 24576);
# old=<x><x><x>, new=<x><x><x>; old = new 1N/Atry(35973, 4987, 0);
# old=x> , new=0 ; old > new 1N/Atry(32768, 8192, 0);
# old=<x> , new=0 ; old > new 1N/Atry(29932, 11028, 0);
# old=x><x> , new=0 ; old > new 1N/Atry(24576, 16384, 0);
# old=<x><x> , new=0 ; old > new 1N/Atry(16384, 24576, 0);
# old=<x><x><x>, new=0 ; old > new 1N/Atry(40960, 0, 0);
# old=0 , new=0 ; old = new 1N/Aprint "# EOF tests 2\n";
1N/A# These tests all take place at the end of the file 1N/A$FLEN =
42000;
# Force the file to be exactly 42000 bytes long 1N/Atry(41683, 317, 317);
# old=x , new=x ; old = new 1N/Atry(41225, 775, 405);
# old=x , new=x ; old > new 1N/Atry(35709, 6291, 284);
# old=x><x , new=x ; old > new 1N/Atry(40960, 1040, 1040);
# old=<x , new=<x ; old = new 1N/Atry(40960, 1040, 378);
# old=<x , new=<x ; old > new 1N/Atry(32768, 9232, 5604);
# old=<x><x , new=<x ; old > new 1N/Atry(39994, 2006, 966);
# old=x><x , new=x> ; old > new 1N/Atry(36725, 5275, 5275);
# old=x><x , new=x><x ; old = new 1N/Atry(37990, 4010, 3199);
# old=x><x , new=x><x ; old > new 1N/Atry(32768, 9232, 8192);
# old=<x><x , new=<x> ; old > new 1N/Atry(32768, 9232, 9232);
# old=<x><x , new=<x><x ; old = new 1N/Atry(32768, 9232, 8795);
# old=<x><x , new=<x><x ; old > new 1N/Atry(41500, 500, 0);
# old=x , new=0 ; old > new 1N/Atry(40960, 1040, 0);
# old=<x , new=0 ; old > new 1N/Atry(35272, 6728, 0);
# old=x><x , new=0 ; old > new 1N/Atry(32768, 9232, 0);
# old=<x><x , new=0 ; old > new 1N/Atry(42000, 0, 0);
# old=0 , new=0 ; old = new 1N/A my @c = ('a' .. 'z', 'A' .. 'Z', 0..9, $:); 1N/A print "not ok $N\n";