test: tighten waveform-collapse and knob-face rect assertions

Height-3 case pins the halfSpan clamp itself (height-4 passed pre-fix too); dropped the vacuous tall-rect mirror since min() is symmetric and wide already discriminates.
This commit is contained in:
2026-08-01 10:07:47 -04:00
parent 47f2a063e7
commit d445cfdae3
2 changed files with 8 additions and 7 deletions
+6 -1
View File
@@ -265,9 +265,14 @@ static void testDegenerateBandClampsHalfSpanToZero() {
CHECK(waveformBand(0, 3).halfSpan == 0.0);
CHECK(waveformBand(0, 0).halfSpan == 0.0);
// A zero half-span collapses every column onto the zero line regardless of amplitude sign.
const WaveformBand b = waveformBand(10, 4);
// height 3 (not 4): pre-clamp this rawHalfSpan is -1, so this is the case that pins the
// clamp itself, not just a halfSpan-already-zero band.
const WaveformBand b = waveformBand(10, 3);
const WaveformColumnSpan s = waveformColumnSpan(b, 1.0, -1.0);
CHECK(s.top == b.midY && s.bottom == b.midY);
// Domain note, not a bug: waveformBand(t, 0) still has lo=t, hi=t-1 (an inverted span) even
// though halfSpan clamps to 0 — unreachable via the band allocator (draw_kit.cpp never
// divides down to a 0-height band) and harmless if it were (LICE clips a reversed 1px line).
}
int main() {