aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-07-11 19:51:08 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-07-11 19:51:08 +0200
commitb0056ea86d427d76bb4c08506198d0c97075fdf6 (patch)
treea0e17ebc3c96790755ad9342bb3c1bd78e8425f5 /testsuite
parentf6348e50ef2a2c28c611df4df92207d7b378e78e (diff)
downloadbusybox-w32-b0056ea86d427d76bb4c08506198d0c97075fdf6.tar.gz
busybox-w32-b0056ea86d427d76bb4c08506198d0c97075fdf6.tar.bz2
busybox-w32-b0056ea86d427d76bb4c08506198d0c97075fdf6.zip
{md5,shaN}sum: make -c EMPTY fail
function old new delta md5_sha1_sum_main 466 485 +19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/md5sum.tests22
1 files changed, 17 insertions, 5 deletions
diff --git a/testsuite/md5sum.tests b/testsuite/md5sum.tests
index 6c75b6d1c..cca26dc64 100755
--- a/testsuite/md5sum.tests
+++ b/testsuite/md5sum.tests
@@ -23,6 +23,8 @@ test -f "$bindir/.config" && . "$bindir/.config"
23test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \ 23test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \
24&& { echo "SKIPPED: $sum"; exit 0; } 24&& { echo "SKIPPED: $sum"; exit 0; }
25 25
26FAILCOUNT=0
27
26text="The quick brown fox jumps over the lazy dog" 28text="The quick brown fox jumps over the lazy dog"
27text=`yes "$text" | head -c 9999` 29text=`yes "$text" | head -c 9999`
28 30
@@ -33,11 +35,21 @@ while test $n -le 999; do
33 n=$(($n+1)) 35 n=$(($n+1))
34done | "$sum" 36done | "$sum"
35)` 37)`
36 38if test x"$result" != x"$expected -"; then
37if test x"$result" = x"$expected -"; then 39 echo "FAIL: $sum (r:$result exp:$expected)"
40 : $((FAILCOUNT++))
41else
38 echo "PASS: $sum" 42 echo "PASS: $sum"
39 exit 0
40fi 43fi
41 44
42echo "FAIL: $sum (r:$result exp:$expected)" 45# GNU compat: -c EMPTY must fail (exitcode 1)!
43exit 1 46>EMPTY
47if "$sum" -c EMPTY 2>/dev/null; then
48 echo "FAIL: $sum -c EMPTY"
49 : $((FAILCOUNT++))
50else
51 echo "PASS: $sum -c EMPTY"
52fi
53rm EMPTY
54
55exit $FAILCOUNT