summaryrefslogtreecommitdiff
path: root/tests/md5sum/md5sum-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/md5sum/md5sum-tests')
-rwxr-xr-xtests/md5sum/md5sum-tests231
1 files changed, 175 insertions, 56 deletions
diff --git a/tests/md5sum/md5sum-tests b/tests/md5sum/md5sum-tests
index b3b7db0e3..6fee9f805 100755
--- a/tests/md5sum/md5sum-tests
+++ b/tests/md5sum/md5sum-tests
@@ -9,125 +9,244 @@ $echo testing program: $xx
errors=0
test "$srcdir" || srcdir=.
test "$VERBOSE" && $xx --version 2> /dev/null
-$xx < $srcdir/t1.in > t1.out 2> t1.err
+cat $srcdir/1.I | $xx > 1.O 2> 1.E
code=$?
if test $code != 0 ; then
- $echo "Test 1 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 1(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t1.out $srcdir/t1.exp
+ cmp 1.O $srcdir/1.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 1"; fi ;;
- 1) $echo "Test 1 failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 1(|)"; fi ;;
+ 1) $echo "Test 1(|) failed: files 1.O and $srcdir/1.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 1 may have failed." 1>&2;
- $echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
+ 2) $echo "Test 1(|) may have failed." 1>&2;
+ $echo The command "cmp 1.O $srcdir/1.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t1.err || rm -f t1.err
-$xx < $srcdir/t2.in > t2.out 2> t2.err
+test -s 1.E || rm -f 1.E
+$xx < $srcdir/1.I > 1.O 2> 1.E
code=$?
if test $code != 0 ; then
- $echo "Test 2 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 1(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t2.out $srcdir/t2.exp
+ cmp 1.O $srcdir/1.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 2"; fi ;;
- 1) $echo "Test 2 failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 1(<)"; fi ;;
+ 1) $echo "Test 1(<) failed: files 1.O and $srcdir/1.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 2 may have failed." 1>&2;
- $echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
+ 2) $echo "Test 1(<) may have failed." 1>&2;
+ $echo The command "cmp 1.O $srcdir/1.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t2.err || rm -f t2.err
-$xx < $srcdir/t3.in > t3.out 2> t3.err
+test -s 1.E || rm -f 1.E
+cat $srcdir/2.I | $xx > 2.O 2> 2.E
code=$?
if test $code != 0 ; then
- $echo "Test 3 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 2(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t3.out $srcdir/t3.exp
+ cmp 2.O $srcdir/2.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 3"; fi ;;
- 1) $echo "Test 3 failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 2(|)"; fi ;;
+ 1) $echo "Test 2(|) failed: files 2.O and $srcdir/2.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 3 may have failed." 1>&2;
- $echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
+ 2) $echo "Test 2(|) may have failed." 1>&2;
+ $echo The command "cmp 2.O $srcdir/2.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t3.err || rm -f t3.err
-$xx < $srcdir/t4.in > t4.out 2> t4.err
+test -s 2.E || rm -f 2.E
+$xx < $srcdir/2.I > 2.O 2> 2.E
code=$?
if test $code != 0 ; then
- $echo "Test 4 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 2(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t4.out $srcdir/t4.exp
+ cmp 2.O $srcdir/2.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 4"; fi ;;
- 1) $echo "Test 4 failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 2(<)"; fi ;;
+ 1) $echo "Test 2(<) failed: files 2.O and $srcdir/2.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 4 may have failed." 1>&2;
- $echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
+ 2) $echo "Test 2(<) may have failed." 1>&2;
+ $echo The command "cmp 2.O $srcdir/2.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t4.err || rm -f t4.err
-$xx < $srcdir/t5.in > t5.out 2> t5.err
+test -s 2.E || rm -f 2.E
+cat $srcdir/3.I | $xx > 3.O 2> 3.E
code=$?
if test $code != 0 ; then
- $echo "Test 5 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 3(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t5.out $srcdir/t5.exp
+ cmp 3.O $srcdir/3.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 5"; fi ;;
- 1) $echo "Test 5 failed: files t5.out and $srcdir/t5.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 3(|)"; fi ;;
+ 1) $echo "Test 3(|) failed: files 3.O and $srcdir/3.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 5 may have failed." 1>&2;
- $echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ;
+ 2) $echo "Test 3(|) may have failed." 1>&2;
+ $echo The command "cmp 3.O $srcdir/3.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t5.err || rm -f t5.err
-$xx < $srcdir/t6.in > t6.out 2> t6.err
+test -s 3.E || rm -f 3.E
+$xx < $srcdir/3.I > 3.O 2> 3.E
code=$?
if test $code != 0 ; then
- $echo "Test 6 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 3(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t6.out $srcdir/t6.exp
+ cmp 3.O $srcdir/3.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 6"; fi ;;
- 1) $echo "Test 6 failed: files t6.out and $srcdir/t6.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 3(<)"; fi ;;
+ 1) $echo "Test 3(<) failed: files 3.O and $srcdir/3.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 6 may have failed." 1>&2;
- $echo The command "cmp t6.out $srcdir/t6.exp" failed. 1>&2 ;
+ 2) $echo "Test 3(<) may have failed." 1>&2;
+ $echo The command "cmp 3.O $srcdir/3.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t6.err || rm -f t6.err
-$xx < $srcdir/t7.in > t7.out 2> t7.err
+test -s 3.E || rm -f 3.E
+cat $srcdir/4.I | $xx > 4.O 2> 4.E
code=$?
if test $code != 0 ; then
- $echo "Test 7 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ $echo "Test 4(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
- cmp t7.out $srcdir/t7.exp
+ cmp 4.O $srcdir/4.X
case $? in
- 0) if test "$VERBOSE" ; then $echo "passed 7"; fi ;;
- 1) $echo "Test 7 failed: files t7.out and $srcdir/t7.exp differ" 1>&2;
+ 0) if test "$VERBOSE" ; then $echo "passed 4(|)"; fi ;;
+ 1) $echo "Test 4(|) failed: files 4.O and $srcdir/4.X differ" 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo "Test 7 may have failed." 1>&2;
- $echo The command "cmp t7.out $srcdir/t7.exp" failed. 1>&2 ;
+ 2) $echo "Test 4(|) may have failed." 1>&2;
+ $echo The command "cmp 4.O $srcdir/4.X" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s t7.err || rm -f t7.err
+test -s 4.E || rm -f 4.E
+$xx < $srcdir/4.I > 4.O 2> 4.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 4(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 4.O $srcdir/4.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 4(<)"; fi ;;
+ 1) $echo "Test 4(<) failed: files 4.O and $srcdir/4.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 4(<) may have failed." 1>&2;
+ $echo The command "cmp 4.O $srcdir/4.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 4.E || rm -f 4.E
+cat $srcdir/5.I | $xx > 5.O 2> 5.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 5(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 5.O $srcdir/5.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 5(|)"; fi ;;
+ 1) $echo "Test 5(|) failed: files 5.O and $srcdir/5.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 5(|) may have failed." 1>&2;
+ $echo The command "cmp 5.O $srcdir/5.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 5.E || rm -f 5.E
+$xx < $srcdir/5.I > 5.O 2> 5.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 5(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 5.O $srcdir/5.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 5(<)"; fi ;;
+ 1) $echo "Test 5(<) failed: files 5.O and $srcdir/5.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 5(<) may have failed." 1>&2;
+ $echo The command "cmp 5.O $srcdir/5.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 5.E || rm -f 5.E
+cat $srcdir/6.I | $xx > 6.O 2> 6.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 6(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 6.O $srcdir/6.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 6(|)"; fi ;;
+ 1) $echo "Test 6(|) failed: files 6.O and $srcdir/6.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 6(|) may have failed." 1>&2;
+ $echo The command "cmp 6.O $srcdir/6.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 6.E || rm -f 6.E
+$xx < $srcdir/6.I > 6.O 2> 6.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 6(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 6.O $srcdir/6.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 6(<)"; fi ;;
+ 1) $echo "Test 6(<) failed: files 6.O and $srcdir/6.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 6(<) may have failed." 1>&2;
+ $echo The command "cmp 6.O $srcdir/6.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 6.E || rm -f 6.E
+cat $srcdir/7.I | $xx > 7.O 2> 7.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 7(|) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 7.O $srcdir/7.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 7(|)"; fi ;;
+ 1) $echo "Test 7(|) failed: files 7.O and $srcdir/7.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 7(|) may have failed." 1>&2;
+ $echo The command "cmp 7.O $srcdir/7.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 7.E || rm -f 7.E
+$xx < $srcdir/7.I > 7.O 2> 7.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test 7(<) failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp 7.O $srcdir/7.X
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed 7(<)"; fi ;;
+ 1) $echo "Test 7(<) failed: files 7.O and $srcdir/7.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test 7(<) may have failed." 1>&2;
+ $echo The command "cmp 7.O $srcdir/7.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s 7.E || rm -f 7.E
if test $errors = 0 ; then
$echo Passed all 7 tests. 1>&2
else