Merging upstream version 1.12~rc1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4ddb634c25
commit
cd6a248630
24 changed files with 874 additions and 719 deletions
|
@ -28,9 +28,8 @@ if [ -d tmp ] ; then rm -rf tmp ; fi
|
|||
mkdir tmp
|
||||
cd "${objdir}"/tmp || framework_failure
|
||||
|
||||
cat "${testdir}"/test.txt > in || framework_failure
|
||||
cp "${testdir}"/test.txt in || framework_failure
|
||||
in_lz="${testdir}"/test.txt.lz
|
||||
in_em="${testdir}"/test_em.txt.lz
|
||||
fox_lz="${testdir}"/fox.lz
|
||||
fail=0
|
||||
lwarn8=0
|
||||
|
@ -112,33 +111,25 @@ printf "LZIP\001+.............................." | "${LZIP}" -t 2> /dev/null
|
|||
|
||||
printf "\ntesting decompression..."
|
||||
|
||||
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 out || test_failed $LINENO "$i"
|
||||
cmp in out || test_failed $LINENO "$i"
|
||||
"${LZIP}" -cd "$i" > out || test_failed $LINENO "$i"
|
||||
cmp in out || test_failed $LINENO "$i"
|
||||
"${LZIP}" -d "$i" -o - > out || test_failed $LINENO "$i"
|
||||
cmp in out || test_failed $LINENO "$i"
|
||||
"${LZIP}" -d < "$i" > out || test_failed $LINENO "$i"
|
||||
cmp in out || test_failed $LINENO "$i"
|
||||
rm -f out || framework_failure
|
||||
done
|
||||
"${LZIP}" -l "${in_lz}" > /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -t "${in_lz}" || test_failed $LINENO
|
||||
"${LZIP}" -d "${in_lz}" -o out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
"${LZIP}" -cd "${in_lz}" > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
"${LZIP}" -d "${in_lz}" -o - > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
"${LZIP}" -d < "${in_lz}" > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
rm -f out || framework_failure
|
||||
|
||||
lines=`"${LZIP}" -tvv "${in_em}" 2>&1 | wc -l` || test_failed $LINENO
|
||||
[ "${lines}" -eq 1 ] || test_failed $LINENO "${lines}"
|
||||
|
||||
lines=`"${LZIP}" -lvv "${in_em}" | wc -l` || test_failed $LINENO
|
||||
[ "${lines}" -eq 11 ] || test_failed $LINENO "${lines}"
|
||||
|
||||
cat "${in_lz}" > out.lz || framework_failure
|
||||
cp "${in_lz}" out.lz || framework_failure
|
||||
"${LZIP}" -dk out.lz || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
rm -f out || framework_failure
|
||||
"${LZIP}" -cd "${fox_lz}" > fox || test_failed $LINENO
|
||||
cat fox > copy || framework_failure
|
||||
cat "${in_lz}" > copy.lz || framework_failure
|
||||
cp fox copy || framework_failure
|
||||
cp "${in_lz}" copy.lz || framework_failure
|
||||
"${LZIP}" -d copy.lz out.lz 2> /dev/null # skip copy, decompress out
|
||||
[ $? = 1 ] || test_failed $LINENO
|
||||
[ ! -e out.lz ] || test_failed $LINENO
|
||||
|
@ -152,7 +143,6 @@ rm -f copy out || framework_failure
|
|||
printf "to be overwritten" > out || framework_failure
|
||||
"${LZIP}" -df -o out < "${in_lz}" || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
rm -f out || framework_failure
|
||||
"${LZIP}" -d -o ./- "${in_lz}" || test_failed $LINENO
|
||||
cmp in ./- || test_failed $LINENO
|
||||
rm -f ./- || framework_failure
|
||||
|
@ -160,12 +150,12 @@ rm -f ./- || framework_failure
|
|||
cmp in ./- || test_failed $LINENO
|
||||
rm -f ./- || framework_failure
|
||||
|
||||
cat "${in_lz}" > anyothername || framework_failure
|
||||
cp "${in_lz}" anyothername || framework_failure
|
||||
"${LZIP}" -dv - anyothername - < "${in_lz}" > out 2> /dev/null ||
|
||||
test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
cmp in anyothername.out || test_failed $LINENO
|
||||
rm -f out anyothername.out || framework_failure
|
||||
rm -f anyothername.out || framework_failure
|
||||
|
||||
"${LZIP}" -lq in "${in_lz}"
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
|
@ -182,7 +172,7 @@ cat out in | cmp in - || test_failed $LINENO # out must be empty
|
|||
[ $? = 1 ] || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
rm -f out || framework_failure
|
||||
cat "${in_lz}" > out.lz || framework_failure
|
||||
cp "${in_lz}" out.lz || framework_failure
|
||||
for i in 1 2 3 4 5 6 7 ; do
|
||||
printf "g" >> out.lz || framework_failure
|
||||
"${LZIP}" -alvv out.lz "${in_lz}" > /dev/null 2>&1
|
||||
|
@ -203,7 +193,7 @@ cmp in out || test_failed $LINENO
|
|||
rm -f out || framework_failure
|
||||
|
||||
cat in in > in2 || framework_failure
|
||||
"${LZIP}" -lq "${in_lz}" "${in_lz}" || test_failed $LINENO
|
||||
"${LZIP}" -l "${in_lz}" "${in_lz}" > /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -t "${in_lz}" "${in_lz}" || test_failed $LINENO
|
||||
"${LZIP}" -cd "${in_lz}" "${in_lz}" -o out > out2 || test_failed $LINENO
|
||||
[ ! -e out ] || test_failed $LINENO # override -o
|
||||
|
@ -214,6 +204,11 @@ cmp in2 out2 || test_failed $LINENO
|
|||
rm -f out2 || framework_failure
|
||||
|
||||
cat "${in_lz}" "${in_lz}" > out2.lz || framework_failure
|
||||
lines=`"${LZIP}" -tvv out2.lz 2>&1 | wc -l` || test_failed $LINENO
|
||||
[ "${lines}" -eq 1 ] || test_failed $LINENO "${lines}"
|
||||
lines=`"${LZIP}" -lvv out2.lz | wc -l` || test_failed $LINENO
|
||||
[ "${lines}" -eq 5 ] || test_failed $LINENO "${lines}"
|
||||
|
||||
printf "\ngarbage" >> out2.lz || framework_failure
|
||||
"${LZIP}" -tvvvv out2.lz 2> /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -alq out2.lz
|
||||
|
@ -243,6 +238,21 @@ rm -rf a || framework_failure
|
|||
[ $? = 1 ] || test_failed $LINENO
|
||||
[ ! -e a ] || test_failed $LINENO
|
||||
|
||||
touch empty em || framework_failure
|
||||
"${LZIP}" -0 em || test_failed $LINENO
|
||||
"${LZIP}" -l em.lz > /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -dk em.lz || test_failed $LINENO
|
||||
cmp empty em || test_failed $LINENO
|
||||
cat em.lz em.lz | "${LZIP}" -t || test_failed $LINENO
|
||||
cat em.lz em.lz | "${LZIP}" -d > em || test_failed $LINENO
|
||||
cmp empty em || test_failed $LINENO
|
||||
cat em.lz "${in_lz}" | "${LZIP}" -t || test_failed $LINENO
|
||||
cat em.lz "${in_lz}" | "${LZIP}" -d > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
cat "${in_lz}" em.lz | "${LZIP}" -t || test_failed $LINENO
|
||||
cat "${in_lz}" em.lz | "${LZIP}" -d > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
|
||||
printf "\ntesting compression..."
|
||||
|
||||
"${LZIP}" -c -0 in in in -o out3.lz > copy2.lz || test_failed $LINENO
|
||||
|
@ -251,7 +261,7 @@ printf "\ntesting compression..."
|
|||
"${LZIP}" -d copy2.lz -o out2 || test_failed $LINENO
|
||||
[ -e copy2.lz ] || test_failed $LINENO
|
||||
cmp in2 out2 || test_failed $LINENO
|
||||
rm -f in2 out2 copy2.lz || framework_failure
|
||||
rm -f copy2.lz || framework_failure
|
||||
|
||||
"${LZIP}" -cf "${in_lz}" > lzlz 2> /dev/null # /dev/null is a tty on OS/2
|
||||
[ $? = 1 ] || test_failed $LINENO
|
||||
|
@ -332,11 +342,44 @@ rm -rf a fox || framework_failure
|
|||
|
||||
printf "\ntesting bad input..."
|
||||
|
||||
cat em.lz em.lz > ee.lz || framework_failure
|
||||
"${LZIP}" -l < ee.lz > /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -t < ee.lz || test_failed $LINENO
|
||||
"${LZIP}" -d < ee.lz > em || test_failed $LINENO
|
||||
cmp empty em || test_failed $LINENO
|
||||
"${LZIP}" -lq ee.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -tq ee.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -dq ee.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
[ ! -e ee ] || test_failed $LINENO
|
||||
"${LZIP}" -cdq ee.lz > em
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
cmp empty em || test_failed $LINENO
|
||||
rm -f empty em || framework_failure
|
||||
cat "${in_lz}" em.lz "${in_lz}" > inein.lz || framework_failure
|
||||
"${LZIP}" -l < inein.lz > /dev/null || test_failed $LINENO
|
||||
"${LZIP}" -t < inein.lz || test_failed $LINENO
|
||||
"${LZIP}" -d < inein.lz > out2 || test_failed $LINENO
|
||||
cmp in2 out2 || test_failed $LINENO
|
||||
"${LZIP}" -lq inein.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -tq inein.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -dq inein.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
[ ! -e inein ] || test_failed $LINENO
|
||||
"${LZIP}" -cdq inein.lz > out2
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
cmp in2 out2 || test_failed $LINENO
|
||||
rm -f in2 out2 inein.lz em.lz || framework_failure
|
||||
|
||||
headers='LZIp LZiP LZip LzIP LzIp LziP lZIP lZIp lZiP lzIP'
|
||||
body='\001\014\000\203\377\373\377\377\300\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000$\000\000\000\000\000\000\000'
|
||||
cat "${in_lz}" > int.lz || framework_failure
|
||||
body='\001\014\000\000\101\376\367\377\377\340\000\200\000\215\357\002\322\001\000\000\000\000\000\000\000\045\000\000\000\000\000\000\000'
|
||||
cp "${in_lz}" int.lz || framework_failure
|
||||
printf "LZIP${body}" >> int.lz || framework_failure
|
||||
if "${LZIP}" -tq int.lz ; then
|
||||
if "${LZIP}" -t int.lz ; then
|
||||
for header in ${headers} ; do
|
||||
printf "${header}${body}" > int.lz || framework_failure
|
||||
"${LZIP}" -lq int.lz # first member
|
||||
|
@ -355,7 +398,7 @@ if "${LZIP}" -tq int.lz ; then
|
|||
[ $? = 2 ] || test_failed $LINENO ${header}
|
||||
"${LZIP}" -cdq --loose-trailing int.lz > /dev/null
|
||||
[ $? = 2 ] || test_failed $LINENO ${header}
|
||||
cat "${in_lz}" > int.lz || framework_failure
|
||||
cp "${in_lz}" int.lz || framework_failure
|
||||
printf "${header}${body}" >> int.lz || framework_failure
|
||||
"${LZIP}" -lq int.lz # trailing data
|
||||
[ $? = 2 ] || test_failed $LINENO ${header}
|
||||
|
@ -365,7 +408,7 @@ if "${LZIP}" -tq int.lz ; then
|
|||
[ $? = 2 ] || lzlib_1_10 # requires lzlib 1.10
|
||||
"${LZIP}" -cdq int.lz > /dev/null
|
||||
[ $? = 2 ] || test_failed $LINENO ${header}
|
||||
"${LZIP}" -lq --loose-trailing int.lz ||
|
||||
"${LZIP}" -l --loose-trailing int.lz > /dev/null ||
|
||||
test_failed $LINENO ${header}
|
||||
"${LZIP}" -t --loose-trailing int.lz ||
|
||||
test_failed $LINENO ${header}
|
||||
|
@ -383,7 +426,7 @@ if "${LZIP}" -tq int.lz ; then
|
|||
[ $? = 2 ] || test_failed $LINENO ${header}
|
||||
done
|
||||
else
|
||||
printf "\nwarning: skipping header test: 'printf' does not work on your system."
|
||||
printf "warning: skipping header test: 'printf' does not work on your system."
|
||||
fi
|
||||
rm -f int.lz || framework_failure
|
||||
|
||||
|
@ -395,9 +438,9 @@ done
|
|||
|
||||
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
|
||||
for i in 6 20 14734 14753 14754 14755 14756 14757 14758 ; do
|
||||
if dd if=in3.lz of=trunc.lz bs=14682 count=1 2> /dev/null &&
|
||||
[ -e trunc.lz ] && cmp in2.lz trunc.lz ; then
|
||||
for i in 6 20 14664 14683 14684 14685 14686 14687 14688 ; do
|
||||
dd if=in3.lz of=trunc.lz bs=$i count=1 2> /dev/null
|
||||
"${LZIP}" -lq trunc.lz
|
||||
[ $? = 2 ] || test_failed $LINENO $i
|
||||
|
@ -411,11 +454,11 @@ if dd if=in3.lz of=trunc.lz bs=14752 count=1 2> /dev/null &&
|
|||
[ $? = 2 ] || lzlib_1_8 # requires lzlib 1.8
|
||||
done
|
||||
else
|
||||
printf "\nwarning: skipping truncation test: 'dd' does not work on your system."
|
||||
printf "warning: skipping truncation test: 'dd' does not work on your system."
|
||||
fi
|
||||
rm -f in2.lz in3.lz trunc.lz || framework_failure
|
||||
|
||||
cat "${in_lz}" > ingin.lz || framework_failure
|
||||
cp "${in_lz}" ingin.lz || framework_failure
|
||||
printf "g" >> ingin.lz || framework_failure
|
||||
cat "${in_lz}" >> ingin.lz || framework_failure
|
||||
"${LZIP}" -lq ingin.lz
|
||||
|
@ -424,14 +467,17 @@ cat "${in_lz}" >> ingin.lz || framework_failure
|
|||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -atq < ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -acdq ingin.lz > /dev/null
|
||||
"${LZIP}" -acdq ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -adq < ingin.lz > /dev/null
|
||||
"${LZIP}" -adq < ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -tq ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -t < ingin.lz || test_failed $LINENO
|
||||
"${LZIP}" -cdq ingin.lz > out
|
||||
"${LZIP}" -dq ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
[ ! -e ingin ] || test_failed $LINENO
|
||||
"${LZIP}" -cdq ingin.lz
|
||||
[ $? = 2 ] || test_failed $LINENO
|
||||
"${LZIP}" -d < ingin.lz > out || test_failed $LINENO
|
||||
cmp in out || test_failed $LINENO
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
@ -339,8 +338,7 @@ Public License instead of this License.
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue