Added test to show weird behaviour with small output buffers. by paulharris · Pull Request #29 · librsync/librsync
Hi,
uuh I don't think there is a bug for this,
and yes it fails for many parameters.
Smallest test case fails,
where the input is zero bytes,
initial output buffer is 1 byte,
and output buffer is grown by 1 byte at a time.
Biggest test case that fails is where the
input is 2,000,000 bytes
initial output buffer is 16000 bytes
output buffer is grown by 30 bytes at a time.
These numbers are just picked out of the air by me,
the input buffer is just filled with 'x' characters,
This patch has a script you can use to compile and run, you can see the parameters in the shell script there. I also have a patch on top of my cmake system, but for the base rsync, the procedure is:
git checkout -b issue-small-output paulharris/issue-small-output
./autogen.sh && ./configure && make && (cd tests && ./test_small_output.run)
and to repeat,
cd tests
./test_small_output.run
To run the small testcase, for example, its:
./test_small_output.test 0 1 1
big test case:
./test_small_output.test 2000000 16000 30
output for small:
$ ./test_small_output.test 0 1 1
Input size: 0
Output buffer start at 1 step growth of 1
FAIL, expected 'done'
Show success (just a bigger initial buffer):
$ ./test_small_output.test 0 12 1
Input size: 0
Output buffer start at 12 step growth of 1
Final signature size: 12