aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-10-16 22:43:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-10-16 22:43:34 +0200
commit273abcbf664adc92ef3bc1d9752a2b571623ad52 (patch)
treeae4bdff4451ce36e4bb0568e7020d9cd9f150ba8 /testsuite
parent1ac476bb8561f57703b84f090ed7a575fa512823 (diff)
downloadbusybox-w32-273abcbf664adc92ef3bc1d9752a2b571623ad52.tar.gz
busybox-w32-273abcbf664adc92ef3bc1d9752a2b571623ad52.tar.bz2
busybox-w32-273abcbf664adc92ef3bc1d9752a2b571623ad52.zip
shaN: small code shrink
function old new delta sha512_hash 134 128 -6 sha1_hash 114 106 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/md5sum.tests14
1 files changed, 3 insertions, 11 deletions
diff --git a/testsuite/md5sum.tests b/testsuite/md5sum.tests
index 5bbdb3b58..35ec67cb4 100755
--- a/testsuite/md5sum.tests
+++ b/testsuite/md5sum.tests
@@ -18,25 +18,17 @@ fi
18sum="$1" 18sum="$1"
19expected="$2" 19expected="$2"
20 20
21mkdir testdir 2>/dev/null
22
23result=`(
24cd testdir || { echo "cannot cd testdir!" >&2; exit 1; }
25
26text="The quick brown fox jumps over the lazy dog" 21text="The quick brown fox jumps over the lazy dog"
22text=`yes "$text" | head -c 9999`
27 23
24result=`(
28n=0 25n=0
29while test $n -le 999; do 26while test $n -le 999; do
30 yes "$text" | head -c $n | "$sum" 27 echo "$text" | head -c $n | "$sum"
31 : $((n++)) 28 : $((n++))
32done | "$sum" 29done | "$sum"
33
34)` 30)`
35 31
36rm -rf testdir
37
38FAILCOUNT=0
39
40if test x"$result" = x"$expected -"; then 32if test x"$result" = x"$expected -"; then
41 echo "PASS: $sum" 33 echo "PASS: $sum"
42 exit 0 34 exit 0