Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../obj/lib |
| 4 | export LD_LIBRARY_PATH |
| 5 | |
| 6 | if ../obj/bin/test_streams ; then : ; else |
| 7 | echo "ERROR during test_streams" 1>&2 |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | FLAC=../obj/bin/flac |
| 12 | |
| 13 | test_file () |
| 14 | { |
| 15 | name=$1 |
| 16 | channels=$2 |
| 17 | bps=$3 |
| 18 | encode_options="$4" |
| 19 | |
| 20 | echo "### ENCODE $name ########################################" >> ./encode.log |
| 21 | echo -n "$name: encode..." |
| 22 | if $FLAC -s -fb -fs 44100 -fp $bps -fc $channels -0 -l 8 -m -e $encode_options $name.raw $name.flac 2>>./encode.log ; then : ; else |
| 23 | echo "ERROR during encode of $name" 1>&2 |
| 24 | exit 1 |
| 25 | fi |
| 26 | echo "### DECODE $name ########################################" >> ./decode.log |
| 27 | echo -n "decode..." |
| 28 | if $FLAC -s -fb -d -fr $name.flac $name.cmp 2>>./decode.log ; then : ; else |
| 29 | echo "ERROR during decode of $name" 1>&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | echo -n "compare..." |
| 33 | if cmp $name.raw $name.cmp ; then : ; else |
| 34 | echo "ERROR during compare of $name" 1>&2 |
| 35 | exit 1 |
| 36 | fi |
| 37 | echo OK |
| 38 | } |
| 39 | |
| 40 | echo "Testing small files..." |
| 41 | test_file test01 1 16 |
| 42 | test_file test02 2 16 |
| 43 | test_file test03 1 16 |
| 44 | test_file test04 2 16 |
| 45 | |
| 46 | echo "Testing 8-bit full-scale deflection streams..." |
| 47 | for b in 01 02 03 04 05 06 07 ; do |
| 48 | test_file fsd8-$b 1 8 "-q 15" |
| 49 | done |
| 50 | |
| 51 | echo "Testing 16-bit full-scale deflection streams..." |
| 52 | for b in 01 02 03 04 05 06 07 ; do |
| 53 | test_file fsd16-$b 1 16 "-q 15" |
| 54 | done |
| 55 | |
| 56 | echo "Testing sine wave streams..." |
| 57 | for b in 01 02 03 04 05 ; do |
| 58 | test_file sine-$b 1 16 "" |
| 59 | done |
| 60 | |
| 61 | echo "Testing some frame header variations..." |
| 62 | test_file sine-02 1 16 "--lax -b 16" |
| 63 | test_file sine-02 1 16 "--lax -b 65535" |
| 64 | test_file sine-02 1 16 "-b 16" |
| 65 | test_file sine-02 1 16 "-b 65535" |
| 66 | test_file sine-02 1 16 "--lax -fs 9" |
| 67 | test_file sine-02 1 16 "--lax -fs 90" |
| 68 | test_file sine-02 1 16 "--lax -fs 90000" |
| 69 | test_file sine-02 1 16 "-fs 9" |
| 70 | test_file sine-02 1 16 "-fs 90" |
| 71 | test_file sine-02 1 16 "-fs 90000" |