Γ-W1-T1 review fixes: mode-independent taper rounding, sharper drag-step test, reset-sweep verifies stored fields
Swap nearbyint for std::round (MXCSR-independent); derive the finest-drag test from the editor floor, not the knob; verify resets against fields, not norms; record the spline-point modifier exclusion.
This commit is contained in:
@@ -175,8 +175,11 @@ static void testResetLandsOnTheStoredDefaultOfEachControl() {
|
||||
// EVERY knob resets to its own stored default, not just the six dual-ring pairs above. Swept
|
||||
// over the whole control-id space so a control added later cannot quietly miss the reset table:
|
||||
// perturb, reset, and require the control to read exactly what a fresh PlaySeconds reads.
|
||||
// Compared against the STORED FIELD directly (deckDoubleField/deckFloatField), not the
|
||||
// normalized read-back: deckParamNorm is not guaranteed injective, so a norm match is weaker
|
||||
// than the criterion — verification against a default-constructed PlaySeconds.
|
||||
static void testEveryKnobIdResetsToItsDefault() {
|
||||
const PlaySeconds defaults;
|
||||
PlaySeconds defaults;
|
||||
for (int i = 0; i < static_cast<int>(DeckParam::kCount); ++i) {
|
||||
const DeckParam id = static_cast<DeckParam>(i);
|
||||
if (deckParamUnit(id) == UnitCategory::None) continue; // no reset gesture
|
||||
@@ -184,9 +187,17 @@ static void testEveryKnobIdResetsToItsDefault() {
|
||||
PlaySeconds p;
|
||||
setDeckParam(id, p, 0.37, 0);
|
||||
setDeckParam(id, p, 0.83, 0); // two writes: one of the two is off every default
|
||||
CHECK(deckParamNorm(id, p) != deckParamNorm(id, defaults));
|
||||
resetDeckParam(id, p);
|
||||
CHECK(deckParamNorm(id, p) == deckParamNorm(id, defaults));
|
||||
if (double* pd = deckDoubleField(id, p)) {
|
||||
CHECK(*pd != *deckDoubleField(id, defaults));
|
||||
resetDeckParam(id, p);
|
||||
CHECK(*pd == *deckDoubleField(id, defaults));
|
||||
} else if (float* pf = deckFloatField(id, p)) {
|
||||
CHECK(*pf != *deckFloatField(id, defaults));
|
||||
resetDeckParam(id, p);
|
||||
CHECK(*pf == *deckFloatField(id, defaults));
|
||||
} else {
|
||||
CHECK(false); // every non-None, non-excluded id must own a reset field
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,8 +290,10 @@ static void testAValueStoredUnderTheOldCeilingIsReadNotRewritten() {
|
||||
CHECK(p.adsr.releaseSeconds == 2.0);
|
||||
CHECK(normDecay > 0.0 && normDecay < 1.0); // still on the knob, just at a new angle
|
||||
CHECK(deckParamNorm(DeckParam::kRelease, p) > normDecay);
|
||||
// And it survives the norm the knob would hand back, so a no-op touch of the control does
|
||||
// not quantize a legacy value away.
|
||||
// And a no-op touch survives the norm the knob would hand back — for THIS value, which is
|
||||
// exactly on the taper's output quantum grid (1.75 s parses to a grid-aligned double). A
|
||||
// legacy value off the grid (e.g. 1.2345678912345) WOULD be re-quantized on first touch;
|
||||
// that is correct, intended behaviour, not a gap this test is claiming to cover.
|
||||
setDeckParam(DeckParam::kDecay, p, normDecay, 0);
|
||||
CHECK(p.adsr.decaySeconds == 1.75);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user