Add a check-flag-A test and rename check-md5 to check-flag-m.
This commit is contained in:
+2
-2
@@ -3,8 +3,8 @@ EXTRA_DIST = $(TESTS) functions.inc file-00 file-ff file-random file-text
|
||||
|
||||
noinst_PROGRAMS = zzero zznop bug-overflow bug-memory bug-div0
|
||||
|
||||
TESTS = check-build check-md5 check-overflow check-memory check-div0 \
|
||||
check-rng check-utils
|
||||
TESTS = check-build check-flag-A check-flag-m \
|
||||
check-overflow check-memory check-div0 check-rng check-utils
|
||||
|
||||
echo-sources: ; echo $(SOURCES)
|
||||
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# check-flag-A - test "zzuf -A" flag (auto-increment)
|
||||
# Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
|
||||
# All Rights Reserved
|
||||
#
|
||||
# This program is free software. It comes without any warranty, to
|
||||
# the extent permitted by applicable law. You can redistribute it
|
||||
# and/or modify it under the terms of the Do What The Fuck You Want
|
||||
# To Public License, Version 2, as published by Sam Hocevar. See
|
||||
# http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
#
|
||||
|
||||
. "$(dirname "$0")/functions.inc"
|
||||
|
||||
start_test "zzuf -A test"
|
||||
|
||||
# Check -A with no fuzzing: output must match
|
||||
new_test "zzuf -A -r0 zzcat file-random file-random"
|
||||
m1=$($ZZUF -m -r0 $ZZCAT "$DIR/file-random" "$DIR/file-random")
|
||||
m2=$($ZZUF -m -A -r0 $ZZCAT "$DIR/file-random" "$DIR/file-random")
|
||||
if [ "$m1" = "$m2" ]; then
|
||||
pass_test "ok"
|
||||
else
|
||||
fail_test "$m1 != $m2"
|
||||
fi
|
||||
|
||||
# Check -A with fuzzing: output must be different
|
||||
new_test "zzuf -A -r0.1 zzcat file-random file-random"
|
||||
m1=$($ZZUF -m -r0.1 $ZZCAT "$DIR/file-random" "$DIR/file-random")
|
||||
m2=$($ZZUF -m -A -r0.1 $ZZCAT "$DIR/file-random" "$DIR/file-random")
|
||||
if [ "$m1" != "$m2" ]; then
|
||||
pass_test "ok"
|
||||
else
|
||||
fail_test "$m1 = $m2"
|
||||
fi
|
||||
|
||||
stop_test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# check-md5 - check that zzuf properly computes md5 checksums
|
||||
# check-flag-m - test "zzuf -m" flag (md5 checksums)
|
||||
# Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
|
||||
# All Rights Reserved
|
||||
#
|
||||
@@ -26,7 +26,7 @@ checkmd5()
|
||||
fi
|
||||
}
|
||||
|
||||
start_test "zzuf MD5 test"
|
||||
start_test "zzuf -m test"
|
||||
|
||||
checkmd5 "printf ''" d41d8cd98f00b204e9800998ecf8427e
|
||||
checkmd5 echo 68b329da9893e34099c7d8ad5cb9c940
|
||||
Reference in New Issue
Block a user