| Revision 4253,
1.0 KB
checked in by sam, 3 years ago
(diff) |
|
Fix copyright information and remove Id tag everywhere.
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | # |
|---|
| 3 | # check-md5 - check that zzuf properly computes md5 checksums |
|---|
| 4 | # Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net> |
|---|
| 5 | # All Rights Reserved |
|---|
| 6 | # |
|---|
| 7 | # This program is free software. It comes without any warranty, to |
|---|
| 8 | # the extent permitted by applicable law. You can redistribute it |
|---|
| 9 | # and/or modify it under the terms of the Do What The Fuck You Want |
|---|
| 10 | # To Public License, Version 2, as published by Sam Hocevar. See |
|---|
| 11 | # http://sam.zoy.org/wtfpl/COPYING for more details. |
|---|
| 12 | # |
|---|
| 13 | |
|---|
| 14 | . "$(dirname "$0")/functions.inc" |
|---|
| 15 | |
|---|
| 16 | checkmd5() |
|---|
| 17 | { |
|---|
| 18 | CMD="$1" |
|---|
| 19 | REFMD5="$2" |
|---|
| 20 | printf " $(echo "$CMD .............................." | cut -b1-30) " |
|---|
| 21 | MD5="$(eval "$CMD | $ZZUF -m -r0" 2>/dev/null | cut -f2 -d' ')" |
|---|
| 22 | if [ "$MD5" != "$REFMD5" ]; then |
|---|
| 23 | fail_test "$MD5 FAILED" |
|---|
| 24 | else |
|---|
| 25 | pass_test 'ok' |
|---|
| 26 | fi |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | start_test "zzuf MD5 test" |
|---|
| 30 | |
|---|
| 31 | checkmd5 "printf ''" d41d8cd98f00b204e9800998ecf8427e |
|---|
| 32 | checkmd5 echo 68b329da9893e34099c7d8ad5cb9c940 |
|---|
| 33 | checkmd5 "printf 'hello world'" 5eb63bbbe01eeed093cb22bb8f5acdc3 |
|---|
| 34 | |
|---|
| 35 | stop_test |
|---|
| 36 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.