Commit 1ceda324 authored by Stefan Westerfeld's avatar Stefan Westerfeld

TESTS: add test for watermark add / cmp from pipe

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent f9826fbf
check: detect-speed-test block-decoder-test clip-decoder-test check: detect-speed-test block-decoder-test clip-decoder-test pipe-test
EXTRA_DIST = detect-speed-test.sh block-decoder-test.sh clip-decoder-test.sh EXTRA_DIST = detect-speed-test.sh block-decoder-test.sh clip-decoder-test.sh
...@@ -10,3 +10,6 @@ block-decoder-test: ...@@ -10,3 +10,6 @@ block-decoder-test:
clip-decoder-test: clip-decoder-test:
Q=1 $(top_srcdir)/tests/clip-decoder-test.sh Q=1 $(top_srcdir)/tests/clip-decoder-test.sh
pipe-test:
Q=1 $(top_srcdir)/tests/pipe-test.sh
#!/bin/bash
source test-common.sh
IN_WAV=pipe-test.wav
OUT_WAV=pipe-test-out.wav
$AUDIOWMARK test-gen-noise $IN_WAV 200 44100 || die "failed to generate noise"
cat $IN_WAV | audiowmark_add - - $TEST_MSG > $OUT_WAV || die "watermark from pipe failed"
audiowmark_cmp $OUT_WAV $TEST_MSG
cat $OUT_WAV | audiowmark_cmp - $TEST_MSG || die "watermark detection from pipe failed"
rm $IN_WAV $OUT_WAV
exit 0
...@@ -7,7 +7,7 @@ TEST_MSG=f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0 ...@@ -7,7 +7,7 @@ TEST_MSG=f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0
die() die()
{ {
echo "$0: $@" echo >&2 "$0: $@"
exit 1 exit 1
} }
...@@ -16,7 +16,7 @@ audiowmark_add() ...@@ -16,7 +16,7 @@ audiowmark_add()
if [ "x$Q" == "x1" ]; then if [ "x$Q" == "x1" ]; then
AUDIOWMARK_Q="-q" AUDIOWMARK_Q="-q"
else else
echo ==== audiowmark add "$@" ==== echo >&2 ==== audiowmark add "$@" ====
fi fi
$AUDIOWMARK $AUDIOWMARK_Q --strict add "$@" || die "failed to watermark $@" $AUDIOWMARK $AUDIOWMARK_Q --strict add "$@" || die "failed to watermark $@"
} }
...@@ -27,7 +27,7 @@ audiowmark_cmp() ...@@ -27,7 +27,7 @@ audiowmark_cmp()
AUDIOWMARK_OUT="/dev/null" AUDIOWMARK_OUT="/dev/null"
else else
AUDIOWMARK_OUT="/dev/stdout" AUDIOWMARK_OUT="/dev/stdout"
echo ==== audiowmark cmp "$@" ==== echo >&2 ==== audiowmark cmp "$@" ====
fi fi
$AUDIOWMARK --strict cmp "$@" > $AUDIOWMARK_OUT || die "failed to detect watermark $@" $AUDIOWMARK --strict cmp "$@" > $AUDIOWMARK_OUT || die "failed to detect watermark $@"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment