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
......@@ -10,3 +10,6 @@ block-decoder-test:
clip-decoder-test:
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
die()
{
echo "$0: $@"
echo >&2 "$0: $@"
exit 1
}
......@@ -16,7 +16,7 @@ audiowmark_add()
if [ "x$Q" == "x1" ]; then
AUDIOWMARK_Q="-q"
else
echo ==== audiowmark add "$@" ====
echo >&2 ==== audiowmark add "$@" ====
fi
$AUDIOWMARK $AUDIOWMARK_Q --strict add "$@" || die "failed to watermark $@"
}
......@@ -27,7 +27,7 @@ audiowmark_cmp()
AUDIOWMARK_OUT="/dev/null"
else
AUDIOWMARK_OUT="/dev/stdout"
echo ==== audiowmark cmp "$@" ====
echo >&2 ==== audiowmark cmp "$@" ====
fi
$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