diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2008-09-07 09:59:42 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2008-09-07 09:59:42 +0000 |
commit | 1e2da10152f5926a906116c3f13ec0df9d1c6cfa (patch) | |
tree | 3a1b70efd25d9fac021de3caf8439638089be43a /xdelta3 | |
parent | b8630ef77dfe76039b3c54882750d694b81a13bd (diff) |
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.
Diffstat (limited to 'xdelta3')
-rwxr-xr-x | xdelta3/testing/Makefile | 4 | ||||
-rw-r--r-- | xdelta3/testing/regtest.cc | 19 | ||||
-rw-r--r-- | xdelta3/testing/test.h | 4 |
3 files changed, 18 insertions, 9 deletions
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 @@ | |||
1 | CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 -DNDEBUG=0 | 1 | CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 |
2 | #CFLAGS = -g -Wall -I.. -DXD3_DEBUG=2 -DNDEBUG=0 | 2 | #CFLAGS = -g -Wall -I.. -DXD3_DEBUG=2 |
3 | #CFLAGS = -O2 -Wall -I.. -DXD3_DEBUG=0 -DNDEBUG=1 | 3 | #CFLAGS = -O2 -Wall -I.. -DXD3_DEBUG=0 -DNDEBUG=1 |
4 | 4 | ||
5 | DEPS = ../*.h ../*.c *.cc *.h | 5 | 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, | |||
88 | bool encoding = true; | 88 | bool encoding = true; |
89 | bool done = false; | 89 | bool done = false; |
90 | 90 | ||
91 | DP(RINT "source %"Q"u target %"Q"u\n", | 91 | //DP(RINT "source %"Q"u target %"Q"u\n", |
92 | source_file.Size(), target_file.Size()); | 92 | // source_file.Size(), target_file.Size()); |
93 | 93 | ||
94 | while (!done) { | 94 | while (!done) { |
95 | target_iterator.Get(&target_block); | 95 | target_iterator.Get(&target_block); |
@@ -136,6 +136,12 @@ void InMemoryEncodeDecode(const TestOptions &options, | |||
136 | case XD3_GETSRCBLK: { | 136 | case XD3_GETSRCBLK: { |
137 | xd3_source *src = (encoding ? &encode_source : &decode_source); | 137 | xd3_source *src = (encoding ? &encode_source : &decode_source); |
138 | Block *block = (encoding ? &encode_source_block : &decode_source_block); | 138 | Block *block = (encoding ? &encode_source_block : &decode_source_block); |
139 | // if (encoding) { | ||
140 | // DP(RINT "block %"Q"u last srcpos %"Q"u encodepos %u\n", | ||
141 | // encode_source.getblkno, | ||
142 | // encode_stream.match_last_srcpos, | ||
143 | // encode_stream.input_position); | ||
144 | // } | ||
139 | 145 | ||
140 | source_iterator.SetBlock(src->getblkno); | 146 | source_iterator.SetBlock(src->getblkno); |
141 | source_iterator.Get(block); | 147 | source_iterator.Get(block); |
@@ -770,20 +776,19 @@ void TestMergeCommand2() { | |||
770 | 776 | ||
771 | TestOptions options; | 777 | TestOptions options; |
772 | 778 | ||
773 | SizeIterator<size_t, LargeSizes> si0(&rand, 10); | 779 | SizeIterator<size_t, SmallSizes> si0(&rand, 10); |
774 | |||
775 | for (; !si0.Done(); si0.Next()) { | 780 | for (; !si0.Done(); si0.Next()) { |
776 | size_t size0 = si0.Get(); | 781 | size_t size0 = si0.Get(); |
777 | 782 | ||
778 | SizeIterator<size_t, LargeSizes> si1(&rand, 10); | 783 | SizeIterator<size_t, SmallSizes> si1(&rand, 10); |
779 | for (; !si1.Done(); si1.Next()) { | 784 | for (; !si1.Done(); si1.Next()) { |
780 | size_t size1 = si1.Get(); | 785 | size_t size1 = si1.Get(); |
781 | 786 | ||
782 | SizeIterator<size_t, LargeSizes> si2(&rand, 10); | 787 | SizeIterator<size_t, SmallSizes> si2(&rand, 10); |
783 | for (; !si2.Done(); si2.Next()) { | 788 | for (; !si2.Done(); si2.Next()) { |
784 | size_t size2 = si2.Get(); | 789 | size_t size2 = si2.Get(); |
785 | 790 | ||
786 | SizeIterator<size_t, LargeSizes> si3(&rand, 10); | 791 | SizeIterator<size_t, SmallSizes> si3(&rand, 10); |
787 | for (; !si3.Done(); si3.Next()) { | 792 | for (; !si3.Done(); si3.Next()) { |
788 | size_t size3 = si3.Get(); | 793 | size_t size3 = si3.Get(); |
789 | 794 | ||
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<T, U> make_pair(const T& t, const U& u) { | |||
68 | 68 | ||
69 | class Constants { | 69 | class Constants { |
70 | public: | 70 | public: |
71 | // TODO: need to repeat the tests with different block sizes | ||
72 | // 1 << 7 triggers some bugs, 1 << 20 triggers others. | ||
73 | // | ||
74 | //static const xoff_t BLOCK_SIZE = 1 << 20; | ||
71 | static const xoff_t BLOCK_SIZE = 1 << 7; | 75 | static const xoff_t BLOCK_SIZE = 1 << 7; |
72 | }; | 76 | }; |
73 | 77 | ||