This commit is contained in:
Aiden
2026-05-11 19:09:01 +10:00
parent 718e4dcadd
commit fdcc38c6ae
7 changed files with 64 additions and 10 deletions

View File

@@ -311,8 +311,18 @@ void TestRuntimeCoordinatorPersistenceEvents()
Expect(countEvents(overlayEvents, RuntimeEventType::OscOverlayApplied) == 1, "transient OSC overlay is observable");
Expect(countEvents(overlayEvents, RuntimeEventType::RuntimePersistenceRequested) == 0, "transient OSC overlay does not request persistence");
expectAcceptedPersistence(coordinator.CommitOscParameterByControlKey("alpha", "gain", JsonValue(0.2)), "CommitOscParameterByControlKey",
"accepted OSC commit is persistent");
RuntimeCoordinatorResult oscCommitResult = coordinator.CommitOscParameterByControlKey("alpha", "gain", JsonValue(0.2));
std::vector<RuntimeEvent> oscCommitEvents = dispatchAndClear();
Expect(oscCommitResult.accepted, "accepted OSC commit updates committed session state");
Expect(!oscCommitResult.persistenceRequested, "settled OSC commit does not request persistence by default");
Expect(countEvents(oscCommitEvents, RuntimeEventType::RuntimeMutationAccepted) == 1, "settled OSC commit publishes accepted fact");
Expect(countEvents(oscCommitEvents, RuntimeEventType::RuntimeStateChanged) == 1, "settled OSC commit publishes state change");
Expect(countEvents(oscCommitEvents, RuntimeEventType::RuntimePersistenceRequested) == 0, "settled OSC commit publishes no persistence request");
RuntimeStore::StoredParameterSnapshot oscCommitSnapshot;
Expect(store.TryGetStoredParameterByControlKey("alpha", "gain", oscCommitSnapshot, error), "settled OSC commit can be read back");
Expect(!oscCommitSnapshot.currentValue.numberValues.empty() &&
oscCommitSnapshot.currentValue.numberValues[0] == 0.2,
"settled OSC commit updates the committed session value");
}
std::filesystem::remove_all(root);