diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2009-02-12 03:35:51 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2009-02-12 03:35:51 +0000 |
commit | 9be16d928d7386488efc34bd99293b3360105da0 (patch) | |
tree | 3440373325be084dd364260636e50db16e382f88 /xdelta3/testing/regtest.cc | |
parent | 1b96ad8ae09b53cdcd7dd03d4bac09ba8c61e5a6 (diff) |
Fixes issue 79, adds more testing.
Diffstat (limited to 'xdelta3/testing/regtest.cc')
-rw-r--r-- | xdelta3/testing/regtest.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/xdelta3/testing/regtest.cc b/xdelta3/testing/regtest.cc index 4db4409..910a8db 100644 --- a/xdelta3/testing/regtest.cc +++ b/xdelta3/testing/regtest.cc | |||
@@ -93,8 +93,8 @@ void InMemoryEncodeDecode(const FileSpec &source_file, | |||
93 | ret = xd3_decode_input(&decode_stream); | 93 | ret = xd3_decode_input(&decode_stream); |
94 | } | 94 | } |
95 | 95 | ||
96 | DP(RINT "%s = %s\n", encoding ? "encoding" : "decoding", | 96 | //DP(RINT "%s = %s\n", encoding ? "encoding" : "decoding", |
97 | xd3_strerror(ret)); | 97 | // xd3_strerror(ret)); |
98 | 98 | ||
99 | switch (ret) { | 99 | switch (ret) { |
100 | case XD3_OUTPUT: | 100 | case XD3_OUTPUT: |
@@ -121,10 +121,10 @@ void InMemoryEncodeDecode(const FileSpec &source_file, | |||
121 | xd3_source *src = (encoding ? &encode_source : &decode_source); | 121 | xd3_source *src = (encoding ? &encode_source : &decode_source); |
122 | Block *block = (encoding ? &encode_source_block : &decode_source_block); | 122 | Block *block = (encoding ? &encode_source_block : &decode_source_block); |
123 | if (encoding) { | 123 | if (encoding) { |
124 | DP(RINT "block %"Q"u last srcpos %"Q"u encodepos %u\n", | 124 | //DP(RINT "block %"Q"u last srcpos %"Q"u encodepos %u\n", |
125 | encode_source.getblkno, | 125 | // encode_source.getblkno, |
126 | encode_stream.match_last_srcpos, | 126 | // encode_stream.match_last_srcpos, |
127 | encode_stream.input_position); | 127 | // encode_stream.input_position); |
128 | } | 128 | } |
129 | 129 | ||
130 | source_iterator.SetBlock(src->getblkno); | 130 | source_iterator.SetBlock(src->getblkno); |
@@ -157,7 +157,9 @@ void InMemoryEncodeDecode(const FileSpec &source_file, | |||
157 | } | 157 | } |
158 | encoding = false; | 158 | encoding = false; |
159 | } else { | 159 | } else { |
160 | CHECK_EQ(0, CmpDifferentBlockBytes(decoded_block, target_block)); | 160 | CHECK_EQ(0, CmpDifferentBlockBytesAtOffset(decoded_block, |
161 | target_file, | ||
162 | verified_bytes)); | ||
161 | verified_bytes += decoded_block.Size(); | 163 | verified_bytes += decoded_block.Size(); |
162 | decoded_block.Reset(); | 164 | decoded_block.Reset(); |
163 | encoding = true; | 165 | encoding = true; |
@@ -781,11 +783,10 @@ void MainTest() { | |||
781 | #undef TEST | 783 | #undef TEST |
782 | 784 | ||
783 | int main(int argc, char **argv) { | 785 | int main(int argc, char **argv) { |
784 | Regtest<MixedBlock> r; | 786 | UnitTest<SmallBlock>(); |
785 | r.TestNonBlockingProgress(); | 787 | MainTest<SmallBlock>(); |
786 | //UnitTest<SmallBlock>(); | 788 | MainTest<MixedBlock>(); |
787 | //MainTest<SmallBlock>(); | 789 | MainTest<OversizeBlock>(); |
788 | //MainTest<MixedBlock>(); | 790 | MainTest<LargeBlock>(); |
789 | //MainTest<LargeBlock>(); | ||
790 | return 0; | 791 | return 0; |
791 | } | 792 | } |