tests: verify --tx consistency

PASS: 16-verify-tx-consistent.test
FAIL: 17-verify-tx-consistent-float.test

The FAIL is due inconsistency in the .wav header (only for floats)
constructed by libsndfile -- its different every wall-clock second.
Even just a bare header (no audio samples) shows the effect:

  minimodem --float-samples --tx 1000 -f /tmp/xx.wav </dev/null
  sum -r /tmp/xx.wav
  sleep 1
  minimodem --float-samples --tx 1000 -f /tmp/xx.wav </dev/null
  sum -r /tmp/xx.wav

This might also relate to:
https://github.com/kamalmostafa/minimodem/issues/24
This commit is contained in:
Kamal Mostafa 2016-04-23 10:20:47 -07:00
parent c2e4d9e1c4
commit 78cff1778b
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,54 @@
#!/bin/bash
MINIMODEM="${MINIMODEM-./minimodem}"
[ -f "$MINIMODEM" ] || {
MINIMODEM="../src/minimodem"
[ -f "$MINIMODEM" ] || {
echo "E: cannot find minimodem in ./ or ../src/" 1>&2
exit 1
}
}
minimodem_tx_args="1200 $1"
textfile="testdata-ascii.txt"
TMPF="/tmp/minimodem-test-$$"
trap "rm -f $TMPF.*" 0
set -e
$MINIMODEM --tx --file $TMPF.1.wav $minimodem_tx_args < "$textfile"
sum1=$(md5sum -b < $TMPF.1.wav)
echo "$sum1 $TMPF.1.wav"
sleep 1
$MINIMODEM --tx --file $TMPF.2.wav $minimodem_tx_args < "$textfile"
sum2=$(md5sum -b < $TMPF.2.wav)
echo "$sum2 $TMPF.2.wav"
sleep 1
$MINIMODEM --tx --file $TMPF.3.wav $minimodem_tx_args < "$textfile"
sum3=$(md5sum -b < $TMPF.3.wav)
echo "$sum3 $TMPF.3.wav"
[ "$sum1" == "$sum2" ] || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
[ "$sum1" == "$sum3" ] || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
stats="$sum1"
result="OK "
exitcode=0
echo -e "$result $stats"
exit $exitcode

View File

@ -0,0 +1 @@
exec ./16-verify-tx-consistent.test --float-samples