self-test: more test cases
This commit is contained in:
parent
d8ed9bef82
commit
5fb00dd283
@ -26,7 +26,7 @@ bin_PROGRAMS = minimodem
|
||||
|
||||
dist_man_MANS = minimodem.1
|
||||
|
||||
EXTRA_DIST = minimodem.1.html self-test testcases/* # run-test
|
||||
EXTRA_DIST = minimodem.1.html self-test self-test-perfect testcases/* # run-test
|
||||
|
||||
TESTS = testcases/test-*
|
||||
|
||||
|
@ -211,7 +211,7 @@ top_srcdir = @top_srcdir@
|
||||
AM_CFLAGS = -Wall # -Werror
|
||||
INCLUDES = $(DEPS_CFLAGS)
|
||||
dist_man_MANS = minimodem.1
|
||||
EXTRA_DIST = minimodem.1.html self-test testcases/* # run-test
|
||||
EXTRA_DIST = minimodem.1.html self-test self-test-perfect testcases/* # run-test
|
||||
TESTS = testcases/test-*
|
||||
SIMPLEAUDIO_SRC = \
|
||||
simpleaudio.h \
|
||||
|
25
src/self-test-perfect
Executable file
25
src/self-test-perfect
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ $# -ge 2 ] || {
|
||||
echo "usage: self-test-perfect textfile minimodem_args" 1>&2
|
||||
exit 1
|
||||
}
|
||||
textfile="$1"
|
||||
shift
|
||||
minimodem_args="$*"
|
||||
|
||||
TMPF=/tmp/minimodem-test.$$
|
||||
trap "rm -f $TMPF" 0
|
||||
|
||||
# test for "confidence=1.00" and "rate perfect"
|
||||
./self-test "$textfile" $minimodem_args 2>&1 | tee $TMPF
|
||||
|
||||
ndata=$(wc -c <$textfile)
|
||||
|
||||
match="ndata=$ndata confidence=1.00 .* (rate perfect)"
|
||||
grep -q "$match" $TMPF || {
|
||||
echo "Not perfect; expected: $match"
|
||||
exit 1
|
||||
}
|
||||
echo "Perfect!"
|
||||
exit 0
|
1
src/testcases/test-07-self-test-no-lut
Executable file
1
src/testcases/test-07-self-test-no-lut
Executable file
@ -0,0 +1 @@
|
||||
exec ./self-test fsk.c 1200 --lut=0
|
1
src/testcases/test-08-self-test-lut16
Executable file
1
src/testcases/test-08-self-test-lut16
Executable file
@ -0,0 +1 @@
|
||||
exec ./self-test fsk.c 1200 --lut=16
|
1
src/testcases/test-09-self-test-lut16-float
Executable file
1
src/testcases/test-09-self-test-lut16-float
Executable file
@ -0,0 +1 @@
|
||||
exec ./self-test fsk.c 1200 --lut=16 --float-samples
|
@ -1,16 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMPF=/tmp/minimodem-test.$$
|
||||
trap "rm -f $TMPF" 0
|
||||
|
||||
# test for confidence=1.00 when using exact integer multiple frequencies
|
||||
./self-test testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 2>&1 | tee $TMPF
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400
|
||||
|
||||
match="ndata=3123 confidence=1.00 throughput=1200.00 (rate perfect)"
|
||||
grep -q "$match" $TMPF || {
|
||||
echo "Expected: $match"
|
||||
exit 1
|
||||
}
|
||||
echo "Perfect!"
|
||||
exit 0
|
||||
|
2
src/testcases/test-11-verify-perfect-nolut
Executable file
2
src/testcases/test-11-verify-perfect-nolut
Executable file
@ -0,0 +1,2 @@
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 --lut=0
|
2
src/testcases/test-12-verify-perfect-lut16
Executable file
2
src/testcases/test-12-verify-perfect-lut16
Executable file
@ -0,0 +1,2 @@
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 --lut=16
|
2
src/testcases/test-13-verify-perfect-nolut-float
Executable file
2
src/testcases/test-13-verify-perfect-nolut-float
Executable file
@ -0,0 +1,2 @@
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 --lut=0 --float-samples
|
2
src/testcases/test-14-verify-perfect-lut16-float
Executable file
2
src/testcases/test-14-verify-perfect-lut16-float
Executable file
@ -0,0 +1,2 @@
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 --lut=16 --float-samples
|
2
src/testcases/test-15-verify-perfect-float
Executable file
2
src/testcases/test-15-verify-perfect-float
Executable file
@ -0,0 +1,2 @@
|
||||
exec ./self-test-perfect testcases/self-test-ascii.txt \
|
||||
1200 --samplerate 24000 -M 1200 -S 2400 --float-samples
|
Loading…
x
Reference in New Issue
Block a user