Changeset 1684 for zzuf/trunk/test


Ignore:
Timestamp:
Jan 17, 2007, 3:35:12 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Allow -r 0.0 again. Fixed the testsuite accordingly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/testsuite.sh

    r1640 r1684  
    1919    CMD="$2"
    2020    ALIAS="$3"
     21    CHECK="$4"
    2122    echo -n " $(echo "$ALIAS .............." | cut -b1-18) "
    2223    MD5="$(eval "$ZZUF -m $ZZOPTS $CMD" 2>/dev/null | cut -f2 -d' ')"
     24    if [ -n "$CHECK" ]; then
     25        REFMD5="$CHECK"
     26    fi
    2327    if [ -z "$REFMD5" ]; then
    2428        REFMD5="$MD5"
     
    7478
    7579for r in 0.0 0.00001 0.001 0.1 10.0; do
    76     for file in /tmp/zzuf-zero-$$ /tmp/zzuf-text-$$ /tmp/zzuf-random-$$; do
     80    for type in zero text random; do
     81        file=/tmp/zzuf-$type-$$
    7782        ZZOPTS="-s $seed -r $r"
    7883        case $file in
     
    8186        echo "*** file $file, ratio $r ***"
    8287        REFMD5=""
    83         check "$ZZOPTS" "< $file" "zzuf"
     88        if [ $r = 0.0 -a $type = zero ]; then
     89            check="bb7df04e1b0a2570657527a7e108ae23"
     90            echo "*** should be $check ***"
     91            check "$ZZOPTS" "< $file" "zzuf" "$check"
     92        else
     93            check "$ZZOPTS" "< $file" "zzuf"
     94        fi
    8495        check "$ZZOPTS" "$FDCAT $file" "fdcat"
    8596        check "$ZZOPTS" "$STREAMCAT $file" "streamcat"
Note: See TracChangeset for help on using the changeset viewer.