mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-14 09:06:58 +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:
@@ -45,19 +45,20 @@ test_manager &test()
|
||||
|
||||
std::string_view to_string(test_result const Result)
|
||||
{
|
||||
using enum test_result;
|
||||
switch (Result)
|
||||
{
|
||||
case test_result::pass: return "pass";
|
||||
case test_result::fail: return "fail";
|
||||
case test_result::signal_passed_at_danger: return "signal passed at danger";
|
||||
case test_result::timeout: return "timeout";
|
||||
case test_result::standstill: return "standstill";
|
||||
case test_result::error: return "error";
|
||||
case pass: return "pass";
|
||||
case fail: return "fail";
|
||||
case signal_passed_at_danger: return "signal passed at danger";
|
||||
case timeout: return "timeout";
|
||||
case standstill: return "standstill";
|
||||
case error: return "error";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void test_manager::init_result_cell()
|
||||
void test_manager::init_result_cell() const
|
||||
{
|
||||
auto cell { std::make_unique<TMemCell>(scene::node_data{0, -1, std::string(result_cell), "memcell"}) };
|
||||
// neither of the reported values, so that a cell nobody wrote to says nothing
|
||||
|
||||
Reference in New Issue
Block a user