fix(rms_vad): correct types and threshold order in flush idempotency test
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

Two issues in flush_is_idempotent_and_leaves_clean_state from
581a098:

1. silence_close_samples and max_chunk_samples were cast `as u64`
   but with_thresholds takes usize — wouldn't compile.
2. enter_threshold was 0.005 and exit_threshold 0.01, which
   violates the hysteresis invariant (enter must be >= exit) and
   panics in debug_assert at runtime. Swap to 0.01 / 0.005 so the
   test actually runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-25 19:22:22 +01:00
parent 73f8c45f86
commit 150059e174

View File

@@ -700,11 +700,11 @@ mod tests {
// silence emits nothing (i.e. no stale onset / silent_tail
// bookkeeping leaks into the next feed).
let mut c = RmsVadChunker::with_thresholds(
0.005,
0.01,
0.005,
DEFAULT_SPEECH_ONSET_FRAMES,
(FRAME_SAMPLES * 4) as u64,
(FRAME_SAMPLES * 50) as u64,
FRAME_SAMPLES * 4,
FRAME_SAMPLES * 50,
);
let speech = constant_signal(FRAME_SAMPLES * 6, 0.02);