Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
0bf3f82d
Commit
0bf3f82d
authored
Jun 04, 2024
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TESTS: check snr in wav pipe test to catch conversion errors
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
1b69d744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
test-common.sh.in
tests/test-common.sh.in
+11
-2
wav-pipe-test.sh
tests/wav-pipe-test.sh
+6
-3
No files found.
tests/test-common.sh.in
View file @
0bf3f82d
...
...
@@ -44,9 +44,18 @@ audiowmark_cmp()
check_length()
{
local in1=
$(audiowmark test-info $1 frames) || die "error detecting length of $1
"
local in2=
$(audiowmark test-info $2 frames) || die "error detecting length of $2
"
local in1=
"$($AUDIOWMARK test-info $1 frames)
"
local in2=
"$($AUDIOWMARK test-info $2 frames)
"
[ "x$in1" != "x" ] || die "length of '$1' could not be detected"
[ "x$in1" == "x$in2" ] || die "length of '$1' ($in1) and '$2' ($in2) differs"
}
check_snr()
{
local snr="$($AUDIOWMARK test-snr $1 $2)"
echo >&2 "==== snr of $1 and $2 is $snr (expected $3) ===="
[ "x$snr" != "x" ] || die "snr of '$1' and '$2' could not be detected"
[ "x$3" != "x" ] || die "need snr bound"
awk "BEGIN {exit !($snr >= $3)}" || die "snr of '$1' and '$2' is worse than $3"
}
tests/wav-pipe-test.sh
View file @
0bf3f82d
...
...
@@ -13,13 +13,16 @@ do
[
"x
$BITS
"
==
"x
$(
audiowmark test-info
$IN_WAV
bit_depth
)
"
]
||
die
"generated input bit depth is not correct"
cat
$IN_WAV
| audiowmark_add
--test-key
1
--format
wav-pipe - -
$TEST_MSG
>
$OUT1_WAV
||
die
"watermark from pipe failed"
cat
$OUT1_WAV
| audiowmark_add
--test-key
2
--format
wav-pipe - -
$TEST_MSG
>
$OUT2_WAV
||
die
"watermark from pipe failed"
cat
$OUT2_WAV
| audiowmark_add
--test-key
3
--format
wav-pipe - -
$TEST_MSG
>
$OUT3_WAV
||
die
"watermark from pipe failed"
cat
$IN_WAV
| audiowmark_add
--test-key
1
--
test-no-limiter
--
format
wav-pipe - -
$TEST_MSG
>
$OUT1_WAV
||
die
"watermark from pipe failed"
cat
$OUT1_WAV
| audiowmark_add
--test-key
2
--
test-no-limiter
--
format
wav-pipe - -
$TEST_MSG
>
$OUT2_WAV
||
die
"watermark from pipe failed"
cat
$OUT2_WAV
| audiowmark_add
--test-key
3
--
test-no-limiter
--
format
wav-pipe - -
$TEST_MSG
>
$OUT3_WAV
||
die
"watermark from pipe failed"
check_length
$IN_WAV
$OUT1_WAV
check_length
$IN_WAV
$OUT2_WAV
check_length
$IN_WAV
$OUT3_WAV
check_snr
$IN_WAV
$OUT1_WAV
32
check_snr
$IN_WAV
$OUT2_WAV
29
check_snr
$IN_WAV
$OUT3_WAV
27
audiowmark_cmp
--expect-matches
0
$OUT3_WAV
$TEST_MSG
audiowmark_cmp
--expect-matches
5
--test-key
1
$OUT3_WAV
$TEST_MSG
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment