From 121630cb0dafd7187bb66a8c0f1201744f1e163c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 11:22:40 +0100 Subject: Merging upstream version 1.14~rc3. Signed-off-by: Daniel Baumann --- testsuite/check.sh | 11 +++++++++-- testsuite/fox5_bad.lz | Bin 0 -> 400 bytes testsuite/fox5_bad.txt | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 testsuite/fox5_bad.lz create mode 100644 testsuite/fox5_bad.txt (limited to 'testsuite') diff --git a/testsuite/check.sh b/testsuite/check.sh index f208067..ea6e768 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -25,6 +25,8 @@ cd "${objdir}"/tmp in="${testdir}"/test.txt in_lz="${testdir}"/test_v1.lz inD="${testdir}"/test921-1921.txt +fox5="${testdir}"/fox5_bad.txt +fox5_lz="${testdir}"/fox5_bad.lz bad1_lz="${testdir}"/test_bad1.lz bad2_lz="${testdir}"/test_bad2.lz bad3_lz="${testdir}"/test_bad3.lz @@ -33,6 +35,7 @@ bad5_lz="${testdir}"/test_bad5.lz fail=0 # Description of test files for lziprecover: +# fox5_bad.lz: byte at offset 188 changed from 0x34 to 0x33 # test_bad1.lz: byte at offset 67 changed from 0xCC to 0x33 # test_bad2.lz: [ 34- 66) --> copy of bytes [ 68- 100) # test_bad3.lz: [ 512-1536) --> zeroed; [2560-3584) --> zeroed @@ -68,9 +71,13 @@ printf . "${LZIPRECOVER}" -D 921,1000 "${in_lz}" > copy || fail=1 cmp "${inD}" copy || fail=1 printf . +"${LZIPRECOVER}" -D0 -iq -fo copy "${fox5_lz}" +if [ $? = 2 ] && cmp "${fox5}" copy ; then printf . ; else fail=1 ; printf - ; fi +"${LZIPRECOVER}" -D0 -iq "${fox5_lz}" > copy +if [ $? = 2 ] && cmp "${fox5}" copy ; then printf . ; else fail=1 ; printf - ; fi "${LZIPRECOVER}" -m -o copy.lz "${bad1_lz}" "${bad2_lz}" "${bad1_lz}" -q -if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi +if [ $? != 2 ] ; then fail=1 ; printf - ; else printf . ; fi "${LZIPRECOVER}" -m -o copy.lz "${bad1_lz}" "${bad2_lz}" || fail=1 "${LZIPRECOVER}" -df copy.lz || fail=1 cmp "${in}" copy || fail=1 @@ -119,7 +126,7 @@ cat "${in_lz}" "${in_lz}" "${in_lz}" > copy || framework_failure printf "garbage" >> copy || fail=1 "${LZIPRECOVER}" -s -o copy.lz copy || fail=1 for i in 1 2 3 ; do - "${LZIPRECOVER}" -cd rec0000${i}copy.lz > copy || fail=1 + "${LZIPRECOVER}" -cd rec${i}copy.lz > copy || fail=1 cmp "${in}" copy || fail=1 printf . done diff --git a/testsuite/fox5_bad.lz b/testsuite/fox5_bad.lz new file mode 100644 index 0000000..8bfd314 Binary files /dev/null and b/testsuite/fox5_bad.lz differ diff --git a/testsuite/fox5_bad.txt b/testsuite/fox5_bad.txt new file mode 100644 index 0000000..813a71f --- /dev/null +++ b/testsuite/fox5_bad.txt @@ -0,0 +1,4 @@ +The quick brown fox jumps over the lazy dog. +The quick brown fox jumps over the lazy dog. +The quick brown fox c††zzzzzzzzzzzzzzzzzzzzzzThe quick brown fox jumps over the lazy dog. +The quick brown fox jumps over the lazy dog. -- cgit v1.2.3