diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-16 22:43:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-16 22:43:34 +0200 |
commit | 273abcbf664adc92ef3bc1d9752a2b571623ad52 (patch) | |
tree | ae4bdff4451ce36e4bb0568e7020d9cd9f150ba8 /testsuite | |
parent | 1ac476bb8561f57703b84f090ed7a575fa512823 (diff) | |
download | busybox-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-x | testsuite/md5sum.tests | 14 |
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 | |||
18 | sum="$1" | 18 | sum="$1" |
19 | expected="$2" | 19 | expected="$2" |
20 | 20 | ||
21 | mkdir testdir 2>/dev/null | ||
22 | |||
23 | result=`( | ||
24 | cd testdir || { echo "cannot cd testdir!" >&2; exit 1; } | ||
25 | |||
26 | text="The quick brown fox jumps over the lazy dog" | 21 | text="The quick brown fox jumps over the lazy dog" |
22 | text=`yes "$text" | head -c 9999` | ||
27 | 23 | ||
24 | result=`( | ||
28 | n=0 | 25 | n=0 |
29 | while test $n -le 999; do | 26 | while test $n -le 999; do |
30 | yes "$text" | head -c $n | "$sum" | 27 | echo "$text" | head -c $n | "$sum" |
31 | : $((n++)) | 28 | : $((n++)) |
32 | done | "$sum" | 29 | done | "$sum" |
33 | |||
34 | )` | 30 | )` |
35 | 31 | ||
36 | rm -rf testdir | ||
37 | |||
38 | FAILCOUNT=0 | ||
39 | |||
40 | if test x"$result" = x"$expected -"; then | 32 | if test x"$result" = x"$expected -"; then |
41 | echo "PASS: $sum" | 33 | echo "PASS: $sum" |
42 | exit 0 | 34 | exit 0 |