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-273abcbf664adc92ef3bc1d9752a2b571623ad52.tar.gz
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
sum="$1"
expected="$2"
-mkdir testdir 2>/dev/null
-
-result=`(
-cd testdir || { echo "cannot cd testdir!" >&2; exit 1; }
-
text="The quick brown fox jumps over the lazy dog"
+text=`yes "$text" | head -c 9999`
+result=`(
n=0
while test $n -le 999; do
- yes "$text" | head -c $n | "$sum"
+ echo "$text" | head -c $n | "$sum"
: $((n++))
done | "$sum"
-
)`
-rm -rf testdir
-
-FAILCOUNT=0
-
if test x"$result" = x"$expected -"; then
echo "PASS: $sum"
exit 0