annotate tests/test-parse-errors/test-parse-errors.sh @ 271:7b3a80021b7c piper-nopiper

Add MAD_BUFFER_GUARD padding at end of mp3 buffer, in order to ensure last frame is decoded successfully (otherwise the decoded audio is truncated). Another thing learned from madplay.
author Chris Cannam
date Thu, 24 Nov 2016 17:06:31 +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