183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff@echo off 283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Copyright 2008 Google Inc. 383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Author: Lincoln Smith 483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem 583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Licensed under the Apache License, Version 2.0 (the "License"); 683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem you may not use this file except in compliance with the License. 783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem You may obtain a copy of the License at 883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem 983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem http:#www.apache.org/licenses/LICENSE-2.0 1083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem 1183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Unless required by applicable law or agreed to in writing, software 1283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem distributed under the License is distributed on an "AS IS" BASIS, 1383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem See the License for the specific language governing permissions and 1583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem limitations under the License. 1683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem 1783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem This script tests the correctness of the vcdiff.exe command-line 1883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem executable. It is the Windows equivalent of the src/vcdiff_test.sh 1983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem shell script for Unix systems, though some of the tests from that 2083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem script are not included here. 2183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem 2283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem If you add a new test here, please add the same test to 2383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem src/vcdiff_test.sh. 2483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 2583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem The script should be passed one argument which is the location of the 2683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff.exe executable. 2783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffif not exist %1 ^ 2883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff ( echo Must pass location of vcdiff.exe as script argument ^ 2983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 3083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset VCDIFF=%1 3183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 3283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem These options are only needed for the encoder; 3383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem the decoder will recognize the interleaved and checksum formats 3483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem without needing to specify any options. 3583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset TESTDATA_DIR=..\..\testdata 3683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset VCD_OPTIONS=-interleaved -checksum 3783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset DICTIONARY_FILE=%TESTDATA_DIR%\configure.ac.v0.1 3883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset TARGET_FILE=%TESTDATA_DIR%\configure.ac.v0.2 3983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset DELTA_FILE=%TEMP%\configure.ac.vcdiff 4083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset OUTPUT_TARGET_FILE=%TEMP%\configure.ac.output 4183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset MALICIOUS_ENCODING=%TESTDATA_DIR%\allocates_4gb.vcdiff 4283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffset EMPTY_FILE=%TESTDATA_DIR%\empty_file.txt 4383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 4483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff with no arguments shows usage information & error result 4583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% ^ 4683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff with no arguments should fail, but succeeded ^ 4783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 4883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 1 ok 4983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 5083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff with three arguments but without "encode" or "decode" 5183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem shows usage information & error result 5283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 5383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -dictionary %DICTIONARY_FILE% -target %TARGET_FILE% -delta %DELTA_FILE% ^ 5483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff without operation argument should fail, but succeeded ^ 5583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 5683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 2 ok 5783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 5883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff with all three arguments. Verify that output file matches target file 5983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 6083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 6183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 6283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 6383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode with three arguments failed ^ 6483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 6583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 6683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 6783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 6883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode with three arguments failed ^ 6983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 7083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 7183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original ^ 7283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 7383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 3 ok 7483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 7583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 7683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 7783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 7883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem open-vcdiff Issue 7 7983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem (http://code.google.com/p/open-vcdiff/issues/detail?id=7) 8083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff using stdin/stdout. Verify that output file matches target file 8183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 8283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 8383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %TARGET_FILE% ^ 8483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %DELTA_FILE% ^ 8583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode using stdin/stdout failed ^ 8683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 8783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 8883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %DELTA_FILE% ^ 8983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %OUTPUT_TARGET_FILE% ^ 9083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode using stdin/stdout failed ^ 9183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 9283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 9383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original ^ 9483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 9583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 4 ok 9683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 9783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 9883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 9983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 10083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem vcdiff with mixed stdin/stdout. 10183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 10283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 10383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 10483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %DELTA_FILE% ^ 10583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode with mixed arguments failed ^ 10683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 10783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 10883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 10983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %OUTPUT_TARGET_FILE% ^ 11083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode with mixed arguments failed ^ 11183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 11283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 11383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original ^ 11483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 11583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 5 ok 11683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 11783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 11883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 11983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 12083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 12183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 12283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %TARGET_FILE% ^ 12383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 12483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode with mixed arguments failed ^ 12583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 12683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 12783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %DELTA_FILE% ^ 12883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 12983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode with mixed arguments failed ^ 13083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 13183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 13283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original ^ 13383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 13483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 6 ok 13583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 13683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 13783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Don't remove %DELTA_FILE%; use it for the next test 13883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 13983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem If using the wrong dictionary, and dictionary is smaller than the original 14083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem dictionary, vcdiff will spot the mistake and return an error. (It can't 14183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem detect the case where the wrong dictionary is larger than the right one.) 14283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %TARGET_FILE% ^ 14383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 14483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 14583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo Decode using larger dictionary should fail, but succeeded ^ 14683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 14783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 7 ok 14883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 14983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 15083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 15183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 15283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem "vcdiff test" with all three arguments. 15383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 15483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 15583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 15683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 15783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with three arguments failed ^ 15883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 15983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 8 ok 16083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 16183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 16283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 16383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Dictionary file not found. 16483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 16583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %TEMP%\nonexistent_file ^ 16683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 16783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 16883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff with missing dictionary file should fail, but succeeded ^ 16983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 17083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 9 ok 17183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 17283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Target file not found. 17383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 17483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 17583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TEMP%\nonexistent_file ^ 17683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 17783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff with missing target file should fail, but succeeded ^ 17883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 17983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 10 ok 18083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 18183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Delta file not found. 18283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 18383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %TEMP%\nonexistent_file ^ 18483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 18583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff with missing delta file should fail, but succeeded ^ 18683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 18783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 11 ok 18883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 18983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Test using -stats flag 19083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 19183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 19283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 19383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 19483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 19583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode with -stats failed ^ 19683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 19783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% -stats ^ 19883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff decode -dictionary %DICTIONARY_FILE% ^ 19983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 20083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 20183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode with -stats failed ^ 20283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 20383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 20483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original ^ 20583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 20683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 13 ok 20783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 20883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 20983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 21083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 21183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem open-vcdiff Issue 6 21283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem (http://code.google.com/p/open-vcdiff/issues/detail?id=6) 21383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Using empty file as dictionary should work, but (because dictionary is empty) 21483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem it will not produce a small delta file. 21583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 21683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %EMPTY_FILE% ^ 21783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 21883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 21983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 22083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with empty file as dictionary failed ^ 22183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 22283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 14 ok 22383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 22483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 22583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 22683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Decode using something that isn't a delta file 22783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 22883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DICTIONARY_FILE% ^ 22983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 23083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff with invalid delta file should fail, but succeeded ^ 23183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 23283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 17 ok 23383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 23483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 23583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -target %TARGET_FILE% ^ 23683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 23783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -dictionary ^ 23883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo -dictionary option with no file name should fail, but succeeded ^ 23983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 24083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 18 ok 24183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 24283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 24383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 24483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 24583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target ^ 24683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo -target option with no file name should fail, but succeeded ^ 24783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 24883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 19 ok 24983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 25083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 25183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 25283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 25383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta ^ 25483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo -delta option with no file name should fail, but succeeded ^ 25583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 25683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 20 ok 25783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 25883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 25983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -dictionary %DICTIONARY_FILE% ^ 26083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 26183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 26283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize ^ 26383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo -buffersize option with no argument should fail, but succeeded ^ 26483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 26583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 21 ok 26683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 26783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Using -buffersize=1 should still work. 26883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 26983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 27083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 27183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 27283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize 1 ^ 27383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 27483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with -buffersize=1 failed ^ 27583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 27683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 22 ok 27783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 27883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 27983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 28083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Using -buffersize=1 with stdin/stdout means that vcdiff 28183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem will create a separate target window for each byte read. 28283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% encode -dictionary %DICTIONARY_FILE% ^ 28383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize 1 ^ 28483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 28583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %TARGET_FILE% ^ 28683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %DELTA_FILE% ^ 28783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode using stdin/stdout with -buffersize=1 failed ^ 28883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 28983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 29083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize 1 ^ 29183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 29283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %DELTA_FILE% ^ 29383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %OUTPUT_TARGET_FILE% ^ 29483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode using stdin/stdout with -buffersize=1 failed ^ 29583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 29683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 29783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original with -buffersize=1 ^ 29883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 29983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 23 ok 30083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 30183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 30283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 30383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 30483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Using -buffersize=0 should fail. 30583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 30683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 30783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 30883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 30983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize 0 ^ 31083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vcdiff test with -buffersize=0 should fail, but succeeded ^ 31183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 31283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 24 ok 31383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 31483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 31583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 31683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Using -buffersize=128M (larger than default maximum) should still work. 31783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 31883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 31983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 32083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 32183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -buffersize 134217728 ^ 32283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 32383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with -buffersize=128M failed ^ 32483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 32583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 25 ok 32683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 32783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 32883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 32983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 33083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 33183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 33283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 33383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -froobish ^ 33483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vdiff test with unrecognized option should fail, but succeeded ^ 33583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 33683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 26 ok 33783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 33883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 33983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff encode -target %TARGET_FILE% ^ 34083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 34183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo encode with no dictionary option should fail, but succeeded ^ 34283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 34383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 27 ok 34483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 34583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -target %TARGET_FILE% ^ 34683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 34783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo decode with no dictionary option should fail, but succeeded ^ 34883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 34983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 28 ok 35083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 35183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Remove -interleaved and -checksum options 35283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% encode -dictionary %DICTIONARY_FILE% ^ 35383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %TARGET_FILE% ^ 35483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %DELTA_FILE% ^ 35583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode without -interleaved and -checksum options failed ^ 35683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 35783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 35883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %DELTA_FILE% ^ 35983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %OUTPUT_TARGET_FILE% ^ 36083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode non-interleaved output failed ^ 36183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 36283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 36383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original with -interleaved ^ 36483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 36583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 29 ok 36683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 36783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem -target_matches option 36883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% encode -dictionary %DICTIONARY_FILE% ^ 36983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target_matches ^ 37083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -stats ^ 37183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %TARGET_FILE% ^ 37283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %DELTA_FILE% ^ 37383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Encode with -target_matches option failed ^ 37483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 37583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem The decode operation ignores the -target_matches option. 37683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% decode -dictionary %DICTIONARY_FILE% ^ 37783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff < %DELTA_FILE% ^ 37883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff > %OUTPUT_TARGET_FILE% ^ 37983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decode output failed with -target_matches ^ 38083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 38183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdifffc /b %TARGET_FILE% %OUTPUT_TARGET_FILE% ^ 38283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo Decoded target does not match original with -target_matches ^ 38383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 38483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 30 ok 38583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 38683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 38783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 38883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 38983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 39083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff dencode -dictionary %DICTIONARY_FILE% ^ 39183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 39283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 39383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vdiff with unrecognized action should fail, but succeeded ^ 39483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 39583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 31 ok 39683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 39783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 39883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 39983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 40083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vdiff test without delta option should fail, but succeeded ^ 40183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 40283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 32 ok 40383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 40483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 40583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 40683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 40783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo vdiff test without target option should fail, but succeeded ^ 40883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 40983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 33 ok 41083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 41183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem open-vcdiff Issue 8 41283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem (http://code.google.com/p/open-vcdiff/issues/detail?id=8) 41383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem A malicious encoding that tries to produce a 4GB target file made up of 64 41483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem windows, each window having a size of 64MB. 41583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 41683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff decode -dictionary %DICTIONARY_FILE% ^ 41783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %MALICIOUS_ENCODING% ^ 41883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 41983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -max_target_file_size=65536 ^ 42083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo Decoding malicious file should fail, but succeeded ^ 42183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 42283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 34 ok 42383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 42483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 42583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 42683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 42783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff decode -dictionary %DICTIONARY_FILE% ^ 42883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %MALICIOUS_ENCODING% ^ 42983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %OUTPUT_TARGET_FILE% ^ 43083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -max_target_window_size=65536 ^ 43183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff && ( echo Decoding malicious file should fail, but succeeded ^ 43283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 43383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 35 ok 43483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 43583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %OUTPUT_TARGET_FILE% 43683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 43783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Decoding a small target with the -max_target_file_size option should succeed. 43883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 43983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 44083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 44183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 44283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -max_target_file_size=65536 ^ 44383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with -max_target_file_size failed ^ 44483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 44583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 36 ok 44683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 44783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffrem Decoding a small target with -max_target_window_size option should succeed. 44883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff%VCDIFF% %VCD_OPTIONS% ^ 44983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff test -dictionary %DICTIONARY_FILE% ^ 45083bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -target %TARGET_FILE% ^ 45183bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -delta %DELTA_FILE% ^ 45283bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff -max_target_window_size=65536 ^ 45383bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff || ( echo vcdiff test with -max_target_window_size failed ^ 45483bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff &&exit /b 1 ) 45583bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho Test 37 ok 45683bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 45783bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffdel %DELTA_FILE% 45883bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiff 45983bbde0df33922d8dc6fa737cfb306d9caae13b1openvcdiffecho PASS 460