Author: Joachim Reichel Description: Make test suite thread-safe. Use distinct filenames for temporary files. Add dependency on test-tools. Index: normalize-audio-0.7.7/test/Makefile.am =================================================================== --- normalize-audio-0.7.7.orig/test/Makefile.am +++ normalize-audio-0.7.7/test/Makefile.am @@ -19,9 +19,11 @@ TESTS = test-tools test8bit.sh test16bit.sh test24bit.sh +$(TESTS): test-tools + EXTRA_DIST = $(TESTS) -CLEANFILES = test-tools mono.wav stereo.wav test.log +CLEANFILES = test-tools mono8.wav stereo8.wav test8.log mono16.wav stereo16.wav test16.log mono24.wav stereo24.wav test24.log test-tools: ../src/mktestwav -rm -f test.log Index: normalize-audio-0.7.7/test/test16bit.sh =================================================================== --- normalize-audio-0.7.7.orig/test/test16bit.sh +++ normalize-audio-0.7.7/test/test16bit.sh @@ -7,64 +7,64 @@ export LC_ALL LC_NUMERIC # correct answers MONO_BEFORE=40d859e7c05a93883eff84077edaef52 STEREO_BEFORE=3f5fb4e39d2ad8c6b1cf7bf7e6eed20b -LVL_MONO="-6.0211dBFS -3.0106dBFS -5.9789dB mono.wav" -LVL_STEREO="-6.0211dBFS -3.0106dBFS -5.9789dB stereo.wav" +LVL_MONO="-6.0211dBFS -3.0106dBFS -5.9789dB mono16.wav" +LVL_STEREO="-6.0211dBFS -3.0106dBFS -5.9789dB stereo16.wav" MONO_AFTER=3b41f1dc0623c53473f603a0451d59ca STEREO_AFTER=8312e5c583e5cb60dda29d0289895cb2 -exec 3>> test.log +exec 3>> test16.log echo "Testing 16-bit wavs..." >&3 -../src/mktestwav -a 0.5 -b 2 -c 1 mono.wav -../src/mktestwav -a 0.5 -b 2 -c 2 stereo.wav +../src/mktestwav -a 0.5 -b 2 -c 1 mono16.wav +../src/mktestwav -a 0.5 -b 2 -c 2 stereo16.wav # Check that the files written by mktestwav are correct -CHKSUM=`tail -c +44 mono.wav | md5sum` +CHKSUM=`tail -c +44 mono16.wav | md5sum` case "$CHKSUM" in $MONO_BEFORE*) ;; - *) echo "FAIL: created mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created mono16.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo16.wav | md5sum` case "$CHKSUM" in $STEREO_BEFORE*) ;; - *) echo "FAIL: created stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created stereo16.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav created..." >&3 +echo "mono16.wav and stereo16.wav created..." >&3 # Check that normalize correctly measures the volume of the files -NORM=`../src/normalize -qn mono.wav` +NORM=`../src/normalize -qn mono16.wav` if test x"$NORM" != x"$LVL_MONO"; then - echo "FAIL: measured volume of mono.wav is incorrect:" >&3 + echo "FAIL: measured volume of mono16.wav is incorrect:" >&3 echo " should be: $LVL_MONO" >&3 echo " got: $NORM" >&3 exit 1 fi -NORM=`../src/normalize -qn stereo.wav` +NORM=`../src/normalize -qn stereo16.wav` if test x"$NORM" != x"$LVL_STEREO"; then - echo "FAIL: measured volume of stereo.wav is incorrect:" >&3 + echo "FAIL: measured volume of stereo16.wav is incorrect:" >&3 echo " should be: $LVL_STEREO" >&3 echo " got: $NORM" >&3 exit 1 fi -echo "mono.wav and stereo.wav measured successfully..." >&3 +echo "mono16.wav and stereo16.wav measured successfully..." >&3 # Check that normalize correctly normalizes the volume of the files -../src/normalize -q mono.wav -../src/normalize -q stereo.wav -CHKSUM=`tail -c +44 mono.wav | md5sum` +../src/normalize -q mono16.wav +../src/normalize -q stereo16.wav +CHKSUM=`tail -c +44 mono16.wav | md5sum` case "$CHKSUM" in $MONO_AFTER*) ;; - *) echo "FAIL: adjusted mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted mono16.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo16.wav | md5sum` case "$CHKSUM" in $STEREO_AFTER*) ;; - *) echo "FAIL: adjusted stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted stereo16.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav adjusted successfully..." >&3 +echo "mono16.wav and stereo16.wav adjusted successfully..." >&3 echo "PASSED!" >&3 exit 0 Index: normalize-audio-0.7.7/test/test24bit.sh =================================================================== --- normalize-audio-0.7.7.orig/test/test24bit.sh +++ normalize-audio-0.7.7/test/test24bit.sh @@ -7,64 +7,64 @@ export LC_ALL LC_NUMERIC # correct answers MONO_BEFORE=1f6586aa8a849a3bd8b24b42eb9e3f63 STEREO_BEFORE=24d9a4de01f11c0a4e37c1f0fedb1675 -LVL_MONO="-6.0206dBFS -3.0104dBFS -5.9794dB mono.wav" -LVL_STEREO="-6.0206dBFS -3.0104dBFS -5.9794dB stereo.wav" +LVL_MONO="-6.0206dBFS -3.0104dBFS -5.9794dB mono24.wav" +LVL_STEREO="-6.0206dBFS -3.0104dBFS -5.9794dB stereo24.wav" MONO_AFTER=1553f2c735477f1de783365db1bec012 STEREO_AFTER=cf7581a8924eb3b29b93e93bc6a9f7dc -exec 3>> test.log +exec 3>> test24.log echo "Testing 24-bit wavs..." >&3 -../src/mktestwav -a 0.5 -b 3 -c 1 mono.wav -../src/mktestwav -a 0.5 -b 3 -c 2 stereo.wav +../src/mktestwav -a 0.5 -b 3 -c 1 mono24.wav +../src/mktestwav -a 0.5 -b 3 -c 2 stereo24.wav # Check that the files written by mktestwav are correct -CHKSUM=`tail -c +44 mono.wav | md5sum` +CHKSUM=`tail -c +44 mono24.wav | md5sum` case "$CHKSUM" in $MONO_BEFORE*) ;; - *) echo "FAIL: created mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created mono24.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo24.wav | md5sum` case "$CHKSUM" in $STEREO_BEFORE*) ;; - *) echo "FAIL: created stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created stereo24.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav created..." >&3 +echo "mono24.wav and stereo24.wav created..." >&3 # Check that normalize correctly measures the volume of the files -NORM=`../src/normalize -qn mono.wav` +NORM=`../src/normalize -qn mono24.wav` if test x"$NORM" != x"$LVL_MONO"; then - echo "FAIL: measured volume of mono.wav is incorrect:" >&3 + echo "FAIL: measured volume of mono24.wav is incorrect:" >&3 echo " should be: $LVL_MONO" >&3 echo " got: $NORM" >&3 exit 1 fi -NORM=`../src/normalize -qn stereo.wav` +NORM=`../src/normalize -qn stereo24.wav` if test x"$NORM" != x"$LVL_STEREO"; then - echo "FAIL: measured volume of stereo.wav is incorrect:" >&3 + echo "FAIL: measured volume of stereo24.wav is incorrect:" >&3 echo " should be: $LVL_STEREO" >&3 echo " got: $NORM" >&3 exit 1 fi -echo "mono.wav and stereo.wav measured successfully..." >&3 +echo "mono24.wav and stereo24.wav measured successfully..." >&3 # Check that normalize correctly normalizes the volume of the files -../src/normalize -q mono.wav -../src/normalize -q stereo.wav -CHKSUM=`tail -c +44 mono.wav | md5sum` +../src/normalize -q mono24.wav +../src/normalize -q stereo24.wav +CHKSUM=`tail -c +44 mono24.wav | md5sum` case "$CHKSUM" in $MONO_AFTER*) ;; - *) echo "FAIL: adjusted mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted mono24.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo24.wav | md5sum` case "$CHKSUM" in $STEREO_AFTER*) ;; - *) echo "FAIL: adjusted stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted stereo24.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav adjusted successfully..." >&3 +echo "mono24.wav and stereo24.wav adjusted successfully..." >&3 echo "PASSED!" >&3 exit 0 Index: normalize-audio-0.7.7/test/test8bit.sh =================================================================== --- normalize-audio-0.7.7.orig/test/test8bit.sh +++ normalize-audio-0.7.7/test/test8bit.sh @@ -7,64 +7,64 @@ export LC_ALL LC_NUMERIC # correct answers MONO_BEFORE=0e37a15946316f3db6fc9a23abf3f946 STEREO_BEFORE=449a7f8dc0f38912606e1ebcfc5bac85 -LVL_MONO="-6.1497dBFS -3.0883dBFS -5.8503dB mono.wav" -LVL_STEREO="-6.1497dBFS -3.0883dBFS -5.8503dB stereo.wav" +LVL_MONO="-6.1497dBFS -3.0883dBFS -5.8503dB mono8.wav" +LVL_STEREO="-6.1497dBFS -3.0883dBFS -5.8503dB stereo8.wav" MONO_AFTER=b684ba44e69d7171c7938acc3ae4d1c6 STEREO_AFTER=7a0d972b53f9c63bf714da73eac9f86a -exec 3>> test.log +exec 3>> test8.log echo "Testing 8-bit wavs..." >&3 -../src/mktestwav -a 0.5 -b 1 -c 1 mono.wav -../src/mktestwav -a 0.5 -b 1 -c 2 stereo.wav +../src/mktestwav -a 0.5 -b 1 -c 1 mono8.wav +../src/mktestwav -a 0.5 -b 1 -c 2 stereo8.wav # Check that the files written by mktestwav are correct -CHKSUM=`tail -c +44 mono.wav | md5sum` +CHKSUM=`tail -c +44 mono8.wav | md5sum` case "$CHKSUM" in $MONO_BEFORE*) ;; - *) echo "FAIL: created mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created mono8.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo8.wav | md5sum` case "$CHKSUM" in $STEREO_BEFORE*) ;; - *) echo "FAIL: created stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: created stereo8.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav created..." >&3 +echo "mono8.wav and stereo8.wav created..." >&3 # Check that normalize correctly measures the volume of the files -NORM=`../src/normalize -qn mono.wav` +NORM=`../src/normalize -qn mono8.wav` if test x"$NORM" != x"$LVL_MONO"; then - echo "FAIL: measured volume of mono.wav is incorrect:" >&3 + echo "FAIL: measured volume of mono8.wav is incorrect:" >&3 echo " should be: $LVL_MONO" >&3 echo " got: $NORM" >&3 exit 1 fi -NORM=`../src/normalize -qn stereo.wav` +NORM=`../src/normalize -qn stereo8.wav` if test x"$NORM" != x"$LVL_STEREO"; then - echo "FAIL: measured volume of stereo.wav is incorrect:" >&3 + echo "FAIL: measured volume of stereo8.wav is incorrect:" >&3 echo " should be: $LVL_STEREO" >&3 echo " got: $NORM" >&3 exit 1 fi -echo "mono.wav and stereo.wav measured successfully..." >&3 +echo "mono8.wav and stereo8.wav measured successfully..." >&3 # Check that normalize correctly normalizes the volume of the files -../src/normalize -q mono.wav -../src/normalize -q stereo.wav -CHKSUM=`tail -c +44 mono.wav | md5sum` +../src/normalize -q mono8.wav +../src/normalize -q stereo8.wav +CHKSUM=`tail -c +44 mono8.wav | md5sum` case "$CHKSUM" in $MONO_AFTER*) ;; - *) echo "FAIL: adjusted mono.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted mono8.wav has bad checksum!" >&3; exit 1 ;; esac -CHKSUM=`tail -c +44 stereo.wav | md5sum` +CHKSUM=`tail -c +44 stereo8.wav | md5sum` case "$CHKSUM" in $STEREO_AFTER*) ;; - *) echo "FAIL: adjusted stereo.wav has bad checksum!" >&3; exit 1 ;; + *) echo "FAIL: adjusted stereo8.wav has bad checksum!" >&3; exit 1 ;; esac -echo "mono.wav and stereo.wav adjusted successfully..." >&3 +echo "mono8.wav and stereo8.wav adjusted successfully..." >&3 echo "PASSED!" >&3 exit 0