diff --git a/media/tests/A_2_1.wav b/media/tests/A_2_1.wav new file mode 100644 index 0000000..d986a4e Binary files /dev/null and b/media/tests/A_2_1.wav differ diff --git a/media/tests/A_2_3.wav b/media/tests/A_2_3.wav new file mode 100644 index 0000000..c6a9860 Binary files /dev/null and b/media/tests/A_2_3.wav differ diff --git a/media/tests/A_2_6.wav b/media/tests/A_2_6.wav new file mode 100644 index 0000000..8c694e5 Binary files /dev/null and b/media/tests/A_2_6.wav differ diff --git a/media/tests/A_2_9.wav b/media/tests/A_2_9.wav new file mode 100644 index 0000000..0b853e4 Binary files /dev/null and b/media/tests/A_2_9.wav differ diff --git a/media/tests/A_3_1.wav b/media/tests/A_3_1.wav new file mode 100644 index 0000000..565ff25 Binary files /dev/null and b/media/tests/A_3_1.wav differ diff --git a/media/tests/test b/media/tests/test new file mode 100755 index 0000000..0d9003d --- /dev/null +++ b/media/tests/test @@ -0,0 +1,44 @@ +#!/bin/bash + +# Run test cases using the media files and the js8 cli decoder + +JS8=~/js8call-prefix/build/js8 +#JS8=/opt/js8call/bin/js8 + +PWD=$(pwd) + +declare -i pass=0 +declare -i fail=0 + +for f in *.wav +do + + MODE=$(echo $f | cut -f 1 -d '_') + DEPTH=$(echo $f | cut -f 2 -d '_') + EXPECTED=$(echo $f | cut -f 3 -d '_' | cut -f 1 -d '.') + + OUT=$($JS8 -8 -b $MODE -d $DEPTH $PWD/$f | tail -n 1 | awk '{print $(NF)}' | sed -E 's/\s//g') + + echo -n $f... + + if [ "$OUT" == "$EXPECTED" ]; then + + echo PASS. + + pass=$((pass+1)) + + else + + echo FAIL got $OUT expected $EXPECTED; + + fail=$((fail+1)) + + fi +done + +echo --- +echo $((pass+fail)) total tests run +echo $pass passed +echo $fail failed + +rm timer.out jt9_wisdom.dat