annotate tests/test-parse-errors/test-parse-errors.sh @ 269:39fb206b1153 piper-nopiper

Filter out Xing/LAME info frames, rather than letting them go to the mp3 decoder as if they were audio frames. Fixes the 1152-sample zero pad at start of some decoded mp3 files (distinct from decoder delay). The logic here is based on the madplay code.
author Chris Cannam
date Thu, 24 Nov 2016 13:32:04 +0000
parents 56ff594b022c
children
rev   line source
Chris@228 1 #!/bin/bash
Chris@228 2
Chris@228 3 . ../include.sh
Chris@228 4
Chris@228 5 infile=$audiopath/3clicks8.wav
Chris@228 6 tmpfile=$mypath/tmp_$$
Chris@228 7 trap "rm -f $tmpfile" 0
Chris@228 8
Chris@228 9 for transform in "$mypath"/inputs/* ; do
Chris@228 10
Chris@228 11 base=$(basename "$transform")
Chris@228 12 expected="$mypath"/expected/"$base".txt
Chris@228 13
Chris@228 14 if [ ! -f "$expected" ]; then
Chris@228 15 fail "Internal error: Expected file $expected not found for transform $transform"
Chris@228 16 fi
Chris@228 17
Chris@228 18 if $r -t "$transform" -w csv --csv-one-file /dev/null "$infile" 2>"$tmpfile" ; then
Chris@228 19 fail "Erroneously succeeds in running bogus transform $transform"
Chris@228 20 fi
Chris@228 21
Chris@228 22 cat "$expected" | while read line; do
Chris@228 23 if ! fgrep -q "$line" "$tmpfile" ; then
Chris@228 24 fail "Expected output text \"$line\" not found in diagnostic output for transform $base"
Chris@228 25 fi
Chris@228 26 done
Chris@228 27
Chris@228 28 done
Chris@228 29