Commit 89afd8ff authored by Stefan Westerfeld's avatar Stefan Westerfeld

TESTS: add test for audiowmark --key and --test-key

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 36bc4da8
check: detect-speed-test block-decoder-test clip-decoder-test \
pipe-test short-payload-test sync-test sample-rate-test
pipe-test short-payload-test sync-test sample-rate-test \
key-test
EXTRA_DIST = detect-speed-test.sh block-decoder-test.sh clip-decoder-test.sh \
pipe-test.sh short-payload-test.sh sync-test.sh sample-rate-test.sh
pipe-test.sh short-payload-test.sh sync-test.sh sample-rate-test.sh \
key-test.sh
detect-speed-test:
Q=1 $(top_srcdir)/tests/detect-speed-test.sh
......@@ -24,3 +26,6 @@ sync-test:
sample-rate-test:
Q=1 $(top_srcdir)/tests/sample-rate-test.sh
key-test:
Q=1 $(top_srcdir)/tests/key-test.sh
#!/bin/bash
source test-common.sh
IN_WAV=key-test.wav
KEY1=key-test-1.key
KEY2=key-test-2.key
OUT1_WAV=key-test-out1.wav
OUT2_WAV=key-test-out2.wav
TEST_MSG2=0123456789abcdef0123456789abcdef
audiowmark test-gen-noise $IN_WAV 30 44100
audiowmark gen-key $KEY1
audiowmark gen-key $KEY2
audiowmark_add --key $KEY1 $IN_WAV $OUT1_WAV $TEST_MSG
audiowmark_add --key $KEY2 $IN_WAV $OUT2_WAV $TEST_MSG2
# shouldn't be able to detect watermark without correct key
audiowmark_cmp --key $KEY1 --expect-matches 1 $OUT1_WAV $TEST_MSG
audiowmark_cmp --key $KEY2 --expect-matches 0 $OUT1_WAV $TEST_MSG
audiowmark_cmp --expect-matches 0 $OUT1_WAV $TEST_MSG
audiowmark_cmp --key $KEY2 --expect-matches 1 $OUT2_WAV $TEST_MSG2
audiowmark_cmp --key $KEY1 --expect-matches 0 $OUT2_WAV $TEST_MSG2
audiowmark_cmp --expect-matches 0 $OUT2_WAV $TEST_MSG2
rm $OUT1_WAV $OUT2_WAV
# double watermark with two different keys
audiowmark_add $IN_WAV $OUT1_WAV $TEST_MSG
audiowmark_add --test-key 42 $OUT1_WAV $OUT2_WAV $TEST_MSG2
audiowmark_cmp --expect-matches 1 $OUT2_WAV $TEST_MSG
audiowmark_cmp --test-key 42 --expect-matches 1 $OUT2_WAV $TEST_MSG2
rm $IN_WAV $KEY1 $KEY2 $OUT1_WAV $OUT2_WAV
exit 0
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