18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 03:54:57 +01:00

refactor(simulation): fix the Sonar remarks on the test mode code

- TController::TableCheck() calls TSpeedPos::Update() as it did before the
  test mode: the check for a signal passed at danger is a call of its own
  after it (CheckSignalPassedAtDanger), so the update lines nest no deeper
  than on master (S134). A switch is a track, so a signal's update never
  takes the switch-change branch and the check runs in the same place as
  before; the physicslogs of all 15 scenario cases are byte for byte the
  same.
- null_imgui_renderer is final (S1235), to_string(test_result) uses
  `using enum` (S6177), init_result_cell() is const (S5817),
  ConfigParseTest() takes a std::string_view (S6009) and the test settings
  struct is declared apart from its member (S3646).
This commit is contained in:
jerrrrycho
2026-11-08 09:35:59 +01:00
parent 6ccf4b14bf
commit 547706b54d
7 changed files with 31 additions and 27 deletions

View File

@@ -95,7 +95,8 @@ struct global_settings {
bool fail_if_stop_overran{ true }; // a train passing a signal at stop ends the test as failed; with false it's only logged
bool no_movement_before_pass{ true }; // a pass waits until every vehicle stands still; with false it ends the test at once
bool timeout_from_command_line{ false }; // --test-timeout given, the scenery doesn't override it
} test;
};
test_settings test;
bool editor_tracks{ false }; // F3 track workspace: draw and pick tracks without the scenery draw-range cap
int iConvertModels{ 0 }; // tworzenie plików binarnych
int iConvertIndexRange{ 1000 }; // range of duplicate vertex scan
@@ -387,7 +388,7 @@ struct global_settings {
bool ConfigParseNetwork(cParser& Parser, const std::string& token);
bool ConfigParseHardware(cParser& Parser, const std::string& token);
bool ConfigParseDebug(cParser& Parser, const std::string& token);
bool ConfigParseTest(cParser& Parser, const std::string& token);
bool ConfigParseTest(cParser& Parser, std::string_view Token);
bool ConfigParse_gfx( cParser &parser, std::string_view const Token );
// sends basic content of the class in legacy (text) format to provided stream
void