From: Jim Meyering Date: Thu, 9 Nov 2017 15:39:58 +0000 (-0800) Subject: tests: unpack-invalid: correct and clean up a test X-Git-Tag: v1.9~15 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=15bd3ba5d514af6a307ecefb8d109b9a65067a88;p=debian%2Fgzip tests: unpack-invalid: correct and clean up a test * tests/unpack-invalid: There was a logic error that would have caused this test to ignore a failure if first iteration of the loop set fail=1 and the second one reset it to 0. Also, use "returns_ 1 ...", to require an exit status of 1. --- diff --git a/tests/unpack-invalid b/tests/unpack-invalid index d3035f1..396c7e6 100755 --- a/tests/unpack-invalid +++ b/tests/unpack-invalid @@ -20,17 +20,13 @@ . "${srcdir=.}/init.sh"; path_prepend_ .. +fail=0 for input in \ '\037\036\000\000\037\213\010\000\000\000\000\000\002\003\036\000\000\000\002\003\037\213\010\000\000\000\000\000\002\003\355\301\001\015\000\000\000\302\240\037\000\302\240\037\213\010\000\000\000\000\000\002\003\355\301' \ '\037\213\010\000\000\000\000\000\002\003\355\301\001\015\000\000\000\302\240\076\366\017\370\036\016\030\000\000\000\000\000\000\000\000\000\034\010\105\140\104\025\020\047\000\000\037\036\016\030\000\000\000'; do printf "$input" >in || framework_failure_ - - if gzip -d out 2>err; then - fail=1 - else - fail=0 - fi + returns_ 1 gzip -d out 2>err || fail=1 done Exit $fail