mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-30 09:40:29 +01:00
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.
This commit is contained in:
33
application/editormodeselftest.h
Normal file
33
application/editormodeselftest.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
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
|
||||
Reference in New Issue
Block a user