Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # FLAC - Free Lossless Audio Codec |
Josh Coalson | 9564390 | 2004-01-17 04:14:43 +0000 | [diff] [blame] | 4 | # Copyright (C) 2001,2002,2003,2004 Josh Coalson |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 5 | # |
Josh Coalson | e8a7601 | 2003-02-07 00:14:32 +0000 | [diff] [blame] | 6 | # This file is part the FLAC project. FLAC is comprised of several |
| 7 | # components distributed under difference licenses. The codec libraries |
| 8 | # are distributed under Xiph.Org's BSD-like license (see the file |
| 9 | # COPYING.Xiph in this distribution). All other programs, libraries, and |
| 10 | # plugins are distributed under the GPL (see COPYING.GPL). The documentation |
| 11 | # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the |
| 12 | # FLAC distribution contains at the top the terms under which it may be |
| 13 | # distributed. |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 14 | # |
Josh Coalson | e8a7601 | 2003-02-07 00:14:32 +0000 | [diff] [blame] | 15 | # Since this particular file is relevant to all components of FLAC, |
| 16 | # it may be distributed under the Xiph.Org license, which is the least |
| 17 | # restrictive of those mentioned above. See the file COPYING.Xiph in this |
| 18 | # distribution. |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 19 | |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 20 | die () |
| 21 | { |
| 22 | echo $* 1>&2 |
| 23 | exit 1 |
| 24 | } |
| 25 | |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 26 | LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/release/lib:../obj/debug/lib:$LD_LIBRARY_PATH |
| 27 | export LD_LIBRARY_PATH |
| 28 | PATH=../src/flac:../src/test_streams:../obj/release/bin:../obj/debug/bin:$PATH |
| 29 | |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 30 | flac --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 31 | |
| 32 | run_flac () |
| 33 | { |
Josh Coalson | ecf57b7 | 2003-01-14 09:00:25 +0000 | [diff] [blame] | 34 | if [ x"$FLAC__VALGRIND" = xyes ] ; then |
Josh Coalson | 80936c5 | 2002-12-30 23:31:47 +0000 | [diff] [blame] | 35 | valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 flac $* 4>>test_flac.valgrind.log |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 36 | else |
| 37 | flac $* |
| 38 | fi |
| 39 | } |
| 40 | |
| 41 | echo "Checking for --ogg support in flac..." |
| 42 | if flac --ogg --silent --force-raw-format --endian=little --sign=signed --channels=1 --bps=8 --sample-rate=44100 -c $0 1>/dev/null 2>&1 ; then |
| 43 | has_ogg=yes; |
| 44 | echo "flac --ogg works" |
| 45 | else |
| 46 | has_ogg=no; |
| 47 | echo "flac --ogg doesn't work" |
| 48 | fi |
| 49 | |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 50 | |
| 51 | echo "Generating streams..." |
| 52 | if [ ! -f wacky1.wav ] ; then |
| 53 | test_streams || die "ERROR during test_streams" |
| 54 | fi |
| 55 | |
| 56 | ############################################################################ |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 57 | # test that flac doesn't automatically overwrite files unless -f is used |
| 58 | ############################################################################ |
| 59 | |
| 60 | echo "Try encoding to a file that exists; should fail" |
| 61 | cp wacky1.wav exist.wav |
| 62 | touch exist.flac |
Josh Coalson | e4240db | 2004-07-17 18:14:45 +0000 | [diff] [blame^] | 63 | if run_flac --totally-silent -0 exist.wav ; then |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 64 | die "ERROR: it should have failed but didn't" |
| 65 | else |
| 66 | echo "OK, it failed as it should" |
| 67 | fi |
| 68 | |
| 69 | echo "Try encoding with -f to a file that exists; should succeed" |
Josh Coalson | e4240db | 2004-07-17 18:14:45 +0000 | [diff] [blame^] | 70 | if run_flac --totally-silent -0 --force exist.wav ; then |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 71 | echo "OK, it succeeded as it should" |
| 72 | else |
| 73 | die "ERROR: it should have succeeded but didn't" |
| 74 | fi |
| 75 | |
| 76 | echo "Try decoding to a file that exists; should fail" |
Josh Coalson | e4240db | 2004-07-17 18:14:45 +0000 | [diff] [blame^] | 77 | if run_flac --totally-silent -d exist.flac ; then |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 78 | die "ERROR: it should have failed but didn't" |
| 79 | else |
| 80 | echo "OK, it failed as it should" |
| 81 | fi |
| 82 | |
| 83 | echo "Try decoding with -f to a file that exists; should succeed" |
Josh Coalson | e4240db | 2004-07-17 18:14:45 +0000 | [diff] [blame^] | 84 | if run_flac --totally-silent -d -f exist.flac ; then |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 85 | echo "OK, it succeeded as it should" |
| 86 | else |
| 87 | die "ERROR: it should have succeeded but didn't" |
| 88 | fi |
| 89 | |
| 90 | rm -f exist.wav exist.flac |
| 91 | |
| 92 | ############################################################################ |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 93 | # basic 'round-trip' tests of various kinds of streams |
| 94 | ############################################################################ |
| 95 | |
| 96 | rt_test_raw () |
| 97 | { |
| 98 | f="$1" |
| 99 | channels=`echo $f | awk -F- '{print $2}'` |
| 100 | bytes_per_sample=`echo $f | awk -F- '{print $3}'` |
| 101 | bps=`expr $bytes_per_sample '*' 8` |
| 102 | echo -n "round-trip test ($f) encode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 103 | run_flac --silent --force --verify --force-raw-format --endian=little --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $f -o rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 104 | echo -n "decode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 105 | run_flac --silent --force --decode --force-raw-format --endian=little --sign=signed -o rt.raw rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 106 | echo -n "compare... " |
| 107 | cmp $f rt.raw || die "ERROR: file mismatch" |
| 108 | echo "OK" |
| 109 | rm -f rt.flac rt.raw |
| 110 | } |
| 111 | |
| 112 | rt_test_wav () |
| 113 | { |
| 114 | f="$1" |
| 115 | echo -n "round-trip test ($f) encode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 116 | run_flac --silent --force --verify $f -o rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 117 | echo -n "decode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 118 | run_flac --silent --force --decode -o rt.wav rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 119 | echo -n "compare... " |
| 120 | cmp $f rt.wav || die "ERROR: file mismatch" |
| 121 | echo "OK" |
| 122 | rm -f rt.flac rt.wav |
| 123 | } |
| 124 | |
| 125 | rt_test_aiff () |
| 126 | { |
| 127 | f="$1" |
| 128 | echo -n "round-trip test ($f) encode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 129 | run_flac --silent --force --verify $f -o rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 130 | echo -n "decode... " |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 131 | run_flac --silent --force --decode -o rt.aiff rt.flac || die "ERROR" |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 132 | echo -n "compare... " |
| 133 | cmp $f rt.aiff || die "ERROR: file mismatch" |
| 134 | echo "OK" |
| 135 | rm -f rt.flac rt.aiff |
| 136 | } |
| 137 | |
| 138 | for f in rt-*.raw ; do |
| 139 | rt_test_raw $f |
| 140 | done |
| 141 | for f in rt-*.wav ; do |
| 142 | rt_test_wav $f |
| 143 | done |
| 144 | for f in rt-*.aiff ; do |
| 145 | rt_test_aiff $f |
| 146 | done |
| 147 | |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 148 | ############################################################################ |
| 149 | # test --skip and --until |
| 150 | ############################################################################ |
| 151 | |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 152 | # |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 153 | # first make some chopped-up raw files |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 154 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 155 | echo "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMN" > master.raw |
| 156 | dddie="die ERROR: creating files for --skip/--until tests" |
| 157 | dd if=master.raw ibs=1 count=50 of=50c.raw 2>/dev/null || $dddie |
| 158 | dd if=master.raw ibs=1 skip=10 count=40 of=50c.skip10.raw 2>/dev/null || $dddie |
| 159 | dd if=master.raw ibs=1 skip=11 count=39 of=50c.skip11.raw 2>/dev/null || $dddie |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 160 | dd if=master.raw ibs=1 skip=20 count=30 of=50c.skip20.raw 2>/dev/null || $dddie |
| 161 | dd if=master.raw ibs=1 skip=30 count=20 of=50c.skip30.raw 2>/dev/null || $dddie |
| 162 | dd if=master.raw ibs=1 skip=40 count=10 of=50c.skip40.raw 2>/dev/null || $dddie |
| 163 | dd if=master.raw ibs=1 count=10 of=50c.until10.raw 2>/dev/null || $dddie |
| 164 | dd if=master.raw ibs=1 count=20 of=50c.until20.raw 2>/dev/null || $dddie |
| 165 | dd if=master.raw ibs=1 count=30 of=50c.until30.raw 2>/dev/null || $dddie |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 166 | dd if=master.raw ibs=1 count=39 of=50c.until39.raw 2>/dev/null || $dddie |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 167 | dd if=master.raw ibs=1 count=40 of=50c.until40.raw 2>/dev/null || $dddie |
| 168 | dd if=master.raw ibs=1 skip=10 count=20 of=50c.skip10.until30.raw 2>/dev/null || $dddie |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 169 | dd if=master.raw ibs=1 skip=10 count=29 of=50c.skip10.until39.raw 2>/dev/null || $dddie |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 170 | dd if=master.raw ibs=1 skip=10 count=30 of=50c.skip10.until40.raw 2>/dev/null || $dddie |
| 171 | dd if=master.raw ibs=1 skip=20 count=10 of=50c.skip20.until30.raw 2>/dev/null || $dddie |
| 172 | dd if=master.raw ibs=1 skip=20 count=20 of=50c.skip20.until40.raw 2>/dev/null || $dddie |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 173 | |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 174 | wav_eopt="--silent --force --verify --lax" |
| 175 | wav_dopt="--silent --force --decode" |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 176 | |
| 177 | raw_eopt="$wav_eopt --force-raw-format --endian=big --sign=signed --sample-rate=10 --bps=8 --channels=1" |
| 178 | raw_dopt="$wav_dopt --force-raw-format --endian=big --sign=signed" |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 179 | |
| 180 | # |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 181 | # convert them to WAVE and AIFF files |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 182 | # |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 183 | convert_to_wav () |
| 184 | { |
| 185 | run_flac $raw_eopt $1.raw || die "ERROR converting $1.raw to WAVE" |
| 186 | run_flac $wav_dopt $1.flac || die "ERROR converting $1.raw to WAVE" |
| 187 | } |
| 188 | convert_to_wav 50c |
| 189 | convert_to_wav 50c.skip10 |
| 190 | convert_to_wav 50c.skip11 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 191 | convert_to_wav 50c.skip20 |
| 192 | convert_to_wav 50c.skip30 |
| 193 | convert_to_wav 50c.skip40 |
| 194 | convert_to_wav 50c.until10 |
| 195 | convert_to_wav 50c.until20 |
| 196 | convert_to_wav 50c.until30 |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 197 | convert_to_wav 50c.until39 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 198 | convert_to_wav 50c.until40 |
| 199 | convert_to_wav 50c.skip10.until30 |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 200 | convert_to_wav 50c.skip10.until39 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 201 | convert_to_wav 50c.skip10.until40 |
| 202 | convert_to_wav 50c.skip20.until30 |
| 203 | convert_to_wav 50c.skip20.until40 |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 204 | |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 205 | convert_to_aiff () |
| 206 | { |
| 207 | run_flac $raw_eopt $1.raw || die "ERROR converting $1.raw to AIFF" |
| 208 | run_flac $wav_dopt $1.flac -o $1.aiff || die "ERROR converting $1.raw to AIFF" |
| 209 | } |
| 210 | convert_to_aiff 50c |
| 211 | convert_to_aiff 50c.skip10 |
| 212 | convert_to_aiff 50c.skip11 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 213 | convert_to_aiff 50c.skip20 |
| 214 | convert_to_aiff 50c.skip30 |
| 215 | convert_to_aiff 50c.skip40 |
| 216 | convert_to_aiff 50c.until10 |
| 217 | convert_to_aiff 50c.until20 |
| 218 | convert_to_aiff 50c.until30 |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 219 | convert_to_aiff 50c.until39 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 220 | convert_to_aiff 50c.until40 |
| 221 | convert_to_aiff 50c.skip10.until30 |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 222 | convert_to_aiff 50c.skip10.until39 |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 223 | convert_to_aiff 50c.skip10.until40 |
| 224 | convert_to_aiff 50c.skip20.until30 |
| 225 | convert_to_aiff 50c.skip20.until40 |
Josh Coalson | 5126bb0 | 2002-12-17 08:15:48 +0000 | [diff] [blame] | 226 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 227 | test_skip_until () |
| 228 | { |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 229 | in_fmt=$1 |
| 230 | out_fmt=$2 |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 231 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 232 | [ "$in_fmt" = wav ] || [ "$in_fmt" = aiff ] || [ "$in_fmt" = raw ] || die "ERROR: internal error, bad 'in' format '$in_fmt'" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 233 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 234 | [ "$out_fmt" = flac ] || [ "$out_fmt" = ogg ] || die "ERROR: internal error, bad 'out' format '$out_fmt'" |
| 235 | |
| 236 | if [ $in_fmt = raw ] ; then |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 237 | eopt="$raw_eopt" |
| 238 | dopt="$raw_dopt" |
| 239 | else |
| 240 | eopt="$wav_eopt" |
| 241 | dopt="$wav_dopt" |
| 242 | fi |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 243 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 244 | if [ $out_fmt = ogg ] ; then |
| 245 | eopt="--ogg $eopt" |
| 246 | fi |
| 247 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 248 | # |
| 249 | # test --skip when encoding |
| 250 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 251 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 252 | desc="($in_fmt<->$out_fmt)" |
| 253 | |
| 254 | echo -n "testing --skip=# (encode) $desc... " |
| 255 | run_flac $eopt --skip=10 -o z50c.skip10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 256 | run_flac $dopt -o z50c.skip10.$in_fmt z50c.skip10.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 257 | cmp 50c.skip10.$in_fmt z50c.skip10.$in_fmt || die "ERROR: file mismatch for --skip=10 (encode) $desc" |
| 258 | rm -f z50c.skip10.$out_fmt z50c.skip10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 259 | echo OK |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 260 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 261 | echo -n "testing --skip=mm:ss (encode) $desc... " |
| 262 | run_flac $eopt --skip=0:01 -o z50c.skip0:01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 263 | run_flac $dopt -o z50c.skip0:01.$in_fmt z50c.skip0:01.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 264 | cmp 50c.skip10.$in_fmt z50c.skip0:01.$in_fmt || die "ERROR: file mismatch for --skip=0:01 (encode) $desc" |
| 265 | rm -f z50c.skip0:01.$out_fmt z50c.skip0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 266 | echo OK |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 267 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 268 | echo -n "testing --skip=mm:ss.sss (encode) $desc... " |
| 269 | run_flac $eopt --skip=0:01.1001 -o z50c.skip0:01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 270 | run_flac $dopt -o z50c.skip0:01.1001.$in_fmt z50c.skip0:01.1001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 271 | cmp 50c.skip11.$in_fmt z50c.skip0:01.1001.$in_fmt || die "ERROR: file mismatch for --skip=0:01.1001 (encode) $desc" |
| 272 | rm -f z50c.skip0:01.1001.$out_fmt z50c.skip0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 273 | echo OK |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 274 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 275 | # |
| 276 | # test --skip when decoding |
| 277 | # |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 278 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 279 | echo -n "testing --skip=# (decode) $desc... " |
| 280 | run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 281 | run_flac $dopt --skip=10 -o z50c.skip10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 282 | cmp 50c.skip10.$in_fmt z50c.skip10.$in_fmt || die "ERROR: file mismatch for --skip=10 (decode) $desc" |
| 283 | rm -f z50c.skip10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 284 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 285 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 286 | echo -n "testing --skip=mm:ss (decode) $desc... " |
| 287 | run_flac $dopt --skip=0:01 -o z50c.skip0:01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 288 | cmp 50c.skip10.$in_fmt z50c.skip0:01.$in_fmt || die "ERROR: file mismatch for --skip=0:01 (decode) $desc" |
| 289 | rm -f z50c.skip0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 290 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 291 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 292 | echo -n "testing --skip=mm:ss.sss (decode) $desc... " |
| 293 | run_flac $dopt --skip=0:01.1001 -o z50c.skip0:01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 294 | cmp 50c.skip11.$in_fmt z50c.skip0:01.1001.$in_fmt || die "ERROR: file mismatch for --skip=0:01.1001 (decode) $desc" |
| 295 | rm -f z50c.skip0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 296 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 297 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 298 | rm -f z50c.$out_fmt |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 299 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 300 | # |
| 301 | # test --until when encoding |
| 302 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 303 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 304 | echo -n "testing --until=# (encode) $desc... " |
| 305 | run_flac $eopt --until=40 -o z50c.until40.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 306 | run_flac $dopt -o z50c.until40.$in_fmt z50c.until40.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 307 | cmp 50c.until40.$in_fmt z50c.until40.$in_fmt || die "ERROR: file mismatch for --until=40 (encode) $desc" |
| 308 | rm -f z50c.until40.$out_fmt z50c.until40.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 309 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 310 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 311 | echo -n "testing --until=mm:ss (encode) $desc... " |
| 312 | run_flac $eopt --until=0:04 -o z50c.until0:04.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 313 | run_flac $dopt -o z50c.until0:04.$in_fmt z50c.until0:04.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 314 | cmp 50c.until40.$in_fmt z50c.until0:04.$in_fmt || die "ERROR: file mismatch for --until=0:04 (encode) $desc" |
| 315 | rm -f z50c.until0:04.$out_fmt z50c.until0:04.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 316 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 317 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 318 | echo -n "testing --until=mm:ss.sss (encode) $desc... " |
| 319 | run_flac $eopt --until=0:03.9001 -o z50c.until0:03.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 320 | run_flac $dopt -o z50c.until0:03.9001.$in_fmt z50c.until0:03.9001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 321 | cmp 50c.until39.$in_fmt z50c.until0:03.9001.$in_fmt || die "ERROR: file mismatch for --until=0:03.9001 (encode) $desc" |
| 322 | rm -f z50c.until0:03.9001.$out_fmt z50c.until0:03.9001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 323 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 324 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 325 | echo -n "testing --until=-# (encode) $desc... " |
| 326 | run_flac $eopt --until=-10 -o z50c.until-10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 327 | run_flac $dopt -o z50c.until-10.$in_fmt z50c.until-10.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 328 | cmp 50c.until40.$in_fmt z50c.until-10.$in_fmt || die "ERROR: file mismatch for --until=-10 (encode) $desc" |
| 329 | rm -f z50c.until-10.$out_fmt z50c.until-10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 330 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 331 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 332 | echo -n "testing --until=-mm:ss (encode) $desc... " |
| 333 | run_flac $eopt --until=-0:01 -o z50c.until-0:01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 334 | run_flac $dopt -o z50c.until-0:01.$in_fmt z50c.until-0:01.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 335 | cmp 50c.until40.$in_fmt z50c.until-0:01.$in_fmt || die "ERROR: file mismatch for --until=-0:01 (encode) $desc" |
| 336 | rm -f z50c.until-0:01.$out_fmt z50c.until-0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 337 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 338 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 339 | echo -n "testing --until=-mm:ss.sss (encode) $desc... " |
| 340 | run_flac $eopt --until=-0:01.1001 -o z50c.until-0:01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 341 | run_flac $dopt -o z50c.until-0:01.1001.$in_fmt z50c.until-0:01.1001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 342 | cmp 50c.until39.$in_fmt z50c.until-0:01.1001.$in_fmt || die "ERROR: file mismatch for --until=-0:01.1001 (encode) $desc" |
| 343 | rm -f z50c.until-0:01.1001.$out_fmt z50c.until-0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 344 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 345 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 346 | # |
| 347 | # test --until when decoding |
| 348 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 349 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 350 | run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 351 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 352 | echo -n "testing --until=# (decode) $desc... " |
| 353 | run_flac $dopt --until=40 -o z50c.until40.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 354 | cmp 50c.until40.$in_fmt z50c.until40.$in_fmt || die "ERROR: file mismatch for --until=40 (decode) $desc" |
| 355 | rm -f z50c.until40.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 356 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 357 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 358 | echo -n "testing --until=mm:ss (decode) $desc... " |
| 359 | run_flac $dopt --until=0:04 -o z50c.until0:04.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 360 | cmp 50c.until40.$in_fmt z50c.until0:04.$in_fmt || die "ERROR: file mismatch for --until=0:04 (decode) $desc" |
| 361 | rm -f z50c.until0:04.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 362 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 363 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 364 | echo -n "testing --until=mm:ss.sss (decode) $desc... " |
| 365 | run_flac $dopt --until=0:03.9001 -o z50c.until0:03.9001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 366 | cmp 50c.until39.$in_fmt z50c.until0:03.9001.$in_fmt || die "ERROR: file mismatch for --until=0:03.9001 (decode) $desc" |
| 367 | rm -f z50c.until0:03.9001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 368 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 369 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 370 | echo -n "testing --until=-# (decode) $desc... " |
| 371 | run_flac $dopt --until=-10 -o z50c.until-10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 372 | cmp 50c.until40.$in_fmt z50c.until-10.$in_fmt || die "ERROR: file mismatch for --until=-10 (decode) $desc" |
| 373 | rm -f z50c.until-10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 374 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 375 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 376 | echo -n "testing --until=-mm:ss (decode) $desc... " |
| 377 | run_flac $dopt --until=-0:01 -o z50c.until-0:01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 378 | cmp 50c.until40.$in_fmt z50c.until-0:01.$in_fmt || die "ERROR: file mismatch for --until=-0:01 (decode) $desc" |
| 379 | rm -f z50c.until-0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 380 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 381 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 382 | echo -n "testing --until=-mm:ss.sss (decode) $desc... " |
| 383 | run_flac $dopt --until=-0:01.1001 -o z50c.until-0:01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 384 | cmp 50c.until39.$in_fmt z50c.until-0:01.1001.$in_fmt || die "ERROR: file mismatch for --until=-0:01.1001 (decode) $desc" |
| 385 | rm -f z50c.until-0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 386 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 387 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 388 | rm -f z50c.$out_fmt |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 389 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 390 | # |
| 391 | # test --skip and --until when encoding |
| 392 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 393 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 394 | echo -n "testing --skip=10 --until=# (encode) $desc... " |
| 395 | run_flac $eopt --skip=10 --until=40 -o z50c.skip10.until40.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 396 | run_flac $dopt -o z50c.skip10.until40.$in_fmt z50c.skip10.until40.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 397 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until40.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=40 (encode) $desc" |
| 398 | rm -f z50c.skip10.until40.$out_fmt z50c.skip10.until40.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 399 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 400 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 401 | echo -n "testing --skip=10 --until=mm:ss (encode) $desc... " |
| 402 | run_flac $eopt --skip=10 --until=0:04 -o z50c.skip10.until0:04.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 403 | run_flac $dopt -o z50c.skip10.until0:04.$in_fmt z50c.skip10.until0:04.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 404 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until0:04.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:04 (encode) $desc" |
| 405 | rm -f z50c.skip10.until0:04.$out_fmt z50c.skip10.until0:04.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 406 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 407 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 408 | echo -n "testing --skip=10 --until=mm:ss.sss (encode) $desc... " |
| 409 | run_flac $eopt --skip=10 --until=0:03.9001 -o z50c.skip10.until0:03.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 410 | run_flac $dopt -o z50c.skip10.until0:03.9001.$in_fmt z50c.skip10.until0:03.9001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 411 | cmp 50c.skip10.until39.$in_fmt z50c.skip10.until0:03.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:03.9001 (encode) $desc" |
| 412 | rm -f z50c.skip10.until0:03.9001.$out_fmt z50c.skip10.until0:03.9001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 413 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 414 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 415 | echo -n "testing --skip=10 --until=+# (encode) $desc... " |
| 416 | run_flac $eopt --skip=10 --until=+30 -o z50c.skip10.until+30.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 417 | run_flac $dopt -o z50c.skip10.until+30.$in_fmt z50c.skip10.until+30.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 418 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until+30.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+30 (encode) $desc" |
| 419 | rm -f z50c.skip10.until+30.$out_fmt z50c.skip10.until+30.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 420 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 421 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 422 | echo -n "testing --skip=10 --until=+mm:ss (encode) $desc... " |
| 423 | run_flac $eopt --skip=10 --until=+0:03 -o z50c.skip10.until+0:03.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 424 | run_flac $dopt -o z50c.skip10.until+0:03.$in_fmt z50c.skip10.until+0:03.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 425 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until+0:03.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+0:03 (encode) $desc" |
| 426 | rm -f z50c.skip10.until+0:03.$out_fmt z50c.skip10.until+0:03.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 427 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 428 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 429 | echo -n "testing --skip=10 --until=+mm:ss.sss (encode) $desc... " |
| 430 | run_flac $eopt --skip=10 --until=+0:02.9001 -o z50c.skip10.until+0:02.9001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 431 | run_flac $dopt -o z50c.skip10.until+0:02.9001.$in_fmt z50c.skip10.until+0:02.9001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 432 | cmp 50c.skip10.until39.$in_fmt z50c.skip10.until+0:02.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=+0:02.9001 (encode) $desc" |
| 433 | rm -f z50c.skip10.until+0:02.9001.$out_fmt z50c.skip10.until+0:02.9001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 434 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 435 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 436 | echo -n "testing --skip=10 --until=-# (encode) $desc... " |
| 437 | run_flac $eopt --skip=10 --until=-10 -o z50c.skip10.until-10.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 438 | run_flac $dopt -o z50c.skip10.until-10.$in_fmt z50c.skip10.until-10.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 439 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until-10.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-10 (encode) $desc" |
| 440 | rm -f z50c.skip10.until-10.$out_fmt z50c.skip10.until-10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 441 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 442 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 443 | echo -n "testing --skip=10 --until=-mm:ss (encode) $desc... " |
| 444 | run_flac $eopt --skip=10 --until=-0:01 -o z50c.skip10.until-0:01.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 445 | run_flac $dopt -o z50c.skip10.until-0:01.$in_fmt z50c.skip10.until-0:01.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 446 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until-0:01.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01 (encode) $desc" |
| 447 | rm -f z50c.skip10.until-0:01.$out_fmt z50c.skip10.until-0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 448 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 449 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 450 | echo -n "testing --skip=10 --until=-mm:ss.sss (encode) $desc... " |
| 451 | run_flac $eopt --skip=10 --until=-0:01.1001 -o z50c.skip10.until-0:01.1001.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 452 | run_flac $dopt -o z50c.skip10.until-0:01.1001.$in_fmt z50c.skip10.until-0:01.1001.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 453 | cmp 50c.skip10.until39.$in_fmt z50c.skip10.until-0:01.1001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01.1001 (encode) $desc" |
| 454 | rm -f z50c.skip10.until-0:01.1001.$out_fmt z50c.skip10.until-0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 455 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 456 | |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 457 | # |
| 458 | # test --skip and --until when decoding |
| 459 | # |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 460 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 461 | run_flac $eopt -o z50c.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 462 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 463 | echo -n "testing --skip=10 --until=# (decode) $desc... " |
| 464 | run_flac $dopt --skip=10 --until=40 -o z50c.skip10.until40.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 465 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until40.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=40 (decode) $desc" |
| 466 | rm -f z50c.skip10.until40.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 467 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 468 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 469 | echo -n "testing --skip=10 --until=mm:ss (decode) $desc... " |
| 470 | run_flac $dopt --skip=10 --until=0:04 -o z50c.skip10.until0:04.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 471 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until0:04.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:04 (decode) $desc" |
| 472 | rm -f z50c.skip10.until0:04.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 473 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 474 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 475 | echo -n "testing --skip=10 --until=mm:ss.sss (decode) $desc... " |
| 476 | run_flac $dopt --skip=10 --until=0:03.9001 -o z50c.skip10.until0:03.9001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 477 | cmp 50c.skip10.until39.$in_fmt z50c.skip10.until0:03.9001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=0:03.9001 (decode) $desc" |
| 478 | rm -f z50c.skip10.until0:03.9001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 479 | echo OK |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 480 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 481 | echo -n "testing --skip=10 --until=-# (decode) $desc... " |
| 482 | run_flac $dopt --skip=10 --until=-10 -o z50c.skip10.until-10.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 483 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until-10.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-10 (decode) $desc" |
| 484 | rm -f z50c.skip10.until-10.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 485 | echo OK |
| 486 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 487 | echo -n "testing --skip=10 --until=-mm:ss (decode) $desc... " |
| 488 | run_flac $dopt --skip=10 --until=-0:01 -o z50c.skip10.until-0:01.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 489 | cmp 50c.skip10.until40.$in_fmt z50c.skip10.until-0:01.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01 (decode) $desc" |
| 490 | rm -f z50c.skip10.until-0:01.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 491 | echo OK |
| 492 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 493 | echo -n "testing --skip=10 --until=-mm:ss.sss (decode) $desc... " |
| 494 | run_flac $dopt --skip=10 --until=-0:01.1001 -o z50c.skip10.until-0:01.1001.$in_fmt z50c.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 495 | cmp 50c.skip10.until39.$in_fmt z50c.skip10.until-0:01.1001.$in_fmt || die "ERROR: file mismatch for --skip=10 --until=-0:01.1001 (decode) $desc" |
| 496 | rm -f z50c.skip10.until-0:01.1001.$in_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 497 | echo OK |
| 498 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 499 | rm -f z50c.$out_fmt |
Josh Coalson | 8232e29 | 2002-12-14 06:22:22 +0000 | [diff] [blame] | 500 | } |
| 501 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 502 | test_skip_until raw flac |
| 503 | test_skip_until wav flac |
| 504 | test_skip_until aiff flac |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 505 | |
Josh Coalson | 3e3ad0c | 2004-07-07 07:39:59 +0000 | [diff] [blame] | 506 | if [ $has_ogg = "yes" ] ; then |
| 507 | test_skip_until raw ogg |
| 508 | test_skip_until wav ogg |
| 509 | test_skip_until aiff ogg |
| 510 | fi |
Josh Coalson | 9238a14 | 2002-12-21 03:29:26 +0000 | [diff] [blame] | 511 | |
| 512 | ############################################################################ |
Josh Coalson | 03a5a69 | 2004-07-17 00:23:17 +0000 | [diff] [blame] | 513 | # test --cue |
| 514 | ############################################################################ |
| 515 | |
| 516 | # |
| 517 | # create the cue sheet |
| 518 | # |
| 519 | cuesheet=cuetest.cue |
| 520 | cat > $cuesheet << EOF |
| 521 | CATALOG 1234567890123 |
| 522 | FILE "blah" WAVE |
| 523 | TRACK 01 AUDIO |
| 524 | INDEX 01 0 |
| 525 | INDEX 02 10 |
| 526 | INDEX 03 20 |
| 527 | TRACK 02 AUDIO |
| 528 | INDEX 01 30 |
| 529 | TRACK 04 AUDIO |
| 530 | INDEX 01 40 |
| 531 | EOF |
| 532 | |
| 533 | test_cue () |
| 534 | { |
| 535 | in_fmt=$1 |
| 536 | out_fmt=$2 |
| 537 | |
| 538 | [ "$in_fmt" = wav ] || [ "$in_fmt" = aiff ] || [ "$in_fmt" = raw ] || die "ERROR: internal error, bad 'in' format '$in_fmt'" |
| 539 | |
| 540 | [ "$out_fmt" = flac ] || [ "$out_fmt" = ogg ] || die "ERROR: internal error, bad 'out' format '$out_fmt'" |
| 541 | |
| 542 | if [ $in_fmt = raw ] ; then |
| 543 | eopt="$raw_eopt" |
| 544 | dopt="$raw_dopt" |
| 545 | else |
| 546 | eopt="$wav_eopt" |
| 547 | dopt="$wav_dopt" |
| 548 | fi |
| 549 | |
| 550 | if [ $out_fmt = ogg ] ; then |
| 551 | eopt="--ogg $eopt" |
| 552 | fi |
| 553 | |
| 554 | desc="($in_fmt<->$out_fmt)" |
| 555 | |
| 556 | # |
| 557 | # for this we need just need just one FLAC file; --cue only works while decoding |
| 558 | # |
| 559 | run_flac $eopt --cuesheet=$cuesheet -o z50c.cue.$out_fmt 50c.$in_fmt || die "ERROR generating FLAC file $desc" |
| 560 | |
| 561 | # To make it easy to translate from cue point to sample numbers, the |
| 562 | # file has a sample rate of 10 Hz and a cuesheet like so: |
| 563 | # |
| 564 | # TRACK 01, INDEX 01 : 0:00.00 -> sample 0 |
| 565 | # TRACK 01, INDEX 02 : 0:01.00 -> sample 10 |
| 566 | # TRACK 01, INDEX 03 : 0:02.00 -> sample 20 |
| 567 | # TRACK 02, INDEX 01 : 0:03.00 -> sample 30 |
| 568 | # TRACK 04, INDEX 01 : 0:04.00 -> sample 40 |
| 569 | # |
| 570 | echo -n "testing --cue=- $desc... " |
| 571 | run_flac $dopt -o z50c.cue.$in_fmt --cue=- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 572 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=- $desc" |
| 573 | rm -f z50c.cue.$in_fmt |
| 574 | echo OK |
| 575 | |
| 576 | echo -n "testing --cue=1.0 $desc... " |
| 577 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 578 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.0 $desc" |
| 579 | rm -f z50c.cue.$in_fmt |
| 580 | echo OK |
| 581 | |
| 582 | echo -n "testing --cue=1.0- $desc... " |
| 583 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.0- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 584 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.0- $desc" |
| 585 | rm -f z50c.cue.$in_fmt |
| 586 | echo OK |
| 587 | |
| 588 | echo -n "testing --cue=1.1 $desc... " |
| 589 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 590 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.1 $desc" |
| 591 | rm -f z50c.cue.$in_fmt |
| 592 | echo OK |
| 593 | |
| 594 | echo -n "testing --cue=1.1- $desc... " |
| 595 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.1- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 596 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.1- $desc" |
| 597 | rm -f z50c.cue.$in_fmt |
| 598 | echo OK |
| 599 | |
| 600 | echo -n "testing --cue=1.2 $desc... " |
| 601 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.2 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 602 | cmp 50c.skip10.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.2 $desc" |
| 603 | rm -f z50c.cue.$in_fmt |
| 604 | echo OK |
| 605 | |
| 606 | echo -n "testing --cue=1.2- $desc... " |
| 607 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.2- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 608 | cmp 50c.skip10.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.2- $desc" |
| 609 | rm -f z50c.cue.$in_fmt |
| 610 | echo OK |
| 611 | |
| 612 | echo -n "testing --cue=1.4 $desc... " |
| 613 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.4 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 614 | cmp 50c.skip20.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.4 $desc" |
| 615 | rm -f z50c.cue.$in_fmt |
| 616 | echo OK |
| 617 | |
| 618 | echo -n "testing --cue=1.4- $desc... " |
| 619 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.4- z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 620 | cmp 50c.skip20.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.4- $desc" |
| 621 | rm -f z50c.cue.$in_fmt |
| 622 | echo OK |
| 623 | |
| 624 | echo -n "testing --cue=-5.0 $desc... " |
| 625 | run_flac $dopt -o z50c.cue.$in_fmt --cue=-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 626 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=-5.0 $desc" |
| 627 | rm -f z50c.cue.$in_fmt |
| 628 | echo OK |
| 629 | |
| 630 | echo -n "testing --cue=-4.1 $desc... " |
| 631 | run_flac $dopt -o z50c.cue.$in_fmt --cue=-4.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 632 | cmp 50c.until40.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=-4.1 $desc" |
| 633 | rm -f z50c.cue.$in_fmt |
| 634 | echo OK |
| 635 | |
| 636 | echo -n "testing --cue=-3.1 $desc... " |
| 637 | run_flac $dopt -o z50c.cue.$in_fmt --cue=-3.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 638 | cmp 50c.until40.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=-3.1 $desc" |
| 639 | rm -f z50c.cue.$in_fmt |
| 640 | echo OK |
| 641 | |
| 642 | echo -n "testing --cue=-1.4 $desc... " |
| 643 | run_flac $dopt -o z50c.cue.$in_fmt --cue=-1.4 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 644 | cmp 50c.until30.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=-1.4 $desc" |
| 645 | rm -f z50c.cue.$in_fmt |
| 646 | echo OK |
| 647 | |
| 648 | echo -n "testing --cue=1.0-5.0 $desc... " |
| 649 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.0-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 650 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.0-5.0 $desc" |
| 651 | rm -f z50c.cue.$in_fmt |
| 652 | echo OK |
| 653 | |
| 654 | echo -n "testing --cue=1.1-5.0 $desc... " |
| 655 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.1-5.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 656 | cmp 50c.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.1-5.0 $desc" |
| 657 | rm -f z50c.cue.$in_fmt |
| 658 | echo OK |
| 659 | |
| 660 | echo -n "testing --cue=1.2-4.1 $desc... " |
| 661 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.2-4.1 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 662 | cmp 50c.skip10.until40.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.2-4.1 $desc" |
| 663 | rm -f z50c.cue.$in_fmt |
| 664 | echo OK |
| 665 | |
| 666 | echo -n "testing --cue=1.4-2.0 $desc... " |
| 667 | run_flac $dopt -o z50c.cue.$in_fmt --cue=1.4-2.0 z50c.cue.$out_fmt || die "ERROR decoding FLAC file $desc" |
| 668 | cmp 50c.skip20.until30.$in_fmt z50c.cue.$in_fmt || die "ERROR: file mismatch for --cue=1.4-2.0 $desc" |
| 669 | rm -f z50c.cue.$in_fmt |
| 670 | echo OK |
| 671 | |
| 672 | rm -f z50c.cue.$out_fmt |
| 673 | } |
| 674 | |
| 675 | test_cue raw flac |
| 676 | test_cue wav flac |
| 677 | test_cue aiff flac |
| 678 | |
| 679 | if [ $has_ogg = "yes" ] ; then |
| 680 | test_cue raw ogg |
| 681 | test_cue wav ogg |
| 682 | test_cue aiff ogg |
| 683 | fi |
| 684 | |
| 685 | ############################################################################ |
Josh Coalson | 9238a14 | 2002-12-21 03:29:26 +0000 | [diff] [blame] | 686 | # test 'fixup' code that happens when a FLAC file with total_samples == 0 |
| 687 | # in the STREAMINFO block is converted to WAVE or AIFF, requiring the |
| 688 | # decoder go back and fix up the chunk headers |
| 689 | ############################################################################ |
| 690 | |
| 691 | echo -n "WAVE fixup test... " |
| 692 | echo -n "prepare... " |
| 693 | convert_to_wav noise || die "ERROR creating reference WAVE" |
| 694 | echo -n "encode... " |
| 695 | cat noise.raw | run_flac $raw_eopt - -c > fixup.flac || die "ERROR generating FLAC file" |
| 696 | echo -n "decode... " |
| 697 | run_flac $wav_dopt fixup.flac -o fixup.wav || die "ERROR decoding FLAC file" |
| 698 | echo -n "compare... " |
| 699 | cmp noise.wav fixup.wav || die "ERROR: file mismatch" |
| 700 | echo OK |
| 701 | rm -f noise.wav fixup.wav fixup.flac |
| 702 | |
| 703 | echo -n "AIFF fixup test... " |
| 704 | echo -n "prepare... " |
| 705 | convert_to_aiff noise || die "ERROR creating reference AIFF" |
| 706 | echo -n "encode... " |
| 707 | cat noise.raw | run_flac $raw_eopt - -c > fixup.flac || die "ERROR generating FLAC file" |
| 708 | echo -n "decode... " |
| 709 | run_flac $wav_dopt fixup.flac -o fixup.aiff || die "ERROR decoding FLAC file" |
| 710 | echo -n "compare... " |
| 711 | cmp noise.aiff fixup.aiff || die "ERROR: file mismatch" |
| 712 | echo OK |
| 713 | rm -f noise.aiff fixup.aiff fixup.flac |
| 714 | |
| 715 | |
| 716 | ############################################################################ |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 717 | # multi-file tests |
Josh Coalson | 9238a14 | 2002-12-21 03:29:26 +0000 | [diff] [blame] | 718 | ############################################################################ |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 719 | |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 720 | echo "Generating multiple input files from noise..." |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 721 | run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 noise.raw || die "ERROR generating FLAC file" |
| 722 | run_flac --decode --force --silent noise.flac || die "ERROR generating WAVE file" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 723 | rm -f noise.flac |
| 724 | mv noise.wav file0.wav |
| 725 | cp file0.wav file1.wav |
| 726 | cp file1.wav file2.wav |
| 727 | |
| 728 | test_multifile () |
| 729 | { |
| 730 | streamtype=$1 |
| 731 | sector_align=$2 |
| 732 | encode_options="$3" |
| 733 | |
| 734 | if [ $streamtype = ogg ] ; then |
| 735 | suffix=ogg |
| 736 | encode_options="$encode_options --ogg" |
| 737 | else |
| 738 | suffix=flac |
| 739 | fi |
| 740 | |
| 741 | if [ $sector_align = sector_align ] ; then |
| 742 | encode_options="$encode_options --sector-align" |
| 743 | fi |
| 744 | |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 745 | run_flac --force $encode_options file0.wav file1.wav file2.wav || die "ERROR" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 746 | for n in 0 1 2 ; do |
| 747 | mv file$n.$suffix file${n}x.$suffix |
| 748 | done |
Josh Coalson | 0bb57d0 | 2004-07-16 00:50:42 +0000 | [diff] [blame] | 749 | run_flac --force --decode file0x.$suffix file1x.$suffix file2x.$suffix || die "ERROR" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 750 | if [ $sector_align != sector_align ] ; then |
| 751 | for n in 0 1 2 ; do |
Josh Coalson | 8fac5d6 | 2002-12-12 03:57:47 +0000 | [diff] [blame] | 752 | cmp file$n.wav file${n}x.wav || die "ERROR: file mismatch on file #$n" |
Josh Coalson | 463d0f8 | 2002-12-10 06:41:27 +0000 | [diff] [blame] | 753 | done |
| 754 | fi |
| 755 | for n in 0 1 2 ; do |
| 756 | rm -f file${n}x.$suffix file${n}x.wav |
| 757 | done |
| 758 | } |
| 759 | |
| 760 | echo "Testing multiple files without verify..." |
| 761 | test_multifile flac no_sector_align "" |
| 762 | |
| 763 | echo "Testing multiple files with verify..." |
| 764 | test_multifile flac no_sector_align "--verify" |
| 765 | |
| 766 | echo "Testing multiple files with --sector-align, without verify..." |
| 767 | test_multifile flac sector_align "" |
| 768 | |
| 769 | echo "Testing multiple files with --sector-align, with verify..." |
| 770 | test_multifile flac sector_align "--verify" |
| 771 | |
| 772 | if [ $has_ogg = "yes" ] ; then |
| 773 | echo "Testing multiple files with --ogg, without verify..." |
| 774 | test_multifile ogg no_sector_align "" |
| 775 | |
| 776 | echo "Testing multiple files with --ogg, with verify..." |
| 777 | test_multifile ogg no_sector_align "--verify" |
| 778 | |
| 779 | echo "Testing multiple files with --ogg and --sector-align, without verify..." |
| 780 | test_multifile ogg sector_align "" |
| 781 | |
| 782 | echo "Testing multiple files with --ogg and --sector-align, with verify..." |
| 783 | test_multifile sector_align ogg "--verify" |
| 784 | |
| 785 | echo "Testing multiple files with --ogg and --serial-number, with verify..." |
| 786 | test_multifile ogg no_sector_align "--serial-number=321 --verify" |
| 787 | fi |