Test/coverage modulation effects 187#204
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@sudip-mondal-2002 |
|
@sudip-mondal-2002 could you please add the appropriate |
PR Preview RemovedThe GitHub Pages preview for this PR has been removed because the PR was closed. |
|
@raajpatre Please check the conflicts |
|
Closing as AI slop |
What does this PR do?
Adds 20 unit tests across the three LFO-modulated effects — Chorus,
Flanger, and Phaser — pushing line coverage from ~50–59% to 100% on
all three files.
The largest single gap was
process_stereo(), which was completelyuntested in all three effects. Six of the 20 tests target that path
directly. Beyond stereo, the new tests cover parameter edge cases
(Level/Mix = 0 and 1, negative feedback, Depth = 0), reset()
correctness for delay buffers and APF state, and behavioral
verification (e.g. 4 stages vs 12 stages produce different output,
not just finite output).
Chorus (6 tests)
chorus_process_stereo_produces_finite_output— exercises the entire process_stereo() path (was completely untested)chorus_process_stereo_disabled_early_return— covers the if (!enabled_) guard in process_stereochorus_level_zero_passes_input_unchanged— verifies dry passthrough when Level = 0.0chorus_level_one_fully_wet— verifies wet blend when Level = 1.0chorus_reset_clears_delay_and_lfo_phase— confirms delay_buffer_ and lfo_phase_ are both zeroed by reset()chorus_parameters_have_valid_ranges— verifies all 3 params have correct defaults and rangesFlanger (6 tests)
flanger_process_stereo_produces_finite_output— exercises process_stereo() including delay_buffer_r_ and 180° LFO offsetflanger_process_stereo_disabled_early_return— covers the if (!enabled_) guard in process_stereoflanger_negative_feedback_stays_finite— covers the negative feedback range [-0.95, 0.0) which was untestedflanger_negative_feedback_differs_from_positive— confirms negative feedback takes a genuinely different code pathflanger_mix_zero_passes_dry_signal— verifies dry passthrough when Mix = 0.0flanger_reset_clears_both_buffers— confirms both delay_buffer_ and delay_buffer_r_ are zeroed by reset()Phaser (8 tests)
phaser_process_stereo_produces_finite_output— exercises the right-channel APF cascade (apf_xprev_r_, apf_yprev_r_, feedback_state_r_) which was completely untestedphaser_process_stereo_disabled_early_return— covers the if (!enabled_) guard in process_stereophaser_depth_zero_freezes_sweep— verifies Depth=0 freezes fc at 200 Hz regardless of LFO positionphaser_feedback_zero_stays_finite— covers the zero-feedback path (x = dry + 0 * feedback_state_)phaser_feedback_max_stays_finite— verifies 0.95 maximum resonance stays finite under heavy feedbackphaser_mix_zero_passes_dry_signal— verifies dry passthrough when Mix = 0.0phaser_stage_count_affects_output— confirms 4 stages and 12 stages produce meaningfully different output (stronger than the existing finite-only check)phaser_reset_clears_apf_state— confirms all 4 APF arrays and both feedback_state vars are zeroed by reset(), verified by comparing output against a fresh instanceRelated Issue
Fixes #187
Type of Change
How Was This Tested?
./amplitron-testsChecklist
./amplitron-tests)std::mutex::lock()on the hot path)Screenshots / Demo
N/A — test-only change, no UI modifications.