blob: 8f67d822ae849ef2ad73f95b24899d8545e0ea8b [file] [log] [blame]
Josh Coalsonbb7f6b92000-12-10 04:09:52 +00001#!/bin/sh
2
3LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../obj/lib
4export LD_LIBRARY_PATH
5
6if ../obj/bin/test_streams ; then : ; else
7 echo "ERROR during test_streams" 1>&2
8 exit 1
9fi
10
11FLAC=../obj/bin/flac
12
13test_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
40echo "Testing small files..."
41test_file test01 1 16
42test_file test02 2 16
43test_file test03 1 16
44test_file test04 2 16
45
46echo "Testing 8-bit full-scale deflection streams..."
47for b in 01 02 03 04 05 06 07 ; do
48 test_file fsd8-$b 1 8 "-q 15"
49done
50
51echo "Testing 16-bit full-scale deflection streams..."
52for b in 01 02 03 04 05 06 07 ; do
53 test_file fsd16-$b 1 16 "-q 15"
54done
55
56echo "Testing sine wave streams..."
57for b in 01 02 03 04 05 ; do
58 test_file sine-$b 1 16 ""
59done
60
61echo "Testing some frame header variations..."
62test_file sine-02 1 16 "--lax -b 16"
63test_file sine-02 1 16 "--lax -b 65535"
64test_file sine-02 1 16 "-b 16"
65test_file sine-02 1 16 "-b 65535"
66test_file sine-02 1 16 "--lax -fs 9"
67test_file sine-02 1 16 "--lax -fs 90"
68test_file sine-02 1 16 "--lax -fs 90000"
69test_file sine-02 1 16 "-fs 9"
70test_file sine-02 1 16 "-fs 90"
71test_file sine-02 1 16 "-fs 90000"