Merge Phase D4: Design View action family + reapply-on-open wiring
This commit is contained in:
@@ -383,6 +383,30 @@ static void testPlanToggleParkHasEmptyFxOffline() {
|
||||
CHECK(plan.park[0].flags.size() == 4);
|
||||
}
|
||||
|
||||
// -- 8. nextModeId cycle (D4 toggle helper) ----------------------------------
|
||||
|
||||
static void testNextModeIdCycles() {
|
||||
ModeRegistry seeded; // Arrange(0) + Design(1)
|
||||
|
||||
// Two-mode cycle: Arrange -> Design -> Arrange (wraps past the last).
|
||||
CHECK(nextModeId(seeded, kArrangeModeId) == kDesignModeId);
|
||||
CHECK(nextModeId(seeded, kDesignModeId) == kArrangeModeId);
|
||||
|
||||
// Extends to cycle-through-all with >2 modes, in ordinal order.
|
||||
ModeRegistry three;
|
||||
CHECK(three.add(Mode{"mixdown", "Mixdown", 2}));
|
||||
CHECK(nextModeId(three, kArrangeModeId) == kDesignModeId);
|
||||
CHECK(nextModeId(three, kDesignModeId) == "mixdown");
|
||||
CHECK(nextModeId(three, "mixdown") == kArrangeModeId); // wraps
|
||||
|
||||
// Unknown/stale current id -> first mode (a sane home, not "").
|
||||
CHECK(nextModeId(seeded, "does-not-exist") == kArrangeModeId);
|
||||
|
||||
// Empty registry -> "" (nothing to cycle to).
|
||||
ModeRegistry empty = ModeRegistry::makeEmpty();
|
||||
CHECK(nextModeId(empty, kArrangeModeId).empty());
|
||||
}
|
||||
|
||||
int main() {
|
||||
testNModeRegistryAndMembership();
|
||||
testParentDerivationMultiMode();
|
||||
@@ -393,6 +417,7 @@ int main() {
|
||||
testEmptyModelRoundTrip();
|
||||
testMalformedJson();
|
||||
testPlanToggleParkHasEmptyFxOffline();
|
||||
testNextModeIdCycles();
|
||||
|
||||
if (g_fail == 0) std::printf("All tests passed.\n");
|
||||
return g_fail ? 1 : 0;
|
||||
|
||||
Reference in New Issue
Block a user