"Fossies" - the Fresh Open Source Software Archive

Member "lzip-1.22-rc2/testsuite/check.sh" (18 Jun 2020, 16384 Bytes) of package /linux/misc/lzip-1.22-rc2.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "check.sh": 1.22-rc1_vs_1.22-rc2.

    1 #! /bin/sh
    2 # check script for Lzip - LZMA lossless data compressor
    3 # Copyright (C) 2008-2020 Antonio Diaz Diaz.
    4 #
    5 # This script is free software: you have unlimited permission
    6 # to copy, distribute, and modify it.
    7 
    8 LC_ALL=C
    9 export LC_ALL
   10 objdir=`pwd`
   11 testdir=`cd "$1" ; pwd`
   12 LZIP="${objdir}"/lzip
   13 framework_failure() { echo "failure in testing framework" ; exit 1 ; }
   14 
   15 if [ ! -f "${LZIP}" ] || [ ! -x "${LZIP}" ] ; then
   16     echo "${LZIP}: cannot execute"
   17     exit 1
   18 fi
   19 
   20 [ -e "${LZIP}" ] 2> /dev/null ||
   21     {
   22     echo "$0: a POSIX shell is required to run the tests"
   23     echo "Try bash -c \"$0 $1 $2\""
   24     exit 1
   25     }
   26 
   27 if [ -d tmp ] ; then rm -rf tmp ; fi
   28 mkdir tmp
   29 cd "${objdir}"/tmp || framework_failure
   30 
   31 cat "${testdir}"/test.txt > in || framework_failure
   32 in_lz="${testdir}"/test.txt.lz
   33 in_em="${testdir}"/test_em.txt.lz
   34 fox_lz="${testdir}"/fox.lz
   35 fail=0
   36 test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; }
   37 
   38 printf "testing lzip-%s..." "$2"
   39 
   40 "${LZIP}" -fkqm4 in
   41 [ $? = 1 ] || test_failed $LINENO
   42 [ ! -e in.lz ] || test_failed $LINENO
   43 "${LZIP}" -fkqm274 in
   44 [ $? = 1 ] || test_failed $LINENO
   45 [ ! -e in.lz ] || test_failed $LINENO
   46 for i in bad_size -1 0 4095 513MiB 1G 1T 1P 1E 1Z 1Y 10KB ; do
   47     "${LZIP}" -fkqs $i in
   48     [ $? = 1 ] || test_failed $LINENO $i
   49     [ ! -e in.lz ] || test_failed $LINENO $i
   50 done
   51 "${LZIP}" -lq in
   52 [ $? = 2 ] || test_failed $LINENO
   53 "${LZIP}" -tq in
   54 [ $? = 2 ] || test_failed $LINENO
   55 "${LZIP}" -tq < in
   56 [ $? = 2 ] || test_failed $LINENO
   57 "${LZIP}" -cdq in
   58 [ $? = 2 ] || test_failed $LINENO
   59 "${LZIP}" -cdq < in
   60 [ $? = 2 ] || test_failed $LINENO
   61 "${LZIP}" -dq -o in < "${in_lz}"
   62 [ $? = 1 ] || test_failed $LINENO
   63 "${LZIP}" -dq -o in "${in_lz}"
   64 [ $? = 1 ] || test_failed $LINENO
   65 "${LZIP}" -dq -o out nx_file.lz
   66 [ $? = 1 ] || test_failed $LINENO
   67 [ ! -e out ] || test_failed $LINENO
   68 "${LZIP}" -q -o out.lz nx_file
   69 [ $? = 1 ] || test_failed $LINENO
   70 [ ! -e out.lz ] || test_failed $LINENO
   71 "${LZIP}" -qf -S100k -o out in in
   72 [ $? = 1 ] || test_failed $LINENO
   73 # these are for code coverage
   74 "${LZIP}" -lt "${in_lz}" 2> /dev/null
   75 [ $? = 1 ] || test_failed $LINENO
   76 "${LZIP}" -cdl "${in_lz}" > out 2> /dev/null
   77 [ $? = 1 ] || test_failed $LINENO
   78 "${LZIP}" -cdt "${in_lz}" > out 2> /dev/null
   79 [ $? = 1 ] || test_failed $LINENO
   80 "${LZIP}" -t -- nx_file.lz 2> /dev/null
   81 [ $? = 1 ] || test_failed $LINENO
   82 "${LZIP}" -t "" < /dev/null 2> /dev/null
   83 [ $? = 1 ] || test_failed $LINENO
   84 "${LZIP}" --help > /dev/null || test_failed $LINENO
   85 "${LZIP}" -n1 -V > /dev/null || test_failed $LINENO
   86 "${LZIP}" -m 2> /dev/null
   87 [ $? = 1 ] || test_failed $LINENO
   88 "${LZIP}" -z 2> /dev/null
   89 [ $? = 1 ] || test_failed $LINENO
   90 "${LZIP}" --bad_option 2> /dev/null
   91 [ $? = 1 ] || test_failed $LINENO
   92 "${LZIP}" --t 2> /dev/null
   93 [ $? = 1 ] || test_failed $LINENO
   94 "${LZIP}" --test=2 2> /dev/null
   95 [ $? = 1 ] || test_failed $LINENO
   96 "${LZIP}" --output= 2> /dev/null
   97 [ $? = 1 ] || test_failed $LINENO
   98 "${LZIP}" --output 2> /dev/null
   99 [ $? = 1 ] || test_failed $LINENO
  100 printf "LZIP\001-.............................." | "${LZIP}" -t 2> /dev/null
  101 printf "LZIP\002-.............................." | "${LZIP}" -t 2> /dev/null
  102 printf "LZIP\001+.............................." | "${LZIP}" -t 2> /dev/null
  103 
  104 printf "\ntesting decompression..."
  105 
  106 for i in "${in_lz}" "${in_em}" ; do
  107     "${LZIP}" -lq "$i" || test_failed $LINENO "$i"
  108     "${LZIP}" -t "$i" || test_failed $LINENO "$i"
  109     "${LZIP}" -d "$i" -o copy || test_failed $LINENO "$i"
  110     cmp in copy || test_failed $LINENO "$i"
  111     "${LZIP}" -cd "$i" > copy || test_failed $LINENO "$i"
  112     cmp in copy || test_failed $LINENO "$i"
  113     "${LZIP}" -d "$i" -o - > copy || test_failed $LINENO "$i"
  114     cmp in copy || test_failed $LINENO "$i"
  115     "${LZIP}" -d < "$i" > copy || test_failed $LINENO "$i"
  116     cmp in copy || test_failed $LINENO "$i"
  117     rm -f copy || framework_failure
  118 done
  119 
  120 lines=$("${LZIP}" -tvv "${in_em}" 2>&1 | wc -l) || test_failed $LINENO
  121 [ "${lines}" -eq 8 ] || test_failed $LINENO "${lines}"
  122 
  123 lines=$("${LZIP}" -lvv "${in_em}" | wc -l) || test_failed $LINENO
  124 [ "${lines}" -eq 11 ] || test_failed $LINENO "${lines}"
  125 
  126 cat "${in_lz}" > copy.lz || framework_failure
  127 "${LZIP}" -dk copy.lz || test_failed $LINENO
  128 cmp in copy || test_failed $LINENO
  129 printf "to be overwritten" > copy || framework_failure
  130 "${LZIP}" -d copy.lz 2> /dev/null
  131 [ $? = 1 ] || test_failed $LINENO
  132 "${LZIP}" -df copy.lz || test_failed $LINENO
  133 [ ! -e copy.lz ] || test_failed $LINENO
  134 cmp in copy || test_failed $LINENO
  135 
  136 rm -f copy || framework_failure
  137 cat "${in_lz}" > copy.lz || framework_failure
  138 "${LZIP}" -d -S100k copy.lz || test_failed $LINENO  # ignore -S
  139 [ ! -e copy.lz ] || test_failed $LINENO
  140 cmp in copy || test_failed $LINENO
  141 
  142 printf "to be overwritten" > copy || framework_failure
  143 "${LZIP}" -d  -o copy < "${in_lz}" 2> /dev/null
  144 [ $? = 1 ] || test_failed $LINENO
  145 "${LZIP}" -df -o copy < "${in_lz}" || test_failed $LINENO
  146 cmp in copy || test_failed $LINENO
  147 rm -f out copy || framework_failure
  148 "${LZIP}" -d -o ./- "${in_lz}" || test_failed $LINENO
  149 cmp in ./- || test_failed $LINENO
  150 rm -f ./- || framework_failure
  151 "${LZIP}" -d -o ./- < "${in_lz}" || test_failed $LINENO
  152 cmp in ./- || test_failed $LINENO
  153 rm -f ./- || framework_failure
  154 
  155 cat "${in_lz}" > anyothername || framework_failure
  156 "${LZIP}" -dv - anyothername - < "${in_lz}" > copy 2> /dev/null ||
  157     test_failed $LINENO
  158 cmp in copy || test_failed $LINENO
  159 cmp in anyothername.out || test_failed $LINENO
  160 rm -f copy anyothername.out || framework_failure
  161 
  162 "${LZIP}" -lq in "${in_lz}"
  163 [ $? = 2 ] || test_failed $LINENO
  164 "${LZIP}" -lq nx_file.lz "${in_lz}"
  165 [ $? = 1 ] || test_failed $LINENO
  166 "${LZIP}" -tq in "${in_lz}"
  167 [ $? = 2 ] || test_failed $LINENO
  168 "${LZIP}" -tq nx_file.lz "${in_lz}"
  169 [ $? = 1 ] || test_failed $LINENO
  170 "${LZIP}" -cdq in "${in_lz}" > copy
  171 [ $? = 2 ] || test_failed $LINENO
  172 cat copy in | cmp in - || test_failed $LINENO
  173 "${LZIP}" -cdq nx_file.lz "${in_lz}" > copy
  174 [ $? = 1 ] || test_failed $LINENO
  175 cmp in copy || test_failed $LINENO
  176 rm -f copy || framework_failure
  177 cat "${in_lz}" > copy.lz || framework_failure
  178 for i in 1 2 3 4 5 6 7 ; do
  179     printf "g" >> copy.lz || framework_failure
  180     "${LZIP}" -alvv copy.lz "${in_lz}" > /dev/null 2>&1
  181     [ $? = 2 ] || test_failed $LINENO $i
  182     "${LZIP}" -atvvvv copy.lz "${in_lz}" 2> /dev/null
  183     [ $? = 2 ] || test_failed $LINENO $i
  184 done
  185 "${LZIP}" -dq in copy.lz
  186 [ $? = 2 ] || test_failed $LINENO
  187 [ -e copy.lz ] || test_failed $LINENO
  188 [ ! -e copy ] || test_failed $LINENO
  189 [ ! -e in.out ] || test_failed $LINENO
  190 "${LZIP}" -dq nx_file.lz copy.lz
  191 [ $? = 1 ] || test_failed $LINENO
  192 [ ! -e copy.lz ] || test_failed $LINENO
  193 [ ! -e nx_file ] || test_failed $LINENO
  194 cmp in copy || test_failed $LINENO
  195 
  196 cat in in > in2 || framework_failure
  197 "${LZIP}" -lq "${in_lz}" "${in_lz}" || test_failed $LINENO
  198 "${LZIP}" -t "${in_lz}" "${in_lz}" || test_failed $LINENO
  199 "${LZIP}" -cd "${in_lz}" "${in_lz}" -o out > copy2 || test_failed $LINENO
  200 [ ! -e out ] || test_failed $LINENO         # override -o
  201 cmp in2 copy2 || test_failed $LINENO
  202 rm -f copy2 || framework_failure
  203 "${LZIP}" -d "${in_lz}" "${in_lz}" -o copy2 || test_failed $LINENO
  204 cmp in2 copy2 || test_failed $LINENO
  205 rm -f copy2 || framework_failure
  206 
  207 cat "${in_lz}" "${in_lz}" > copy2.lz || framework_failure
  208 printf "\ngarbage" >> copy2.lz || framework_failure
  209 "${LZIP}" -tvvvv copy2.lz 2> /dev/null || test_failed $LINENO
  210 "${LZIP}" -alq copy2.lz
  211 [ $? = 2 ] || test_failed $LINENO
  212 "${LZIP}" -atq copy2.lz
  213 [ $? = 2 ] || test_failed $LINENO
  214 "${LZIP}" -atq < copy2.lz
  215 [ $? = 2 ] || test_failed $LINENO
  216 "${LZIP}" -adkq copy2.lz
  217 [ $? = 2 ] || test_failed $LINENO
  218 [ ! -e copy2 ] || test_failed $LINENO
  219 "${LZIP}" -adkq -o copy2 < copy2.lz
  220 [ $? = 2 ] || test_failed $LINENO
  221 [ ! -e copy2 ] || test_failed $LINENO
  222 printf "to be overwritten" > copy2 || framework_failure
  223 "${LZIP}" -df copy2.lz || test_failed $LINENO
  224 cmp in2 copy2 || test_failed $LINENO
  225 rm -f copy2 || framework_failure
  226 
  227 printf "\ntesting   compression..."
  228 
  229 "${LZIP}" -c -0 in in in -S100k -o out3.lz > copy2.lz || test_failed $LINENO
  230 [ ! -e out3.lz ] || test_failed $LINENO         # override -o and -S
  231 "${LZIP}" -0f in in --output=copy2.lz || test_failed $LINENO
  232 "${LZIP}" -d copy2.lz -o out2 || test_failed $LINENO
  233 cmp in2 out2 || test_failed $LINENO
  234 rm -f in2 out2 copy2.lz || framework_failure
  235 
  236 "${LZIP}" -cf "${in_lz}" > out 2> /dev/null # /dev/null is a tty on OS/2
  237 [ $? = 1 ] || test_failed $LINENO
  238 "${LZIP}" -Fvvm36 -o - "${in_lz}" > out 2> /dev/null || test_failed $LINENO
  239 "${LZIP}" -cd out | "${LZIP}" -d > copy || test_failed $LINENO
  240 cmp in copy || test_failed $LINENO
  241 
  242 "${LZIP}" -0 -o ./- in || test_failed $LINENO
  243 "${LZIP}" -cd ./- | cmp in - || test_failed $LINENO
  244 rm -f ./- || framework_failure
  245 "${LZIP}" -0 -o ./- < in || test_failed $LINENO         # add .lz
  246 [ ! -e ./- ] || test_failed $LINENO
  247 "${LZIP}" -cd -- -.lz | cmp in - || test_failed $LINENO
  248 rm -f ./-.lz || framework_failure
  249 
  250 for i in s4Ki 0 1 2 3 4 5 6 7 8 9 ; do
  251     "${LZIP}" -k -$i in || test_failed $LINENO $i
  252     mv -f in.lz copy.lz || test_failed $LINENO $i
  253     printf "garbage" >> copy.lz || framework_failure
  254     "${LZIP}" -df copy.lz || test_failed $LINENO $i
  255     cmp in copy || test_failed $LINENO $i
  256 
  257     "${LZIP}" -$i in -c > out || test_failed $LINENO $i
  258     "${LZIP}" -$i in -o o_out || test_failed $LINENO $i # don't add .lz
  259     [ ! -e o_out.lz ] || test_failed $LINENO
  260     cmp out o_out || test_failed $LINENO $i
  261     rm -f o_out || framework_failure
  262     printf "g" >> out || framework_failure
  263     "${LZIP}" -cd out > copy || test_failed $LINENO $i
  264     cmp in copy || test_failed $LINENO $i
  265 
  266     "${LZIP}" -$i < in > out || test_failed $LINENO $i
  267     "${LZIP}" -d < out > copy || test_failed $LINENO $i
  268     cmp in copy || test_failed $LINENO $i
  269 
  270     rm -f out || framework_failure
  271     printf "to be overwritten" > out.lz || framework_failure
  272     "${LZIP}" -f -$i -o out < in || test_failed $LINENO $i  # add .lz
  273     [ ! -e out ] || test_failed $LINENO
  274     "${LZIP}" -df -o copy < out.lz || test_failed $LINENO $i
  275     cmp in copy || test_failed $LINENO $i
  276 done
  277 rm -f out out.lz || framework_failure
  278 
  279 cat in in in in in in in in > in8 || framework_failure
  280 "${LZIP}" -1s12 -S100k in8 || test_failed $LINENO
  281 "${LZIP}" -t in800001.lz in800002.lz || test_failed $LINENO
  282 "${LZIP}" -cd in800001.lz in800002.lz | cmp in8 - || test_failed $LINENO
  283 [ ! -e in800003.lz ] || test_failed $LINENO
  284 rm -f in800001.lz in800002.lz || framework_failure
  285 "${LZIP}" -1s12 -S100k -o out.lz in8 || test_failed $LINENO
  286 # ignore -S
  287 "${LZIP}" -d out.lz00001.lz out.lz00002.lz -S100k -o out || test_failed $LINENO
  288 cmp in8 out || test_failed $LINENO
  289 "${LZIP}" -t out.lz00001.lz out.lz00002.lz || test_failed $LINENO
  290 [ ! -e out.lz00003.lz ] || test_failed $LINENO
  291 rm -f out out.lz00001.lz out.lz00002.lz || framework_failure
  292 "${LZIP}" -1ks4Ki -b100000 in8 || test_failed $LINENO
  293 "${LZIP}" -t in8.lz || test_failed $LINENO
  294 "${LZIP}" -cd in8.lz -o out | cmp in8 - || test_failed $LINENO  # override -o
  295 [ ! -e out ] || test_failed $LINENO
  296 rm -f in8 || framework_failure
  297 "${LZIP}" -0 -S100k -o out < in8.lz || test_failed $LINENO
  298 "${LZIP}" -t out00001.lz out00002.lz || test_failed $LINENO
  299 "${LZIP}" -cd out00001.lz out00002.lz | cmp in8.lz - || test_failed $LINENO
  300 [ ! -e out00003.lz ] || test_failed $LINENO
  301 rm -f out00001.lz || framework_failure
  302 "${LZIP}" -1 -S100k -o out < in8.lz || test_failed $LINENO
  303 "${LZIP}" -t out00001.lz out00002.lz || test_failed $LINENO
  304 "${LZIP}" -cd out00001.lz out00002.lz | cmp in8.lz - || test_failed $LINENO
  305 [ ! -e out00003.lz ] || test_failed $LINENO
  306 rm -f out00001.lz out00002.lz || framework_failure
  307 "${LZIP}" -0 -F -S100k in8.lz || test_failed $LINENO
  308 "${LZIP}" -t in8.lz00001.lz in8.lz00002.lz || test_failed $LINENO
  309 "${LZIP}" -cd in8.lz00001.lz in8.lz00002.lz | cmp in8.lz - || test_failed $LINENO
  310 [ ! -e in8.lz00003.lz ] || test_failed $LINENO
  311 rm -f in8.lz00001.lz in8.lz00002.lz || framework_failure
  312 "${LZIP}" -0kF -b100k in8.lz || test_failed $LINENO
  313 "${LZIP}" -t in8.lz.lz || test_failed $LINENO
  314 "${LZIP}" -cd in8.lz.lz | cmp in8.lz - || test_failed $LINENO
  315 rm -f in8.lz in8.lz.lz || framework_failure
  316 
  317 printf "\ntesting bad input..."
  318 
  319 headers='LZIp LZiP LZip LzIP LzIp LziP lZIP lZIp lZiP lzIP'
  320 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'
  321 cat "${in_lz}" > int.lz
  322 printf "LZIP${body}" >> int.lz
  323 if "${LZIP}" -tq int.lz ; then
  324     for header in ${headers} ; do
  325         printf "${header}${body}" > int.lz  # first member
  326         "${LZIP}" -lq int.lz
  327         [ $? = 2 ] || test_failed $LINENO ${header}
  328         "${LZIP}" -tq int.lz
  329         [ $? = 2 ] || test_failed $LINENO ${header}
  330         "${LZIP}" -tq < int.lz
  331         [ $? = 2 ] || test_failed $LINENO ${header}
  332         "${LZIP}" -cdq int.lz > /dev/null
  333         [ $? = 2 ] || test_failed $LINENO ${header}
  334         "${LZIP}" -lq --loose-trailing int.lz
  335         [ $? = 2 ] || test_failed $LINENO ${header}
  336         "${LZIP}" -tq --loose-trailing int.lz
  337         [ $? = 2 ] || test_failed $LINENO ${header}
  338         "${LZIP}" -tq --loose-trailing < int.lz
  339         [ $? = 2 ] || test_failed $LINENO ${header}
  340         "${LZIP}" -cdq --loose-trailing int.lz > /dev/null
  341         [ $? = 2 ] || test_failed $LINENO ${header}
  342         cat "${in_lz}" > int.lz
  343         printf "${header}${body}" >> int.lz # trailing data
  344         "${LZIP}" -lq int.lz
  345         [ $? = 2 ] || test_failed $LINENO ${header}
  346         "${LZIP}" -tq int.lz
  347         [ $? = 2 ] || test_failed $LINENO ${header}
  348         "${LZIP}" -tq < int.lz
  349         [ $? = 2 ] || test_failed $LINENO ${header}
  350         "${LZIP}" -cdq int.lz > /dev/null
  351         [ $? = 2 ] || test_failed $LINENO ${header}
  352         "${LZIP}" -lq --loose-trailing int.lz ||
  353             test_failed $LINENO ${header}
  354         "${LZIP}" -t --loose-trailing int.lz ||
  355             test_failed $LINENO ${header}
  356         "${LZIP}" -t --loose-trailing < int.lz ||
  357             test_failed $LINENO ${header}
  358         "${LZIP}" -cd --loose-trailing int.lz > /dev/null ||
  359             test_failed $LINENO ${header}
  360         "${LZIP}" -lq --loose-trailing --trailing-error int.lz
  361         [ $? = 2 ] || test_failed $LINENO ${header}
  362         "${LZIP}" -tq --loose-trailing --trailing-error int.lz
  363         [ $? = 2 ] || test_failed $LINENO ${header}
  364         "${LZIP}" -tq --loose-trailing --trailing-error < int.lz
  365         [ $? = 2 ] || test_failed $LINENO ${header}
  366         "${LZIP}" -cdq --loose-trailing --trailing-error int.lz > /dev/null
  367         [ $? = 2 ] || test_failed $LINENO ${header}
  368     done
  369 else
  370     printf "\nwarning: skipping header test: 'printf' does not work on your system."
  371 fi
  372 rm -f int.lz || framework_failure
  373 
  374 for i in fox_v2.lz fox_s11.lz fox_de20.lz \
  375          fox_bcrc.lz fox_crc0.lz fox_das46.lz fox_mes81.lz ; do
  376     "${LZIP}" -tq "${testdir}"/$i
  377     [ $? = 2 ] || test_failed $LINENO $i
  378 done
  379 
  380 "${LZIP}" -cd "${fox_lz}" > fox || test_failed $LINENO
  381 for i in fox_bcrc.lz fox_crc0.lz fox_das46.lz fox_mes81.lz ; do
  382     "${LZIP}" -cdq "${testdir}"/$i > out
  383     [ $? = 2 ] || test_failed $LINENO $i
  384     cmp fox out || test_failed $LINENO $i
  385 done
  386 rm -f fox out || framework_failure
  387 
  388 cat "${in_lz}" "${in_lz}" > in2.lz || framework_failure
  389 cat "${in_lz}" "${in_lz}" "${in_lz}" > in3.lz || framework_failure
  390 if dd if=in3.lz of=trunc.lz bs=14752 count=1 2> /dev/null &&
  391    [ -e trunc.lz ] && cmp in2.lz trunc.lz > /dev/null 2>&1 ; then
  392     for i in 6 20 14734 14753 14754 14755 14756 14757 14758 ; do
  393         dd if=in3.lz of=trunc.lz bs=$i count=1 2> /dev/null
  394         "${LZIP}" -lq trunc.lz
  395         [ $? = 2 ] || test_failed $LINENO $i
  396         "${LZIP}" -tq trunc.lz
  397         [ $? = 2 ] || test_failed $LINENO $i
  398         "${LZIP}" -tq < trunc.lz
  399         [ $? = 2 ] || test_failed $LINENO $i
  400         "${LZIP}" -cdq trunc.lz > out
  401         [ $? = 2 ] || test_failed $LINENO $i
  402         "${LZIP}" -dq < trunc.lz > out
  403         [ $? = 2 ] || test_failed $LINENO $i
  404     done
  405 else
  406     printf "\nwarning: skipping truncation test: 'dd' does not work on your system."
  407 fi
  408 rm -f in2.lz in3.lz trunc.lz out || framework_failure
  409 
  410 cat "${in_lz}" > ingin.lz || framework_failure
  411 printf "g" >> ingin.lz || framework_failure
  412 cat "${in_lz}" >> ingin.lz || framework_failure
  413 "${LZIP}" -lq ingin.lz
  414 [ $? = 2 ] || test_failed $LINENO
  415 "${LZIP}" -atq ingin.lz
  416 [ $? = 2 ] || test_failed $LINENO
  417 "${LZIP}" -atq < ingin.lz
  418 [ $? = 2 ] || test_failed $LINENO
  419 "${LZIP}" -acdq ingin.lz > out
  420 [ $? = 2 ] || test_failed $LINENO
  421 "${LZIP}" -adq < ingin.lz > out
  422 [ $? = 2 ] || test_failed $LINENO
  423 "${LZIP}" -t ingin.lz || test_failed $LINENO
  424 "${LZIP}" -t < ingin.lz || test_failed $LINENO
  425 "${LZIP}" -cd ingin.lz > copy || test_failed $LINENO
  426 cmp in copy || test_failed $LINENO
  427 "${LZIP}" -d < ingin.lz > copy || test_failed $LINENO
  428 cmp in copy || test_failed $LINENO
  429 rm -f copy ingin.lz out || framework_failure
  430 
  431 echo
  432 if [ ${fail} = 0 ] ; then
  433     echo "tests completed successfully."
  434     cd "${objdir}" && rm -r tmp
  435 else
  436     echo "tests failed."
  437 fi
  438 exit ${fail}