diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:51:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:51:50 +0000 |
commit | 5af06484d51d352018c9bac507d6157ad93ec7cd (patch) | |
tree | 47bd6e1580b3e7a8aeaad2cf8b0bd602e5f2dae2 /testsuite | |
parent | Adding upstream version 1.21. (diff) | |
download | lziprecover-5af06484d51d352018c9bac507d6157ad93ec7cd.tar.xz lziprecover-5af06484d51d352018c9bac507d6157ad93ec7cd.zip |
Adding upstream version 1.22.upstream/1.22
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/check.sh | 242 | ||||
-rw-r--r-- | testsuite/fox_bcrc.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_crc0.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_das46.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_de20.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_mes81.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_s11.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/fox_v2.lz | bin | 0 -> 80 bytes | |||
-rw-r--r-- | testsuite/test_bad1.lz | bin | 7376 -> 7376 bytes | |||
-rw-r--r-- | testsuite/test_bad6.lz | bin | 0 -> 7376 bytes | |||
-rw-r--r-- | testsuite/test_bad6.txt | 26 | ||||
-rw-r--r-- | testsuite/test_bad7.lz | bin | 0 -> 7376 bytes | |||
-rw-r--r-- | testsuite/test_bad7.txt | 215 | ||||
-rw-r--r-- | testsuite/test_bad8.lz | bin | 0 -> 7376 bytes | |||
-rw-r--r-- | testsuite/test_bad8.txt | 3 | ||||
-rw-r--r-- | testsuite/test_bad9.lz | bin | 0 -> 7376 bytes | |||
-rw-r--r-- | testsuite/test_bad9.txt | 5 | ||||
-rw-r--r-- | testsuite/test_em.txt.lz | bin | 0 -> 14024 bytes |
18 files changed, 448 insertions, 43 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh index a902d93..e78b7f7 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -1,9 +1,9 @@ #! /bin/sh # check script for Lziprecover - Data recovery tool for the lzip format -# Copyright (C) 2009-2019 Antonio Diaz Diaz. +# Copyright (C) 2009-2021 Antonio Diaz Diaz. # # This script is free software: you have unlimited permission -# to copy, distribute and modify it. +# to copy, distribute, and modify it. LC_ALL=C export LC_ALL @@ -32,6 +32,7 @@ cd "${objdir}"/tmp || framework_failure cat "${testdir}"/test.txt > in || framework_failure in_lz="${testdir}"/test.txt.lz in_lzma="${testdir}"/test.txt.lzma +in_em="${testdir}"/test_em.txt.lz inD="${testdir}"/test21723.txt bad1_lz="${testdir}"/test_bad1.lz bad2_lz="${testdir}"/test_bad2.lz @@ -60,11 +61,15 @@ test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; } # Description of test files for lziprecover: # single-member files with one or more errors -# test_bad1.lz: byte at offset 66 changed from 0xA6 to 0x46 +# test_bad1.lz: byte at offset 66 changed from 0xA6 to 0x26 # test_bad2.lz: [ 34- 65] --> copy of bytes [ 68- 99] # test_bad3.lz: [ 512-1535] --> zeroed [2560-3583] --> zeroed # test_bad4.lz: [3072-4095] --> random errors [4608-5631] --> zeroed # test_bad5.lz: [1024-2047] --> random errors [5120-6143] --> random data +# test_bad6.lz: [ 512-1023] --> zeroed (reference test.txt [ 891- 2137]) +# test_bad7.lz: [6656-7167] --> zeroed (reference test.txt [20428-32231]) +# test_bad8.lz: [ 66- 73] --> zeroed (reference test.txt [ 89- 110]) +# test_bad9.lz: [6491-6498] --> zeroed (reference test.txt [17977-18120]) # # 6-member files with one or more errors # fox6_bad1.lz: byte at offset 5 changed from 0x0C to 0x00 (DS) @@ -108,6 +113,11 @@ printf "testing lziprecover-%s..." "$2" [ $? = 2 ] || test_failed $LINENO "${LZIP}" -dq -o in < "${in_lz}" [ $? = 1 ] || test_failed $LINENO +"${LZIP}" -dq -o in "${in_lz}" +[ $? = 1 ] || test_failed $LINENO +"${LZIP}" -dq -o out nx_file.lz +[ $? = 1 ] || test_failed $LINENO +[ ! -e out ] || test_failed $LINENO # these are for code coverage "${LZIP}" -lt "${in_lz}" 2> /dev/null [ $? = 1 ] || test_failed $LINENO @@ -115,7 +125,9 @@ printf "testing lziprecover-%s..." "$2" [ $? = 1 ] || test_failed $LINENO "${LZIP}" -cdt "${in_lz}" > out 2> /dev/null [ $? = 1 ] || test_failed $LINENO -"${LZIP}" -t -- nx_file 2> /dev/null +"${LZIP}" -t -- nx_file.lz 2> /dev/null +[ $? = 1 ] || test_failed $LINENO +"${LZIP}" -t "" < /dev/null 2> /dev/null [ $? = 1 ] || test_failed $LINENO "${LZIP}" --help > /dev/null || test_failed $LINENO "${LZIP}" -n1 -V > /dev/null || test_failed $LINENO @@ -136,6 +148,9 @@ printf "testing lziprecover-%s..." "$2" printf "LZIP\001-.............................." | "${LZIP}" -t 2> /dev/null printf "LZIP\002-.............................." | "${LZIP}" -t 2> /dev/null printf "LZIP\001+.............................." | "${LZIP}" -t 2> /dev/null + +"${LZIPRECOVER}" -eq "${testdir}"/test_bad6.lz +[ $? = 1 ] || test_failed $LINENO "${LZIPRECOVER}" -mq "${bad1_lz}" [ $? = 1 ] || test_failed $LINENO "${LZIPRECOVER}" -Rq @@ -201,8 +216,14 @@ printf "LZIP\001+.............................." | "${LZIP}" -t 2> /dev/null [ $? = 1 ] || test_failed $LINENO "${LZIPRECOVER}" -Akq "${in_lzma}" [ $? = 1 ] || test_failed $LINENO +rm -f copy.lz || framework_failure +"${LZIPRECOVER}" -A "${in_lzma}" -o copy.lz || test_failed $LINENO +cmp "${in_lz}" copy.lz || test_failed $LINENO "${LZIPRECOVER}" -Ac "${in_lzma}" > copy.lz || test_failed $LINENO cmp "${in_lz}" copy.lz || test_failed $LINENO +rm -f copy.lz || framework_failure +"${LZIPRECOVER}" -A -o copy.lz < "${in_lzma}" || test_failed $LINENO +cmp "${in_lz}" copy.lz || test_failed $LINENO "${LZIPRECOVER}" -A < "${in_lzma}" > copy.lz || test_failed $LINENO cmp "${in_lz}" copy.lz || test_failed $LINENO rm -f copy.lz || framework_failure @@ -220,21 +241,35 @@ printf "to be overwritten" > copy.tar.lz || framework_failure "${LZIPRECOVER}" -Af copy.tlz || test_failed $LINENO cmp "${in_lz}" copy.tar.lz || test_failed $LINENO rm -f copy.tar.lz || framework_failure -cat "${in_lzma}" > anyothername || framework_failure -"${LZIPRECOVER}" -A -o copy - anyothername - < "${in_lzma}" || +cat in in > in2 || framework_failure +"${LZIPRECOVER}" -A -o out2.lz - "${in_lzma}" - < "${in_lzma}" || test_failed $LINENO -cmp "${in_lz}" copy.lz || test_failed $LINENO -cmp "${in_lz}" anyothername.lz || test_failed $LINENO -rm -f copy.lz anyothername.lz || framework_failure +"${LZIP}" -cd out2.lz > copy2 || test_failed $LINENO +cmp in2 copy2 || test_failed $LINENO +rm -f out2.lz copy2 || framework_failure printf "\ntesting decompression..." -"${LZIP}" -lq "${in_lz}" || test_failed $LINENO -"${LZIP}" -t "${in_lz}" || test_failed $LINENO -"${LZIP}" -cd "${in_lz}" > copy || test_failed $LINENO -cmp in copy || test_failed $LINENO +for i in "${in_lz}" "${in_em}" ; do + "${LZIP}" -lq "$i" || test_failed $LINENO "$i" + "${LZIP}" -t "$i" || test_failed $LINENO "$i" + "${LZIP}" -d "$i" -o copy || test_failed $LINENO "$i" + cmp in copy || test_failed $LINENO "$i" + "${LZIP}" -cd "$i" > copy || test_failed $LINENO "$i" + cmp in copy || test_failed $LINENO "$i" + "${LZIP}" -d "$i" -o - > copy || test_failed $LINENO "$i" + cmp in copy || test_failed $LINENO "$i" + "${LZIP}" -d < "$i" > copy || test_failed $LINENO "$i" + cmp in copy || test_failed $LINENO "$i" + rm -f copy || framework_failure +done + +lines=$("${LZIP}" -tvv "${in_em}" 2>&1 | wc -l) || test_failed $LINENO +[ "${lines}" -eq 8 ] || test_failed $LINENO "${lines}" + +lines=$("${LZIP}" -lvv "${in_em}" | wc -l) || test_failed $LINENO +[ "${lines}" -eq 11 ] || test_failed $LINENO "${lines}" -rm -f copy || framework_failure cat "${in_lz}" > copy.lz || framework_failure "${LZIP}" -dk copy.lz || test_failed $LINENO cmp in copy || test_failed $LINENO @@ -248,10 +283,16 @@ cmp in copy || test_failed $LINENO printf "to be overwritten" > copy || framework_failure "${LZIP}" -df -o copy < "${in_lz}" || test_failed $LINENO cmp in copy || test_failed $LINENO +rm -f out copy || framework_failure +"${LZIP}" -d -o ./- "${in_lz}" || test_failed $LINENO +cmp in ./- || test_failed $LINENO +rm -f ./- || framework_failure +"${LZIP}" -d -o ./- < "${in_lz}" || test_failed $LINENO +cmp in ./- || test_failed $LINENO +rm -f ./- || framework_failure -rm -f copy || framework_failure cat "${in_lz}" > anyothername || framework_failure -"${LZIP}" -dv --output copy - anyothername - < "${in_lz}" 2> /dev/null || +"${LZIP}" -dv - anyothername - < "${in_lz}" > copy 2> /dev/null || test_failed $LINENO cmp in copy || test_failed $LINENO cmp in anyothername.out || test_failed $LINENO @@ -291,18 +332,20 @@ done [ ! -e nx_file ] || test_failed $LINENO cmp in copy || test_failed $LINENO -cat in in > in2 || framework_failure -cat "${in_lz}" "${in_lz}" > in2.lz || framework_failure -"${LZIP}" -lq in2.lz || test_failed $LINENO -"${LZIP}" -t in2.lz || test_failed $LINENO -"${LZIP}" -cd in2.lz > copy2 || test_failed $LINENO +"${LZIP}" -lq "${in_lz}" "${in_lz}" || test_failed $LINENO +"${LZIP}" -t "${in_lz}" "${in_lz}" || test_failed $LINENO +"${LZIP}" -cd "${in_lz}" "${in_lz}" -o out > copy2 || test_failed $LINENO +[ ! -e out ] || test_failed $LINENO # override -o +cmp in2 copy2 || test_failed $LINENO +rm -f copy2 || framework_failure +"${LZIP}" -d "${in_lz}" "${in_lz}" -o copy2 || test_failed $LINENO cmp in2 copy2 || test_failed $LINENO +rm -f copy2 || framework_failure -cat in2.lz > copy2.lz || framework_failure +cat "${in_lz}" "${in_lz}" > copy2.lz || framework_failure printf "\ngarbage" >> copy2.lz || framework_failure "${LZIP}" -tvvvv copy2.lz 2> /dev/null || test_failed $LINENO -rm -f copy2 || framework_failure -"${LZIP}" -aD0 -q copy2.lz +"${LZIPRECOVER}" -aD0 -q copy2.lz [ $? = 2 ] || test_failed $LINENO "${LZIP}" -alq copy2.lz [ $? = 2 ] || test_failed $LINENO @@ -319,6 +362,7 @@ rm -f copy2 || framework_failure printf "to be overwritten" > copy2 || framework_failure "${LZIP}" -df copy2.lz || test_failed $LINENO cmp in2 copy2 || test_failed $LINENO +rm -f copy2 || framework_failure "${LZIPRECOVER}" -D ,18000 "${in_lz}" > copy || test_failed $LINENO "${LZIPRECOVER}" -D 18000 "${in_lz}" >> copy || test_failed $LINENO @@ -327,19 +371,6 @@ cmp in copy || test_failed $LINENO cmp "${inD}" copy || test_failed $LINENO "${LZIPRECOVER}" -D 21723,397 "${in_lz}" > copy || test_failed $LINENO cmp "${inD}" copy || test_failed $LINENO -"${LZIPRECOVER}" -D0 -iq "${f6b1_lz}" -fo copy -[ $? = 2 ] || test_failed $LINENO -cmp "${f6b1}" copy || test_failed $LINENO -"${LZIPRECOVER}" -D0 -iq "${f6b1_lz}" > copy -[ $? = 2 ] || test_failed $LINENO -cmp "${f6b1}" copy || test_failed $LINENO - -printf "LZIP\001+" > in2t.lz || framework_failure # gap size < 36 bytes -cat "${in_lz}" in "${in_lz}" >> in2t.lz || framework_failure -printf "LZIP\001-" >> in2t.lz || framework_failure # truncated member -"${LZIPRECOVER}" -D0 -i in2t.lz > copy2 || test_failed $LINENO -cmp in2 copy2 || test_failed $LINENO -rm -f in2 in2t.lz copy2 || framework_failure printf "\ntesting bad input..." @@ -411,6 +442,24 @@ else fi rm -f int.lz || framework_failure +for i in fox_v2.lz fox_s11.lz fox_de20.lz \ + fox_bcrc.lz fox_crc0.lz fox_das46.lz fox_mes81.lz ; do + "${LZIP}" -tq "${testdir}"/$i + [ $? = 2 ] || test_failed $LINENO $i +done + +"${LZIP}" -cd "${fox_lz}" > fox || test_failed $LINENO +for i in fox_bcrc.lz fox_crc0.lz fox_das46.lz fox_mes81.lz ; do + "${LZIP}" -cdq "${testdir}"/$i > out + [ $? = 2 ] || test_failed $LINENO $i + cmp fox out || test_failed $LINENO $i + "${LZIPRECOVER}" -tq -i "${testdir}"/$i || test_failed $LINENO $i + "${LZIPRECOVER}" -cdq -i "${testdir}"/$i > out || test_failed $LINENO $i + cmp fox out || test_failed $LINENO $i +done +rm -f fox out || framework_failure + +cat "${in_lz}" "${in_lz}" > in2.lz || framework_failure cat "${in_lz}" "${in_lz}" "${in_lz}" > in3.lz || framework_failure if dd if=in3.lz of=trunc.lz bs=14752 count=1 2> /dev/null && [ -e trunc.lz ] && cmp in2.lz trunc.lz > /dev/null 2>&1 ; then @@ -434,11 +483,11 @@ rm -f in3.lz trunc.lz out || framework_failure for i in "${f6s1_lz}" "${f6s2_lz}" ; do lines=`"${LZIP}" -lvv "$i" | wc -l || test_failed $LINENO "$i"` - [ "${lines}" -eq 2 ] || test_failed $LINENO "$i" + [ "${lines}" -eq 2 ] || test_failed $LINENO "$i ${lines}" done for i in "${f6s3_lz}" "${f6s4_lz}" "${f6s5_lz}" "${f6s6_lz}" ; do lines=`"${LZIP}" -lvv "$i" | wc -l || test_failed $LINENO "$i"` - [ "${lines}" -eq 9 ] || test_failed $LINENO "$i" + [ "${lines}" -eq 9 ] || test_failed $LINENO "$i ${lines}" done cat "${in_lz}" > ingin.lz || framework_failure @@ -446,13 +495,50 @@ printf "g" >> ingin.lz || framework_failure cat "${in_lz}" >> ingin.lz || framework_failure "${LZIP}" -lq ingin.lz [ $? = 2 ] || test_failed $LINENO -"${LZIP}" -lq -i ingin.lz || test_failed $LINENO +"${LZIP}" -atq ingin.lz +[ $? = 2 ] || test_failed $LINENO +"${LZIP}" -atq < ingin.lz +[ $? = 2 ] || test_failed $LINENO +"${LZIP}" -acdq ingin.lz > out +[ $? = 2 ] || test_failed $LINENO +"${LZIP}" -adq < ingin.lz > out +[ $? = 2 ] || test_failed $LINENO +"${LZIPRECOVER}" -lq -i ingin.lz || test_failed $LINENO "${LZIP}" -t ingin.lz || test_failed $LINENO +"${LZIP}" -t < ingin.lz || test_failed $LINENO "${LZIP}" -cd ingin.lz > copy || test_failed $LINENO cmp in copy || test_failed $LINENO -"${LZIP}" -t < ingin.lz || test_failed $LINENO "${LZIP}" -d < ingin.lz > copy || test_failed $LINENO cmp in copy || test_failed $LINENO +"${LZIPRECOVER}" -cd -i ingin.lz > copy2 || test_failed $LINENO +cmp in2 copy2 || test_failed $LINENO + +"${LZIPRECOVER}" -D0 -q "${f6b1_lz}" -fo copy +[ $? = 2 ] || test_failed $LINENO +cmp -s "${f6b1}" copy && test_failed $LINENO +"${LZIPRECOVER}" -D0 -q "${f6b1_lz}" > copy +[ $? = 2 ] || test_failed $LINENO +cmp -s "${f6b1}" copy && test_failed $LINENO +"${LZIPRECOVER}" -D0 -iq "${f6b1_lz}" -fo copy || test_failed $LINENO +cmp "${f6b1}" copy || test_failed $LINENO +"${LZIPRECOVER}" -D0 -iq "${f6b1_lz}" > copy || test_failed $LINENO +cmp "${f6b1}" copy || test_failed $LINENO + +touch empty || framework_failure +"${LZIPRECOVER}" -D0 -q ingin.lz > copy +[ $? = 2 ] || test_failed $LINENO +cmp empty copy || test_failed $LINENO +"${LZIPRECOVER}" -D0 -i ingin.lz > copy2 || test_failed $LINENO +cmp in2 copy2 || test_failed $LINENO +printf "LZIP\001+" > in2t.lz || framework_failure # gap size < 36 bytes +cat "${in_lz}" in "${in_lz}" >> in2t.lz || framework_failure +printf "LZIP\001-" >> in2t.lz || framework_failure # truncated member +"${LZIPRECOVER}" -D0 -iq in2t.lz > copy2 || test_failed $LINENO +cmp in2 copy2 || test_failed $LINENO +"${LZIPRECOVER}" -cd -iq in2t.lz > copy2 || test_failed $LINENO +cmp in2 copy2 || test_failed $LINENO +"${LZIPRECOVER}" -t -iq in2t.lz || test_failed $LINENO +rm -f in2 in2t.lz copy copy2 || framework_failure printf "\ntesting --merge..." @@ -635,7 +721,78 @@ mv copy.tar.lz copy.lz || framework_failure mv copy.lz copy.tlz || framework_failure "${LZIPRECOVER}" -R copy.tlz || test_failed $LINENO [ -e copy_fixed.tlz ] || test_failed $LINENO -rm -f copy_fixed.* copy.tlz || framework_failure +rm -f copy_fixed.tlz copy_fixed.lz copy_fixed.tar.lz copy.tlz || + framework_failure + +printf "\ntesting --reproduce..." + +if [ -z "${LZIP_NAME}" ] ; then LZIP_NAME=lzip ; fi +if /bin/sh -c "${LZIP_NAME} -s18KiB" < in > out 2> /dev/null && + cmp "${in_lz}" out > /dev/null 2>&1 ; then + rm -f out || framework_failure + "${LZIPRECOVER}" --reproduce --lzip-name="${LZIP_NAME}" -o out \ + --reference-file=foo "${in_lz}" || test_failed $LINENO "${LZIP_NAME}" + [ ! -e out ] || test_failed $LINENO + + for i in 6 7 8 9 ; do + for f in "${testdir}"/test_bad${i}.txt "${testdir}"/test.txt ; do + rm -f out || framework_failure + "${LZIPRECOVER}" -q --reproduce --lzip-name="${LZIP_NAME}" \ + --reference-file="$f" "${testdir}"/test_bad${i}.lz -o out || + test_failed $LINENO "${LZIP_NAME} $i $f" + cmp "${in_lz}" out || test_failed $LINENO "${LZIP_NAME} $i $f" + rm -f out || framework_failure + "${LZIPRECOVER}" -q --reproduce --lzip-name="${LZIP_NAME}" \ + --reference-file="$f" "${testdir}"/test_bad${i}.lz -o out \ + --lzip-level=6 || test_failed $LINENO "${LZIP_NAME} $i $f level=6" + cmp "${in_lz}" out || test_failed $LINENO "${LZIP_NAME} $i $f level=6" + rm -f out || framework_failure + "${LZIPRECOVER}" -q --reproduce --lzip-name="${LZIP_NAME}" \ + --reference-file="$f" "${testdir}"/test_bad${i}.lz -o out \ + --lzip-level=m36 || test_failed $LINENO "${LZIP_NAME} $i $f level=m36" + cmp "${in_lz}" out || test_failed $LINENO "${LZIP_NAME} $i $f level=m36" + done + done + + cat "${in_lz}" "${in_lz}" "${in_lz}" "${in_lz}" > in4.lz || framework_failure + # multimember reproduction using test_bad[6789].txt as reference + cat "${testdir}"/test_bad6.lz "${testdir}"/test_bad7.lz \ + "${testdir}"/test_bad8.lz "${testdir}"/test_bad9.lz > mm_bad.lz || + framework_failure + rm -f out || framework_failure + for i in 6 7 8 9 ; do # reproduce one member each time + "${LZIPRECOVER}" -q --reproduce --lzip-name="${LZIP_NAME}" \ + --reference-file="${testdir}"/test_bad${i}.txt mm_bad.lz -o out || + test_failed $LINENO "${LZIP_NAME} $i" + mv -f out mm_bad.lz + done + cmp in4.lz mm_bad.lz || test_failed $LINENO "${LZIP_NAME}" + + # multimember reproduction using test.txt as reference + cat "${testdir}"/test_bad6.lz "${testdir}"/test_bad7.lz \ + "${testdir}"/test_bad8.lz "${testdir}"/test_bad9.lz > mm_bad.lz || + framework_failure + rm -f out || framework_failure + for i in 6 7 8 9 ; do # reproduce one member each time + "${LZIPRECOVER}" -q --reproduce --lzip-name="${LZIP_NAME}" \ + --reference-file="${testdir}"/test.txt mm_bad.lz -o out || + test_failed $LINENO "${LZIP_NAME} $i" + mv -f out mm_bad.lz + done + cmp in4.lz mm_bad.lz || test_failed $LINENO "${LZIP_NAME}" + rm -f in4.lz mm_bad.lz || framework_failure + + "${LZIPRECOVER}" -q --debug-reproduce=13-7356 --lzip-name="${LZIP_NAME}" \ + --reference-file="${testdir}"/test.txt "${testdir}"/test.txt.lz || + test_failed $LINENO "${LZIP_NAME}" + + "${LZIPRECOVER}" -q --debug-reproduce=512,5120,512 --lzip-name="${LZIP_NAME}" \ + --reference-file="${testdir}"/test.txt "${testdir}"/test.txt.lz || + test_failed $LINENO "${LZIP_NAME}" +else + printf "\nwarning: skipping --reproduce test: ${LZIP_NAME} not found or not the right version." + printf "\nTry 'make LZIP_NAME=<name_of_lzip_executable> check'." +fi printf "\ntesting --split..." @@ -785,7 +942,6 @@ rm -f rec*ingin.lz || framework_failure printf "\ntesting --*=damaged..." -touch empty || framework_failure cat "${in_lz}" > in.lz || framework_failure cat "${in_lz}" in > int.lz || framework_failure "${LZIPRECOVER}" --dump=damaged in.lz > copy || test_failed $LINENO diff --git a/testsuite/fox_bcrc.lz b/testsuite/fox_bcrc.lz Binary files differnew file mode 100644 index 0000000..8f6a7c4 --- /dev/null +++ b/testsuite/fox_bcrc.lz diff --git a/testsuite/fox_crc0.lz b/testsuite/fox_crc0.lz Binary files differnew file mode 100644 index 0000000..1abe926 --- /dev/null +++ b/testsuite/fox_crc0.lz diff --git a/testsuite/fox_das46.lz b/testsuite/fox_das46.lz Binary files differnew file mode 100644 index 0000000..43ed9f9 --- /dev/null +++ b/testsuite/fox_das46.lz diff --git a/testsuite/fox_de20.lz b/testsuite/fox_de20.lz Binary files differnew file mode 100644 index 0000000..10949d8 --- /dev/null +++ b/testsuite/fox_de20.lz diff --git a/testsuite/fox_mes81.lz b/testsuite/fox_mes81.lz Binary files differnew file mode 100644 index 0000000..d50ef2e --- /dev/null +++ b/testsuite/fox_mes81.lz diff --git a/testsuite/fox_s11.lz b/testsuite/fox_s11.lz Binary files differnew file mode 100644 index 0000000..dca909c --- /dev/null +++ b/testsuite/fox_s11.lz diff --git a/testsuite/fox_v2.lz b/testsuite/fox_v2.lz Binary files differnew file mode 100644 index 0000000..8620981 --- /dev/null +++ b/testsuite/fox_v2.lz diff --git a/testsuite/test_bad1.lz b/testsuite/test_bad1.lz Binary files differindex 16762ca..2129c90 100644 --- a/testsuite/test_bad1.lz +++ b/testsuite/test_bad1.lz diff --git a/testsuite/test_bad6.lz b/testsuite/test_bad6.lz Binary files differnew file mode 100644 index 0000000..cfea88c --- /dev/null +++ b/testsuite/test_bad6.lz diff --git a/testsuite/test_bad6.txt b/testsuite/test_bad6.txt new file mode 100644 index 0000000..b47462e --- /dev/null +++ b/testsuite/test_bad6.txt @@ -0,0 +1,26 @@ +) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to
\ No newline at end of file diff --git a/testsuite/test_bad7.lz b/testsuite/test_bad7.lz Binary files differnew file mode 100644 index 0000000..77f2b85 --- /dev/null +++ b/testsuite/test_bad7.lz diff --git a/testsuite/test_bad7.txt b/testsuite/test_bad7.txt new file mode 100644 index 0000000..be54c7c --- /dev/null +++ b/testsuite/test_bad7.txt @@ -0,0 +1,215 @@ +, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
\ No newline at end of file diff --git a/testsuite/test_bad8.lz b/testsuite/test_bad8.lz Binary files differnew file mode 100644 index 0000000..fca701b --- /dev/null +++ b/testsuite/test_bad8.lz diff --git a/testsuite/test_bad8.txt b/testsuite/test_bad8.txt new file mode 100644 index 0000000..3cb3ff4 --- /dev/null +++ b/testsuite/test_bad8.txt @@ -0,0 +1,3 @@ +1 + + Copyright (C) 1989
\ No newline at end of file diff --git a/testsuite/test_bad9.lz b/testsuite/test_bad9.lz Binary files differnew file mode 100644 index 0000000..becb0ec --- /dev/null +++ b/testsuite/test_bad9.lz diff --git a/testsuite/test_bad9.txt b/testsuite/test_bad9.txt new file mode 100644 index 0000000..b72a626 --- /dev/null +++ b/testsuite/test_bad9.txt @@ -0,0 +1,5 @@ +General +Public License instead of this License. + GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
diff --git a/testsuite/test_em.txt.lz b/testsuite/test_em.txt.lz Binary files differnew file mode 100644 index 0000000..7e96250 --- /dev/null +++ b/testsuite/test_em.txt.lz |