Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/testsuite/bzcat.tests

    r3232 r3621  
    22
    33FAILCOUNT=0
    4 
    5 ext=bz2
    64
    75bb="busybox "
     
    119unset LANG
    1210unset LANGUAGE
     11
     12hello_Z() {
     13    # Compressed "HELLO\n"
     14    $ECHO -ne "\x1f\x9d\x90\x48\x8a\x30\x61\xf2\x44\x01"
     15}
    1316
    1417hello_gz() {
     
    2629}
    2730
    28 prep() {
    29     rm -f t*
    30     hello_$ext >t1.$ext
    31     hello_$ext >t2.$ext
    32 }
     31for ext in \
     32    `test x"$CONFIG_GUNZIP"     = x"y" && echo gz` \
     33    `test x"$CONFIG_BUNZIP2"    = x"y" && echo bz2` \
     34    `test x"$CONFIG_UNCOMPRESS" = x"y" && echo Z`
     35do
     36    prep() {
     37    rm -f t1.$ext t2.$ext t_actual
     38    hello_$ext >t1.$ext
     39    hello_$ext >t2.$ext
     40    }
    3341
    34 check() {
    35     eval $2 >t_actual 2>&1
    36     if $ECHO -ne "$expected" | cmp - t_actual; then
    37     echo "PASS: $1"
    38     else
    39     echo "FAIL: $1"
    40     FAILCOUNT=$((FAILCOUNT + 1))
    41     fi
    42 }
     42    check() {
     43    eval $2 >t_actual 2>&1
     44    if $ECHO -ne "$expected" | cmp - t_actual; then
     45        echo "PASS: $1"
     46    else
     47        echo "FAIL: $1"
     48        FAILCOUNT=$((FAILCOUNT + 1))
     49    fi
     50    }
    4351
    44 mkdir testdir 2>/dev/null
    45 (
    46 cd testdir || { echo "cannot cd testdir!"; exit 1; }
    47 
    48 expected="HELLO\nok\n"
    49 prep; check "bzcat: dont delete src" "${bb}bzcat t2.bz2; test -f t2.bz2 && echo ok"
    50 
    51 )
    52 rm -rf testdir
    53 
     52    mkdir testdir 2>/dev/null
     53    (
     54    cd testdir || { echo "cannot cd testdir!"; exit 1; }
     55    expected="HELLO\nok\n"
     56    prep
     57    check "zcat: dont delete $ext src" "${bb}zcat t2.$ext; test -f t2.$ext && echo ok"
     58    exit $FAILCOUNT
     59    )
     60    FAILCOUNT=$?
     61    rm -rf testdir
     62done
    5463
    5564
     
    6069
    6170# testing "test name" "command" "expected result" "file input" "stdin"
     71
     72## bzip algorithm
    6273
    6374# "input" file is bzipped file with "a\n" data
     
    8091"\x42\x5a\x68\x39\x17\x72\x45\x38\x50\x90\x00\x00\x00\x00" ""
    8192
     93## compress algorithm
     94
     95# "input" file is compressed (.Z) file with "a\n" data
     96test x"$CONFIG_UNCOMPRESS" = x"y" && \
     97testing "zcat can print many files" \
     98"$ECHO -ne '$hexdump' | zcat input input; echo \$?" \
     99"\
     100a
     101a
     1020
     103" "\
     104\x1f\x9d\x90\x61\x14\x00\
     105" ""
     106
     107# "input" file is compressed (.Z) zero byte file
     108test x"$CONFIG_UNCOMPRESS" = x"y" && \
     109testing "zcat can handle compressed zero-length (.Z) files" \
     110"$ECHO -ne '$hexdump' | zcat input input; echo \$?" \
     111"0\n" \
     112"\x1f\x9d\x90\x00" ""
     113
    82114
    83115
Note: See TracChangeset for help on using the changeset viewer.