summaryrefslogtreecommitdiff
path: root/src/tests/audio
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-12 01:07:31 +0100
committerskal <pascal.massimino@gmail.com>2026-02-12 01:07:31 +0100
commitca161d800e8a503d4109cf706c70611f8ecb9d85 (patch)
treeffa74ed41ce335466f56684456a8ac3805a5118d /src/tests/audio
parent1b6f3a1273dd7552098d0e634b85ed16e72aabfe (diff)
fix: WAV dump header corruption and early exit handling
- wav_dump_backend: Fix data_size double-counting channels (line 126) - test_wav_dump: Assert on data_size validation instead of warning - main: Add SIGINT/SIGTERM handlers to finalize WAV on Ctrl+C - Guard signal handler code with DEMO_HEADLESS ifdef Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/tests/audio')
-rw-r--r--src/tests/audio/test_wav_dump.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tests/audio/test_wav_dump.cc b/src/tests/audio/test_wav_dump.cc
index eb14652..85b168d 100644
--- a/src/tests/audio/test_wav_dump.cc
+++ b/src/tests/audio/test_wav_dump.cc
@@ -134,12 +134,8 @@ void test_wav_format_matches_live_audio() {
const uint32_t expected_min_size = expected_bytes_per_sec * 1.5;
const uint32_t expected_max_size = expected_bytes_per_sec * 2.5;
- // For now, accept if stereo format is correct (main regression test goal)
- if (header.data_size < expected_min_size ||
- header.data_size > expected_max_size) {
- printf(" WARNING: Data size outside expected range\n");
- // Don't fail on this for now - stereo format is the critical check
- }
+ assert(header.data_size >= expected_min_size);
+ assert(header.data_size <= expected_max_size);
// Verify file contains actual audio data (not all zeros)
fseek(f, sizeof(WavHeader), SEEK_SET);