summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/check.sh159
-rw-r--r--testsuite/em.lzbin0 -> 36 bytes
-rw-r--r--testsuite/fox6.lzbin480 -> 0 bytes
-rw-r--r--testsuite/fox6_mark.lzbin480 -> 0 bytes
-rw-r--r--testsuite/fox_nz.lzbin0 -> 80 bytes
-rw-r--r--testsuite/test.txt6
-rw-r--r--testsuite/test.txt.lzbin7376 -> 7341 bytes
-rw-r--r--testsuite/test_em.txt.lzbin14024 -> 0 bytes
8 files changed, 100 insertions, 65 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 1d36069..296e165 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -28,18 +28,17 @@ 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
+em_lz="${testdir}"/em.lz
fox_lz="${testdir}"/fox.lz
-fox6_lz="${testdir}"/fox6.lz
-f6mk_lz="${testdir}"/fox6_mark.lz
+fnz_lz="${testdir}"/fox_nz.lz
fail=0
test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; }
printf "testing lunzip-%s..." "$2"
-cat "${in_lz}" > uin.lz || framework_failure
+cp "${in_lz}" uin.lz || framework_failure
for i in bad_size -1 0 4095 513MiB 1G 1T 1P 1E 1Z 1Y 10KB ; do
"${LZIP}" -dfkq -u $i uin.lz
[ $? = 1 ] || test_failed $LINENO $i
@@ -96,37 +95,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
-
-lines=`"${LZIP}" -tvv "${in_em}" 2>&1 | wc -l` || test_failed $LINENO
-[ "${lines}" -eq 8 ] || test_failed $LINENO "${lines}"
-"${LZIP}" -tq "${in_em}" --empty-error
-[ $? = 2 ] || test_failed $LINENO
-
-lines=`"${LZIP}" -lvv "${in_em}" | wc -l` || test_failed $LINENO
-[ "${lines}" -eq 11 ] || test_failed $LINENO "${lines}"
-"${LZIP}" -lq "${in_em}" --empty-error
-[ $? = 2 ] || test_failed $LINENO
+"${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
-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
@@ -140,7 +127,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
@@ -148,12 +134,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
@@ -170,7 +156,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
@@ -191,7 +177,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
@@ -202,6 +188,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 2 ] || 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
@@ -233,16 +224,6 @@ for i in 12 5120 6Ki 29 512KiB ; do
cmp in2 out2 || test_failed $LINENO $i
rm -f out2 || framework_failure
done
-rm -f in2 out || framework_failure
-
-"${LZIP}" -cd "${fox6_lz}" > out || test_failed $LINENO
-"${LZIP}" -cd "${f6mk_lz}" > copy || test_failed $LINENO
-cmp copy out || test_failed $LINENO
-rm -f copy out || framework_failure
-"${LZIP}" -lq "${f6mk_lz}" --marking-error
-[ $? = 2 ] || test_failed $LINENO
-"${LZIP}" -tq "${f6mk_lz}" --marking-error
-[ $? = 2 ] || test_failed $LINENO
"${LZIP}" -d "${fox_lz}" -o a/b/c/fox || test_failed $LINENO
cmp fox a/b/c/fox || test_failed $LINENO
@@ -254,13 +235,61 @@ rm -rf a || framework_failure
[ $? = 1 ] || test_failed $LINENO
[ ! -e a ] || test_failed $LINENO
+touch empty || framework_failure
+cp "${em_lz}" em.lz || framework_failure
+"${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 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
@@ -279,7 +308,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}
@@ -289,7 +318,7 @@ if "${LZIP}" -tq int.lz ; then
[ $? = 2 ] || test_failed $LINENO ${header}
"${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}
@@ -307,10 +336,14 @@ 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
+"${LZIP}" -l "${fnz_lz}" > /dev/null || test_failed $LINENO
+"${LZIP}" -tq "${fnz_lz}"
+[ $? = 2 ] || test_failed $LINENO
+
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
@@ -322,13 +355,13 @@ for i in fox_bcrc.lz fox_crc0.lz fox_das46.lz fox_mes81.lz ; do
[ $? = 2 ] || test_failed $LINENO $i
cmp fox out || test_failed $LINENO $i
done
-rm -f fox out || framework_failure
+rm -f fox || 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
- 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
@@ -342,11 +375,11 @@ if dd if=in3.lz of=trunc.lz bs=14752 count=1 2> /dev/null &&
[ $? = 2 ] || test_failed $LINENO $i
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
@@ -355,17 +388,21 @@ 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 > out
[ $? = 2 ] || test_failed $LINENO
-"${LZIP}" -adq < ingin.lz > /dev/null
+cmp in out || test_failed $LINENO
+"${LZIP}" -adq < ingin.lz > out
[ $? = 2 ] || test_failed $LINENO
+cmp in out || test_failed $LINENO
"${LZIP}" -t ingin.lz || test_failed $LINENO
"${LZIP}" -t < ingin.lz || test_failed $LINENO
+"${LZIP}" -dk ingin.lz || test_failed $LINENO
+cmp in ingin || test_failed $LINENO
"${LZIP}" -cd ingin.lz > out || test_failed $LINENO
cmp in out || test_failed $LINENO
"${LZIP}" -d < ingin.lz > out || test_failed $LINENO
cmp in out || test_failed $LINENO
-rm -f out ingin.lz || framework_failure
+rm -f out ingin ingin.lz || framework_failure
echo
if [ ${fail} = 0 ] ; then
diff --git a/testsuite/em.lz b/testsuite/em.lz
new file mode 100644
index 0000000..ec60725
--- /dev/null
+++ b/testsuite/em.lz
Binary files differ
diff --git a/testsuite/fox6.lz b/testsuite/fox6.lz
deleted file mode 100644
index 8401b99..0000000
--- a/testsuite/fox6.lz
+++ /dev/null
Binary files differ
diff --git a/testsuite/fox6_mark.lz b/testsuite/fox6_mark.lz
deleted file mode 100644
index 32b2ac0..0000000
--- a/testsuite/fox6_mark.lz
+++ /dev/null
Binary files differ
diff --git a/testsuite/fox_nz.lz b/testsuite/fox_nz.lz
new file mode 100644
index 0000000..44a4b58
--- /dev/null
+++ b/testsuite/fox_nz.lz
Binary files differ
diff --git a/testsuite/test.txt b/testsuite/test.txt
index 9196a3a..423f0c0 100644
--- a/testsuite/test.txt
+++ b/testsuite/test.txt
@@ -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.
diff --git a/testsuite/test.txt.lz b/testsuite/test.txt.lz
index 22cea6e..5dc169f 100644
--- a/testsuite/test.txt.lz
+++ b/testsuite/test.txt.lz
Binary files differ
diff --git a/testsuite/test_em.txt.lz b/testsuite/test_em.txt.lz
deleted file mode 100644
index 7e96250..0000000
--- a/testsuite/test_em.txt.lz
+++ /dev/null
Binary files differ