Ψ-W1-T2 review remediation: solo restore drops on visible-in-target, not parked; N-mode segments read dead when unroutable
Fixes a hidden-parent solo replay that could silence the mix. Also closes the N-mode segment silent no-op, amends the invariant comment, trims view.cpp under 600 lines, hedges two SDK inferences, drops a dead null-check.
This commit is contained in:
@@ -231,20 +231,32 @@ static void testResizeSweepNoOverlap() {
|
||||
// --- Mode-segment enablement (the playback gate's visible half) ---------------
|
||||
|
||||
static void testModeSegmentsAreLiveWithTheTransportStopped() {
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/false, /*transportRunning=*/false));
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/true, /*transportRunning=*/false));
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/false, /*transportRunning=*/false, /*routable=*/true));
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/true, /*transportRunning=*/false, /*routable=*/true));
|
||||
}
|
||||
|
||||
static void testInactiveSegmentGoesDeadWhileTheTransportRuns() {
|
||||
// The one that would fire a real switch — refused while playing/recording, so it
|
||||
// must read dead rather than invite a click that silently does nothing.
|
||||
CHECK(!modeSegmentEnabled(/*isActiveSegment=*/false, /*transportRunning=*/true));
|
||||
CHECK(!modeSegmentEnabled(/*isActiveSegment=*/false, /*transportRunning=*/true, /*routable=*/true));
|
||||
}
|
||||
|
||||
static void testActiveSegmentStaysLiveWhileTheTransportRuns() {
|
||||
// Clicking the mode you are already in is a reapply, which is never gated;
|
||||
// dimming it would read as "this mode is unavailable".
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/true, /*transportRunning=*/true));
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/true, /*transportRunning=*/true, /*routable=*/false));
|
||||
}
|
||||
|
||||
static void testInactiveSegmentGoesDeadWhenUnroutable() {
|
||||
// A third registered mode with no seeded command id (the model is N-mode, the UI
|
||||
// ships two ids) must read dead, not live-but-silently-inert on click.
|
||||
CHECK(!modeSegmentEnabled(/*isActiveSegment=*/false, /*transportRunning=*/false, /*routable=*/false));
|
||||
}
|
||||
|
||||
static void testActiveSegmentStaysLiveEvenWhenUnroutable() {
|
||||
// The active segment always fires a reapply through its own already-resolved id in
|
||||
// practice, but the predicate's active bypass does not consult routable either way.
|
||||
CHECK(modeSegmentEnabled(/*isActiveSegment=*/true, /*transportRunning=*/false, /*routable=*/false));
|
||||
}
|
||||
|
||||
int main() {
|
||||
@@ -263,6 +275,8 @@ int main() {
|
||||
testModeSegmentsAreLiveWithTheTransportStopped();
|
||||
testInactiveSegmentGoesDeadWhileTheTransportRuns();
|
||||
testActiveSegmentStaysLiveWhileTheTransportRuns();
|
||||
testInactiveSegmentGoesDeadWhenUnroutable();
|
||||
testActiveSegmentStaysLiveEvenWhenUnroutable();
|
||||
|
||||
if (g_fail == 0) std::printf("footer_bar: all tests passed\n");
|
||||
else std::printf("footer_bar: %d CHECK(s) FAILED\n", g_fail);
|
||||
|
||||
Reference in New Issue
Block a user