From ca161d800e8a503d4109cf706c70611f8ecb9d85 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 12 Feb 2026 01:07:31 +0100 Subject: 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 --- src/tests/audio/test_wav_dump.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/tests/audio/test_wav_dump.cc') 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); -- cgit v1.2.3