| 86 | // ── Tests ────────────────────────────────────────────────────────────── |
| 87 | |
| 88 | void testBypass() |
| 89 | { |
| 90 | ClientDeEss d; |
| 91 | d.prepare(kSampleRate); |
| 92 | d.setEnabled(false); |
| 93 | |
| 94 | const int frames = 1024; |
| 95 | auto ref = makeTone(5000.0, frames, dbToLin(-6.0f)); |
| 96 | auto out = ref; |
| 97 | processBlocks(d, out.data(), frames); |
| 98 | |
| 99 | float maxDiff = 0.0f; |
| 100 | for (size_t i = 0; i < out.size(); ++i) |
| 101 | maxDiff = std::max(maxDiff, std::fabs(out[i] - ref[i])); |
| 102 | |
| 103 | report("bypass: disabled passes through unchanged", |
| 104 | maxDiff < 1e-6f, |
| 105 | "maxDiff=" + std::to_string(maxDiff)); |
| 106 | } |
| 107 | |
| 108 | // Low-frequency signal (below the sidechain band) should NOT trigger |
| 109 | // attenuation even at loud levels. |
no test coverage detected