The system_mode_manager component currently has two implementations:
default, where the requested mode change transition for each subsystem is validated (based on its current and target modes, and the relevant model FSM), and only requested if valid;
test_subsystem_mode_change_validation, where the requested mode change transition is not validated for any subsystem.
The second implementation was created to test that all copies of the subsystem mode change transition validation logic, distributed into each subsystem mode tracker for redundancy, are correct.
However, this is a smelly solution: as revealed in @xszymonzur's work towards #13, any change to any other logic in the component must be duplicated manually in both implementations.
A better approach would be to use the SDL Alternative (compilation option) symbol to include both options (validating and non-validating) and select which one to compile through a simple flag -- probably in the form of a Context Parameter to the component.
Then, separate test runs can be done with the alternative flag set and unset to check both options.
The
system_mode_managercomponent currently has two implementations:default, where the requested mode change transition for each subsystem is validated (based on its current and target modes, and the relevant model FSM), and only requested if valid;test_subsystem_mode_change_validation, where the requested mode change transition is not validated for any subsystem.The second implementation was created to test that all copies of the subsystem mode change transition validation logic, distributed into each subsystem mode tracker for redundancy, are correct.
However, this is a smelly solution: as revealed in @xszymonzur's work towards #13, any change to any other logic in the component must be duplicated manually in both implementations.
A better approach would be to use the SDL Alternative (compilation option) symbol to include both options (validating and non-validating) and select which one to compile through a simple flag -- probably in the form of a Context Parameter to the component.
Then, separate test runs can be done with the alternative flag set and unset to check both options.