From 1e2da10152f5926a906116c3f13ec0df9d1c6cfa Mon Sep 17 00:00:00 2001 From: "josh.macdonald" Date: Sun, 7 Sep 2008 09:59:42 +0000 Subject: Latest testing fixes. I've been changing the size-iterator class and block-size by hand and re-running the tests. Obviously, that's no good. --- xdelta3/testing/Makefile | 4 ++-- xdelta3/testing/regtest.cc | 19 ++++++++++++------- xdelta3/testing/test.h | 4 ++++ 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'xdelta3') diff --git a/xdelta3/testing/Makefile b/xdelta3/testing/Makefile index df9854d..281ef11 100755 --- a/xdelta3/testing/Makefile +++ b/xdelta3/testing/Makefile @@ -1,5 +1,5 @@ -CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 -DNDEBUG=0 -#CFLAGS = -g -Wall -I.. -DXD3_DEBUG=2 -DNDEBUG=0 +CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 +#CFLAGS = -g -Wall -I.. -DXD3_DEBUG=2 #CFLAGS = -O2 -Wall -I.. -DXD3_DEBUG=0 -DNDEBUG=1 DEPS = ../*.h ../*.c *.cc *.h diff --git a/xdelta3/testing/regtest.cc b/xdelta3/testing/regtest.cc index c39d56c..204c7e2 100644 --- a/xdelta3/testing/regtest.cc +++ b/xdelta3/testing/regtest.cc @@ -88,8 +88,8 @@ void InMemoryEncodeDecode(const TestOptions &options, bool encoding = true; bool done = false; - DP(RINT "source %"Q"u target %"Q"u\n", - source_file.Size(), target_file.Size()); + //DP(RINT "source %"Q"u target %"Q"u\n", + // source_file.Size(), target_file.Size()); while (!done) { target_iterator.Get(&target_block); @@ -136,6 +136,12 @@ void InMemoryEncodeDecode(const TestOptions &options, case XD3_GETSRCBLK: { xd3_source *src = (encoding ? &encode_source : &decode_source); Block *block = (encoding ? &encode_source_block : &decode_source_block); +// if (encoding) { +// DP(RINT "block %"Q"u last srcpos %"Q"u encodepos %u\n", +// encode_source.getblkno, +// encode_stream.match_last_srcpos, +// encode_stream.input_position); +// } source_iterator.SetBlock(src->getblkno); source_iterator.Get(block); @@ -770,20 +776,19 @@ void TestMergeCommand2() { TestOptions options; - SizeIterator si0(&rand, 10); - + SizeIterator si0(&rand, 10); for (; !si0.Done(); si0.Next()) { size_t size0 = si0.Get(); - SizeIterator si1(&rand, 10); + SizeIterator si1(&rand, 10); for (; !si1.Done(); si1.Next()) { size_t size1 = si1.Get(); - SizeIterator si2(&rand, 10); + SizeIterator si2(&rand, 10); for (; !si2.Done(); si2.Next()) { size_t size2 = si2.Get(); - SizeIterator si3(&rand, 10); + SizeIterator si3(&rand, 10); for (; !si3.Done(); si3.Next()) { size_t size3 = si3.Get(); diff --git a/xdelta3/testing/test.h b/xdelta3/testing/test.h index 7aee605..f2b46f3 100644 --- a/xdelta3/testing/test.h +++ b/xdelta3/testing/test.h @@ -68,6 +68,10 @@ pair make_pair(const T& t, const U& u) { class Constants { public: + // TODO: need to repeat the tests with different block sizes + // 1 << 7 triggers some bugs, 1 << 20 triggers others. + // + //static const xoff_t BLOCK_SIZE = 1 << 20; static const xoff_t BLOCK_SIZE = 1 << 7; }; -- cgit v1.2.3