17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-20 23:23:30 +02:00
Files
maszyna/application/editormodeselftest.h
maj00r 4912199bd1 refactor(editor): the self-test commands in a file per group instead of one file of 4200 lines
editormodeselftest.cpp keeps the dispatch, the list of the commands and the step; the groups go to
editormodeselftest{scene,sleepers,sweep,track,switch,join,signal,terrain,rails}.cpp, the sleeper commands (beams,
sharedzones, sleepersbg, beamsnear, sleepercheck) in a group of their own; the frame count and one_line shared through
editormodeselftest.h. The output of geomhash, sleepercheck, wings, space, guards, crossings and switches is the same on the
seven sceneries of the regression.
2026-10-18 02:18:36 +02:00

34 lines
679 B
C++

/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <algorithm>
#include <cstddef>
#include <string>
// what the groups of the self-test commands share, each group in a file of its own
namespace editor_selftest
{
// frames gone through the selftest, for the measurements of perf
inline std::size_t &frames()
{
static std::size_t count{0};
return count;
}
inline std::string one_line(std::string Text)
{
std::replace(Text.begin(), Text.end(), '\n', ';');
return Text;
}
} // namespace editor_selftest