Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Refactor presence/absence of requested subsystem mode change validation logic in System Mode Manager using SDL Alternatives instead of multiple un-DRY implementations #16

@chgio

Description

@chgio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRefactoring (architectural and/or behavioural) of an implemented feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions