Fix five Wave-1 pure-layer FX/park review findings: resume-point stall, stale doc comments, implicit mode read, keying reset
This commit is contained in:
@@ -102,10 +102,15 @@ static void testEditsTheApplyDidNotDriveAreNotDifferences() {
|
||||
ViewModeModel vm = parkedPair();
|
||||
const AppliedState before = appliedState(vm);
|
||||
|
||||
vm.membership().tag("{OTHER}", kDesignModeId);
|
||||
// {T1} is already parked (tagged Design, active mode Arrange); retagging it
|
||||
// INTO the active mode changes what the next apply must drive (release it)
|
||||
// while its park record — and so the fingerprint — is untouched. Pinning
|
||||
// this on a GUID actually in the parked set is the point: an unrelated GUID
|
||||
// would pass even if membership were folded into the fingerprint by mistake.
|
||||
vm.membership().tag("{T1}", kArrangeModeId);
|
||||
CHECK(appliedState(vm) == before);
|
||||
|
||||
vm.membership().setShowBoth("{OTHER}", true);
|
||||
vm.membership().setShowBoth("{T1}", true);
|
||||
CHECK(appliedState(vm) == before);
|
||||
|
||||
vm.lanes().setManaged("{T1}", "reasampler:design", kDesignModeId);
|
||||
|
||||
+39
-16
@@ -63,7 +63,7 @@ static void testActiveTrackIsOwedOnlineInactiveIsOwedOffline() {
|
||||
vm.storeSnapshot("{P}", recordWithFx({{"{FX-P}", 0}}));
|
||||
|
||||
// Active mode is Arrange: {T} (Design) stays parked, {P} is coming back.
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}", "{P}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kArrangeModeId, {"{T}", "{P}"});
|
||||
CHECK(work.size() == 2);
|
||||
CHECK(workFor(work, "{P}") && workFor(work, "{P}")->kind == FxWorkKind::Online);
|
||||
CHECK(workFor(work, "{T}") && workFor(work, "{T}")->kind == FxWorkKind::Offline);
|
||||
@@ -86,7 +86,7 @@ static void testOnlineWorkSortsBeforeOfflineWork() {
|
||||
vm.storeSnapshot(g, recordWithFx({{"{FX}", 0}}));
|
||||
|
||||
const std::vector<FxTrackWork> work =
|
||||
desiredFxState(vm, {"{A-park}", "{B-park}", "{Y-back}", "{Z-back}"});
|
||||
desiredFxState(vm, kArrangeModeId, {"{A-park}", "{B-park}", "{Y-back}", "{Z-back}"});
|
||||
CHECK(work.size() == 4);
|
||||
// Onlining restores state the user owns and is 2-6x the cost of offlining;
|
||||
// offlining is opportunistic reclaim and may be deferred indefinitely.
|
||||
@@ -97,7 +97,8 @@ static void testOnlineWorkSortsBeforeOfflineWork() {
|
||||
|
||||
// Deterministic: a re-derivation yields the identical list, so a drain's
|
||||
// position in it survives one.
|
||||
CHECK(desiredFxState(vm, {"{A-park}", "{B-park}", "{Y-back}", "{Z-back}"}) == work);
|
||||
CHECK(desiredFxState(vm, kArrangeModeId, {"{A-park}", "{B-park}", "{Y-back}", "{Z-back}"}) ==
|
||||
work);
|
||||
}
|
||||
|
||||
static void testUserOfflinedPluginIsNeverBlanketOnlined() {
|
||||
@@ -106,7 +107,7 @@ static void testUserOfflinedPluginIsNeverBlanketOnlined() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
CHECK(work[0].kind == FxWorkKind::Online);
|
||||
|
||||
@@ -124,14 +125,14 @@ static void testReleasedFxHalfIsOwedNothing() {
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
vm.releaseSnapshotFx("{T}");
|
||||
|
||||
CHECK(desiredFxState(vm, {"{T}"}).empty());
|
||||
CHECK(desiredFxState(vm, kDesignModeId, {"{T}"}).empty());
|
||||
CHECK(fxRestoreTargets(vm, "{T}").empty());
|
||||
|
||||
// ...and the mirror: a record whose FLAG half is spent still owes its FX.
|
||||
ViewModeModel vm2 = parkedWithThreeFx();
|
||||
CHECK(vm2.setActiveMode(kDesignModeId));
|
||||
vm2.releaseSnapshotFlags("{T}");
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm2, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm2, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
CHECK(work.size() == 1 && work[0].targets.size() == 3);
|
||||
}
|
||||
@@ -139,20 +140,20 @@ static void testReleasedFxHalfIsOwedNothing() {
|
||||
static void testDeadAndUnparkedTracksAreOwedNothing() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
// The track is gone from the project: there is nothing to write to.
|
||||
CHECK(desiredFxState(vm, {}).empty());
|
||||
CHECK(desiredFxState(vm, kArrangeModeId, {}).empty());
|
||||
|
||||
// A track with no park record is owed nothing either way — that is also how a
|
||||
// REFUSED park stays refused: it wrote no record, so no reclaim targets it.
|
||||
ViewModeModel bare;
|
||||
bare.membership().tag("{U}", kDesignModeId);
|
||||
CHECK(desiredFxState(bare, {"{U}"}).empty());
|
||||
CHECK(desiredFxState(bare, kArrangeModeId, {"{U}"}).empty());
|
||||
}
|
||||
|
||||
// -- resolveFxWork: against the chain as it stands ----------------------------
|
||||
|
||||
static void testOfflineWorkTargetsEveryLiveSlot() {
|
||||
ViewModeModel vm = parkedWithThreeFx(); // active mode Arrange ⇒ {T} parks
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kArrangeModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -168,7 +169,7 @@ static void testOfflineWorkTargetsEveryLiveSlot() {
|
||||
static void testReorderRestoreLandsEachPluginItsOwnState() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -184,7 +185,7 @@ static void testReorderRestoreLandsEachPluginItsOwnState() {
|
||||
static void testDeletedFxIsDroppedExplicitly() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -200,7 +201,7 @@ static void testDeletedFxIsDroppedExplicitly() {
|
||||
static void testAddedFxIsLeftAlone() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -228,7 +229,7 @@ static void testSlotKeyedRecordStillRestoresByPosition() {
|
||||
CHECK(targets.size() == 3);
|
||||
CHECK(!targets.empty() && targets[0].keying == FxKeying::Slot);
|
||||
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
const std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
const FxRestoreResolution res = resolveFxWork(work[0], {"{FX-X}", "{FX-Y}", "{FX-Z}"});
|
||||
@@ -244,7 +245,7 @@ static void testSlotKeyedRecordStillRestoresByPosition() {
|
||||
static void testResumePointSkipsWhatTheDrainAlreadyDid() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -263,7 +264,7 @@ static void testResumePointSkipsWhatTheDrainAlreadyDid() {
|
||||
static void testResumePointThatLeftTheChainRestartsRatherThanStrands() {
|
||||
ViewModeModel vm = parkedWithThreeFx();
|
||||
CHECK(vm.setActiveMode(kDesignModeId));
|
||||
std::vector<FxTrackWork> work = desiredFxState(vm, {"{T}"});
|
||||
std::vector<FxTrackWork> work = desiredFxState(vm, kDesignModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
@@ -277,7 +278,7 @@ static void testResumePointThatLeftTheChainRestartsRatherThanStrands() {
|
||||
|
||||
// Same rule on the offline side, where the cursor keys into the live chain.
|
||||
ViewModeModel parked = parkedWithThreeFx(); // Arrange active ⇒ {T} parks
|
||||
std::vector<FxTrackWork> offlineWork = desiredFxState(parked, {"{T}"});
|
||||
std::vector<FxTrackWork> offlineWork = desiredFxState(parked, kArrangeModeId, {"{T}"});
|
||||
CHECK(offlineWork.size() == 1);
|
||||
if (offlineWork.empty()) return;
|
||||
offlineWork[0].resumeAfterFxGuid = "{FX-A}";
|
||||
@@ -286,6 +287,27 @@ static void testResumePointThatLeftTheChainRestartsRatherThanStrands() {
|
||||
CHECK(resolveFxWork(offlineWork[0], {"{FX-A}", "{FX-B}", "{FX-C}"}).writes.size() == 3);
|
||||
}
|
||||
|
||||
static void testResumeAfterUnidentifiedFxMakesForwardProgress() {
|
||||
// The drain completed slot 1, an FX REAPER reports no GUID for. Before the
|
||||
// slot-cursor fix, an empty resumeAfterFxGuid was indistinguishable from
|
||||
// "nothing done yet" and this item would restart at slot 0 every tick,
|
||||
// forever — the non-terminating drain this test pins against.
|
||||
ViewModeModel parked = parkedWithThreeFx(); // Arrange active ⇒ {T} parks (Offline, slot-keyed)
|
||||
std::vector<FxTrackWork> work = desiredFxState(parked, kArrangeModeId, {"{T}"});
|
||||
CHECK(work.size() == 1);
|
||||
if (work.empty()) return;
|
||||
|
||||
work[0].resumeAfterFxGuid = "";
|
||||
work[0].resumeAfterSlot = 1;
|
||||
const FxRestoreResolution res =
|
||||
resolveFxWork(work[0], {"{FX-A}", "", "{FX-B}", "{FX-C}"});
|
||||
CHECK(res.writes.size() == 2); // slots 2 and 3 only — 0 and 1 already done
|
||||
CHECK(!anyWriteAt(res, 0));
|
||||
CHECK(!anyWriteAt(res, 1));
|
||||
CHECK(anyWriteAt(res, 2));
|
||||
CHECK(anyWriteAt(res, 3));
|
||||
}
|
||||
|
||||
int main() {
|
||||
testActiveTrackIsOwedOnlineInactiveIsOwedOffline();
|
||||
testOnlineWorkSortsBeforeOfflineWork();
|
||||
@@ -301,6 +323,7 @@ int main() {
|
||||
|
||||
testResumePointSkipsWhatTheDrainAlreadyDid();
|
||||
testResumePointThatLeftTheChainRestartsRatherThanStrands();
|
||||
testResumeAfterUnidentifiedFxMakesForwardProgress();
|
||||
|
||||
if (g_fail == 0) std::printf("All tests passed.\n");
|
||||
return g_fail ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user