- Timestamp:
- Jul 16, 2008, 7:23:24 PM (14 years ago)
- Location:
- zzuf/trunk/test
- Files:
-
- 1 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/test/Makefile.am
r2462 r2541 1 1 2 EXTRA_DIST = testsuite.shfile-00 file-ff file-random file-text2 EXTRA_DIST = rng utils file-00 file-ff file-random file-text 3 3 4 4 noinst_PROGRAMS = zzcat zzero 5 5 6 TESTS = testsuite.sh6 TESTS = rng utils 7 7 8 8 zzcat_SOURCES = zzcat.c -
zzuf/trunk/test/utils
r2534 r2541 2 2 3 3 set -e 4 5 checkflip()6 {7 r=$18 expect=$29 s2=$seed10 mib=2011 echo "*** $mib MiB of zeroes, ratio $r ***"12 echo " expected ....... $expect"13 rmax=-114 rmin=-115 rtot=016 for x in 0 1 2 3 4 5 6 7 8 9; do17 ret=`dd if=/dev/zero bs=1048576 count=$mib 2>/dev/null | "$ZZUF" -s $s2 -r $r | "$ZZERO"`18 if [ "$rmax" = -1 -o "$ret" -gt "$rmax" ]; then rmax=$ret; fi19 if [ "$rmin" = -1 -o "$ret" -lt "$rmin" ]; then rmin=$ret; fi20 rtot=`expr $rtot + $ret || true`21 echo " try $x .......... $ret"22 s2=`expr $s2 + 1`23 done24 rmean=`expr '(' $rtot + 5 ')' / 10 || true`25 delta=`expr $rmean - $expect || true`26 if [ "$delta" -gt -5 -a "$delta" -lt 5 ]; then27 result="ok"28 elif [ $(($rmean * 8)) -lt $(($expect * 7)) \29 -o $(($rmean * 7)) -gt $(($expect * 8)) ]; then30 result="FAILED"31 FAILED=$(($FAILED + 1))32 else33 result="ok"34 fi35 TESTED=$(($TESTED + 1))36 echo " min/avg/max $rmin/$rmean/$rmax .......... $result"37 }38 4 39 5 checkutils() … … 126 92 exit 1 127 93 fi 128 ZZERO="$DIR/zzero"129 if [ ! -f "$ZZERO" ]; then130 echo "error: test/zzero is missing"131 exit 1132 fi133 94 if file /bin/cat | grep -q 'statically linked'; then 134 95 STATIC_CAT=1 … … 146 107 fi 147 108 148 echo "*** running zzuf test suite with seed $seed ***"109 echo "*** running zzuf utils test suite with seed $seed ***" 149 110 150 echo ""151 echo "*** check #1: random number generator ***"152 # if X flips are performed on N bits set to 0, the average number of bits153 # set to 1 is: N / 2 * (1 - pow(1 - 2 / N, X)154 checkflip 0.000000001 0155 checkflip 0.00000001 1156 checkflip 0.0000001 16157 checkflip 0.000001 167158 checkflip 0.00001 1677159 checkflip 0.0001 16775160 checkflip 0.001 167604161 checkflip 0.01 1661055162 checkflip 0.1 15205967163 164 echo ""165 echo "*** check #2: libc functions coverage ***"166 111 checkutils 0.0 167 112 checkutils 0.000000001
Note: See TracChangeset
for help on using the changeset viewer.