The analyser loses track of references captured by lambdas; the St113 EP and MHZ buttons tests call plain helpers, as ep_brake() and ready_knorr_ep() do, which it doesn't report.
main() tells a test run (--test) apart before anything runs. Only a test run
catches every exception and installs a std::terminate handler, both ending the
run with the error code and a test: line; any other run keeps master's
exception handling, so on Linux an uncaught runtime_error aborts at the throw
site again.
A test run doesn't start the Discord RPC thread: it published the test
scenery as the player's presence and held the closing up to 5 s.
run.py drops a case scenery's .sbt cache after a run cut short (wall_timeout,
error, a crash, killed by run.py), which could have been writing it.
The -edit branch of the test command line parser had no effect (a token that
isn't an option is ignored either way) and is gone; its test checks what can
be seen instead.
dizel_Momentum() relayed MainSwitch 0 to the consist every frame while the engine stood still, whatever stopped it. In a train with mixed JointEngineStart flags an engine stopped from mainb_off stopped the engines behind it once it spun down, and the stopped engine of the cab's vehicle knocked out the one started from mainb_on. The stop is now relayed only when the engine stalls while running, as on master an engine stalling in a joint start still stops the others.
The lambdas of the St113 EP brake and the MHZ buttons tests called the mover through test::vehicle::operator->(), which the analyser takes as possibly null; they capture a reference from mover() instead.
The three-state door closure lamp is switched on by DoorClosureSignal=Yes in the
Doors: section of the .fiz of the vehicle whose cab shows the lamp (the occupied
vehicle), off by default: without it the lamp keeps showing the lock of the
vehicle's own doors. The eu07.ini switch doorclosuresignal is gone, the data
decides. Sets whose cars lack DoorNeedPermit would blink at every standstill, so
only the sets with permits get the key.
- initialise the cooling power read from the .fiz to its default, no division by an indeterminate value
- integer step counters in the engine start tests
- main_sw opening the consist turns the two-state mainb_sw / mainc_sw off too, left on they'd start the engines again
- the doc comment of MainCircuitOpensWithStarterOnly() back on it; the .fiz read is the controlled vehicle's
- tests: REQUIRE the brake handle before dereferencing it (Sonar cpp:S2259)
- TESt::FillBrakeRes is const (S5817)
- cab EP brake command: drop the mvControlled->EpFuse check, SwitchEPBrake
already checks the cab car's (mvOccupied) EP fuse with the control supply
- AI: with the handle already at the EP brake position, switch the EP brake
on again once the control supply is back
* feat: 401da oil pump lamp and slotted lever animation (eu07/maszyna#546)
i-oilpump lights while the pre-lubrication oil pump works, so it goes
off once the engine runs. animslottedlever: in the .mmd turns a lever
by a pin on the coupling rod sliding in the lever's slot, which the
speedometer drive of 401Da needs.
The compressor start delay of #546 came with CompressorStartDelay
(Brake section) of master.
* fix: force GLM AVX2 only when the compiler targets AVX2
ENABLE_AVX2=OFF left GLM_FORCE_AVX2 defined, so MSVC still emitted
AVX2 intrinsics and the exe crashed on CPUs without AVX2.
* test: cover the compressor start delay and the oil pump lamp
The delay of an engine stopped before it passed starts over, a
compressor switched on by hand waits too, and the key is read from the
Brake section. In the converter-fed set-up of 401Da the compressor
waits for ConverterStartDelay and then its own delay. The oil pump
(i-oilpump lamp) works before the engine start and stops once the
engine runs.
The EP05's single two-state line breaker lever stayed on once the converter
overload relay knocked the breaker out: every press of the toggle tried to
close the open breaker, which the tripped relay refused. A press now puts
a lever left on over an open breaker off first.
(eu07/maszyna#394)
Both waited for every vehicle of the scenery to stand still, so on a scenery
with AI traffic a test could pass only when the traffic happened to stand too,
and the standstill end hardly ever came.
A test scenery names the train under test with test.vehicle <name> in its
config block (once for each train, if several): the pass and the standstill wait
for the consists of these vehicles as they are at the moment, so a train the
tested one couples to counts with it. A name the scenery doesn't have ends the
test with the error code. Without test.vehicle every vehicle counts, as before.
A signal passed at danger counts for every train either way.
run.py puts the case's lead vehicle into test.vehicle. test_mode_standstill_traffic
has the train under test standing on track 2 of Stacja1 while AI traffic leaves
track 1 on the timetable: it ends on its 100 s standstill, where counting every
vehicle runs into the 300 s timeout. Physicslogs of the other trains of a case
(<something>_<vehicle>) are moved out of the game dir too.
A test run that hung, in the loading or anywhere else, waited until whoever
started it killed it. A watchdog thread now ends a run still going test.wall_timeout
seconds of real time after the start of the simulator, loading included: it says
`test: timeout ... still running after N s of real time` and quits with the
timeout code, whatever the main thread is doing, with no dialog. A test that has
ended but whose simulator doesn't close ends with its own result.
The limit is test.wall_timeout (settings, the scenery's config block) or
--test-wall-timeout, which wins. Not given, it is test.timeout + 600 s: ten
minutes for the loading, and a simulation that runs at least as fast as real
time is never cut short. test.timeout 0 means no watchdog unless the limit is
given; test.wall_timeout 0 turns it off.
run.py passes the case's timeout as --test-wall-timeout and kills a simulator
only 30 s after it. A timeout from the watchdog counts as wall_timeout there, so
a run that hung doesn't pass a case expecting the simulation time to run out;
test_mode_wall_timeout ends while loading on a limit of 2 s.
The log was printed in colour to stdout too (debuglog bit 2), so a script reading
the verdict of a test got the whole log with it. In test mode the log goes to the
log file only and stdout has the `test: ...` line alone; the usage text of a bad
command line goes to stderr. Whether the run is a test is now known before the
log service starts.
The config block of a scenery is read like the settings files, after the test
mode settings were applied, so a scenery with soundenabled, multiplayer,
execonexit, feedbackmode or the like in it got them back in a test run. The test
mode settings now are applied again after each config block of the scenery;
apply_test_mode_settings() moved to simulationtest.cpp for that.
The simulator reads eu07.ini from %APPDATA%/MaSzyna (~/.config/MaSzyna on Linux)
when there is one, in place of the game folder's. A test run then depended on
whose machine it ran on. With --test only the game folder's eu07.ini is read,
then the files given with -ini. The test mode options are taken from the command
line before the settings for that; --test-timeout still wins over test.timeout
of any settings file.
1 is what a process killed with TerminateProcess (and the plain failure of most
programs) ends with, 3 what abort() ends with on Windows, so a fail or a timeout
couldn't be told from a run that was killed or blew up. The codes other than
pass now are 10 fail, 11 signal passed at danger, 12 timeout, 13 standstill and
14 error: none of them a code a process gets on its own, neither the shells'
126-127 nor 128 + a signal number on Linux. pass stays 0.
The command line options of the test mode and the end conditions checked after
each frame are now plain functions in simulation/simulationtestrules.cpp, which
needs nothing of the running simulation: parse_test_command_line() and
evaluate_frame(). The file is part of the core library, so the unit tests check
them (tests/unit/test_test_mode.cpp): the --test-timeout value, values of other
options not taken for options, a pass that waits for the stop, the standstill,
the timeout. test_manager only gathers what a frame brought and acts on the
verdict. No change in behaviour.
Przystanek on td.scn is a technical stop of the td/rozklad timetable (pt): the AI
doesn't wait there for the departure time but sets off as soon as it counts the
train as standing at the W4, below 1 km/h. How long the speed then stays under
0.5 km/h is only how fast the brake releases. With the AI braking of #264 the
trains creep up to the W4 at about 10 km/h on a light application and stood there
for 1-5 s; the SN61 turns back at 0.36 km/h without stopping. The hold of 5 s
(2 s for the SN61) failed for EP09, SN61 and Vectron and had well under a second
to spare for others.
The cases now check that the train comes down to 1 km/h, the AI's own standstill
at a W4, 1380-1420 m from the start; every vehicle stops at 1397-1401 m, before
and after #264. `stops` takes min_distance and max_distance for that.
- what the test mode turns off towards the outside (feedbackmode,
multiplayer, execonexit, showsystemconsole, imgui.ini),
- a command line it can't take or a failed start ends with `error`,
- cmd and PowerShell don't wait for the (windowed) simulator nor show its
output: start /wait, Start-Process -Wait,
- 15 cases, not 14.
In vehicles like the ST43, the SP32 or the SN61 every engine of a train in
multiple has its own start and stop buttons in the cab. Until now the cab's
line breaker / engine start switch (main_sw, main_on_bt, main_off_bt) always
started and stopped the engines of all the vehicles under its control.
- .fiz, Engine: JointEngineStart=Yes|No (default Yes, as before). With No
the cab's main_* work the cab's own vehicle only, and an engine stopping on
its own (stalled, out of fuel) stops only its own vehicle instead of every
engine in the train.
- .mmd: mainb_sw, mainb_on_bt, mainb_off_bt work the second vehicle with an
engine under the cab's control, mainc_sw, mainc_on_bt, mainc_off_bt the
third one. They count along the control cable from the cab's vehicle,
behind the cab first. Like main_*, the start switch has to be held for the
vehicle's IniCDelay with the vehicle ready (MainSwitchCheck); an impulse
switch of an electric locomotive with series motors closes on release.
- New commands, added at the end of the command list: linebreakertoggleb,
linebreakeropenb, linebreakercloseb, linebreakertogglec, linebreakeropenc,
linebreakerclosec. No default keys.
- The logic is in vehicle/enginestart.{h,cpp} (core library), tested in
tests/unit/test_engine_start.cpp.
Nothing changes for existing vehicles: the new key and the new cab controls
are optional, and without them the code does what it did before.
Game data (SVN, not changed here, to be done separately; the code works
without it): for the SN61 (dynamic/pkp/sn61_v2), whose cab models already
have the buttons start02/stop02/start03/stop03,
- sn61.fiz, sn61-86.fiz, sn61_v1.fiz and the other SN61 .fiz: add
JointEngineStart=No to the Engine: line;
- sn61.mmd.inc (and the other SN61 includes): after main_on_bt add
mainb_off_bt: { stop02 mov -0.005 0 0.1 ... }
mainb_on_bt: { start02 mov -0.005 0 0.1 ... }
mainc_off_bt: { stop03 mov -0.005 0 0.1 ... }
mainc_on_bt: { start03 mov -0.005 0 0.1 ... }
with the sounds of main_off_bt / main_on_bt.
The tooltips "line breaker B" / "line breaker C" are new strings for lang/*.po.
The door wings are in the main model, where the door animation finds them, so seen from inside the
vehicle they are lit like the exterior and ignore the compartment lights. A door panel put into the low
poly interior instead stayed closed, since nothing moved it.
A door wing animation now also picks up the submodel of the same name in the low poly interior, if it
has one, and gives it the same pose (shift, rotate, fold with its child wings, plug). Placed under a
compartment section, such a wing is lit with the section and follows its light switch.
The pose maths moved unchanged to vehicle/doorwings.h, with unit tests.
Assets: optional. No low poly interior in the SVN or in the Steam install has a submodel named like a
door wing, so nothing changes for existing vehicles. To use it, a low poly interior gets the inside of
each door wing as a submodel named like the wing in the main model (door1, door01, drzwi1, ...), with
the same pivot and transform, under the compartment section it belongs to, with a SelfIllum threshold
like the section's, and slightly inside the wing of the main model.
eu07/maszyna#87: the EP2 (and EP1) valve charged its auxiliary reservoir only
from the main reservoir pipe. A dead EN57 hauled by a locomotive coupled with
the hook and the brake hose alone ("3") never charged it, its control
reservoir stopped at about 2.5 bar and the unit didn't brake. The valve now
refills the auxiliary reservoir from the brake pipe through the slide valve's
check valve, as every ESt does (TESt::FillBrakeRes, shared with TESt::GetPF,
which stays bit for bit the same). With the main reservoir pipe charged the
auxiliary reservoir stays above the brake pipe and nothing changes; the
reservoir now also takes air from the brake pipe while it is below it, e.g.
at start-up before the compressor has charged the main reservoir pipe.
eu07/maszyna#134: the EP brake of the Knorr St113 handle (EN57-001) worked
with the reverser in neutral, the battery off or the EP fuse switched off
(Ctrl+Z). It now needs the control powered, as the Oerlikon handle's does
(EPBrakeControlPowered: battery, reverser out of neutral, EP fuse), and an
EP brake switched on drops out (holding the cylinder pressure) when the
control loses power. The positions of the EP release and brake were already
moved by 810b7ad07; a test pins them.
No change to game data needed.
The door closure signalling lamp (i-door_blocked) showed only Doors.is_locked
of the occupied vehicle, so a door open in another car or a coupled unit
didn't show on it.
TMoverParameters::door_closure() gives the state of one vehicle (none, locked,
released, open), the driver gathers the most severe one of the train in
determine_consist_state(), next to IsAnyDoorOpen, and the lamp is lit for
locked doors, blinks for closed but released ones (a permit given, or no lock
engaged on doors that need no permit) and is dark with a door open.
doorclosuresignal in eu07.ini (default yes) switches it; with no the lamp
shows is_locked of the occupied vehicle as before. No data change needed.
modernDimmerPosition indexed dimPositions without a range check in
RaLightsSet(), SetLightDimmings() and the off_from_dimmer value of the
cab's Python state. An empty DimmerList, or a DefaultPos past the end of
a short one, read past the end of the vector; the dimmer commands could
also leave or put the position outside the list.
Reads go through currentDimPosition(), a plain entry (not off, not
dimmed) outside the list. DefaultPos and the position are clamped after
the .fiz is loaded, the increase/decrease commands step through
stepDimmerPosition(), which clamps and does nothing for an empty list,
and headlightsdimenable clamps its position 1.
A control defined again in the same cab section of the .mmd with the
block key "duplicate: yes" no longer replaces the control: the first
definition stays the control (sounds, type, command feedback), and the
duplicate adds a copy with its own submodel, animation type and scale /
offset, following the control's value and active state. The duplicate's
sound keys are ignored so the control is not heard twice, and clicking
any copy works the control. This lets e.g. the ASF cab move its second
master controller and reverser with the first ones.
Without the key a repeated definition still replaces the earlier one,
as some of the game's .mmd files repeat controls with other submodels.
A duplicate with no definition of the control loaded from the current
cab's models before it is just the control.
clear_cab_controls() now also clears ggCompressorListButton, which kept
the previous cab's submodel.
The rule is in vehicle/gaugeduplicates.h, covered by
tests/unit/test_gauge_duplicates.cpp.
(eu07/maszyna#527)
full_power() notched up as soon as the controlling half had closed its line
contactors. In the ET42 test the locomotive brake is still at about 2.0 bar
then, right at the pressure switch threshold, so whether the second half
starts as well depended on thousandths of a bar in its cylinder: a half whose
switch is on when the controller leaves zero doesn't close its line
contactors until the controller is back at zero. Any change to the air
brakes could tip it either way (with the corrected ESt3 the second half
stayed off and the train reached 88.7 instead of 106 km/h).
The helper now waits, as a driver does, until no pressure switch in the
train cuts the start off.
The config key from eu07/maszyna#541. By default (yes) a pass reported to
__test.result waits until every vehicle has stood still for 1 s; with no it
ends the test at once. The key is listed with the other test.* settings in the
log and in the test start line.
Scenario tests: new case test_mode_pass_while_moving reports the pass from
event2 of tor1k as the train runs onto it and checks the run ended with the
train still moving (new check ends_moving). The README lists the test.* keys
with their defaults and the input the test mode ignores.
run.py starts eu07 with --test (and --test-timeout <duration> for cases that
record a fixed time) and compares the result from the exit code with the
case's expect key, before the physicslog checks. The 14 cases take about 30 s
with -j 4 instead of minutes. --watch keeps the old windowed run.
New case keys: expect, test_config (lines of a config block), track_events
(lines added to a track of the base scenery, e.g. event0 test_pass). New cases
show each end of the test mode: test_mode_pass, _signal_passed_at_danger,
_timeout and _standstill. The slippery rail cases slide past the red signal,
which now ends a test, so they set test.fail_if_stop_overran no.
README documents the test mode for scenery authors.
- physicslog rows keep all columns (text ones as None), checks can read
the wheelslip flag and the new vehicle speed column
- slips: the lead vehicle's wheels slip at some point (makes sure a
slippery rail case does what it's meant to)
- slip_clears: once stopped, the wheels stop slipping within N seconds
- holds_still: once stopped, the vehicle doesn't creep, by vehicle speed
- td_red_signal_moving.scn: the red signal case starting already moving
- eu07_slippery_red_signal / eu07_slippery_push_red_signal: skid on
braking for the red signal with track friction 0.03; the pushing one
fails without the fix for eu07/maszyna#479 (stays skidding, creeps)
- sn61_td_timetable: stop hold 5 -> 2 s, the railcar arrives 5-7 s
before its departure time, so 5 s made the case flaky
- eu07_td_red_signal: no route set, the train has to stop before the exit
signal and stay there (new checks stays_stopped and distance; distance
is integrated from the speed, the physicslog has no position)
- en57/ep09/et22/sm42/sn61/vectron/eu07_td_timetable share one fragment
template, td_timetable.scn; a case sets vars.consist and the lead vehicle
is named {{vehicle}} = autotest_<case>
- -j N runs cases in parallel: each case has its own physicslog and, with
multiplelogs, its own log files, which are moved to out/<case>/
- a run stops at once on Bad vehicle / Bad trainset instead of waiting for
the timeout, and fails after 120 s without physicslog rows
- the .sbt geometry cache of a test scenery is dropped when the base
scenery is newer
All 8 cases pass in about a minute with -j 4.
eu07_td_timetable now takes about 20 s instead of 4 min. Its speed profile
at 20 and 60 matched a real-time run within a few km/h and seconds; the
physicslog keeps its 0.05 s rows. The runner polls the log every 0.25 s so
it does not overshoot the case duration by a minute of simulation.
tests/scenarios/run.py builds a test scenery from a game install's scenery
(own trainsets removed, case fragment added), runs eu07 in ghostview with
physicslog on, and checks what the vehicle did: starts, max speed, brakes,
stops. First case: EU07 on td.scn driven by AI on the td/rozklad timetable,
with the Stacja1 exit route set by an event launcher instead of shift+4.
eu07 gets a -ini <file> option: an extra settings file read after eu07.ini,
so a test run can switch to a window and turn on physicslog without touching
the user's config.
Local only: scenery and vehicle data are not in the repo.
On the electric locomotives the lamp of the open line contactors tells the start can be made, so it goes out with the
start cut off by the pressure switch. The diesel-electric SU45 and SU46 (the only diesel-electrics with the lamp) use
it just to show the contactors are open, but it went out the same way: with too low a pressure in the main pipe the
contactors were open and the lamp out. Once the pressure came back with the master controller past the first
position, the contactors stayed open, as they should, and the lamp lit up on a power position, which looked like
the lamp working the other way round.
On the diesel-electrics TMoverParameters::LineContactorsLampLit() now follows the contactors alone; the electric
locomotives and the other main circuit lamps are unchanged.
Tests: tests/unit/test_line_contactors.cpp, on a locomotive made after the SU46.
The SM03 had no way to stop its engine. Its fuel pump starts on its own, so the fuel pump switch is ignored; the
engine runs the converter feeding the low voltage circuit, so the battery switch doesn't starve the fuel pump either;
and its cab has only the starter button, for which TTrain::OnCommand_linebreakeropen() kept a legacy branch which
animated the button and returned without opening the circuit. MainSwitch(false) itself stops the engine fine.
The command now opens the circuit on diesels whose cab has only the starter button
(TMoverParameters::MainCircuitOpensWithStarterOnly()), without animating the button, which held down would start
the engine again. Other vehicles with only the button closing the circuit keep ignoring the command.
Tests: tests/unit/test_engine_shutdown.cpp, on a shunter made after the SM03.
* test: real vehicles and golden traces in the unit tests
The game's own vehicles (dynamic/ of the release used for the tests) as
JSON of what the game's vehicle loader reads of their .fiz files, includes
expanded: test_fiz.cpp converts them on demand and checks the loader reads
the same sections, values and rows as of the game's file (fiz.h). Chosen
to cover every engine type, brake valve, brake handle, local brake,
coupler type, door type and brake delay set the game data uses.
Golden traces (golden.h) characterise the simulation, compared within a
relative tolerance or exactly, re-recorded with
EU07_UNIT_TESTS_UPDATE_GOLDEN=1:
- the parameters of every real vehicle as loaded,
- the brakes of every real vehicle through charge, service steps,
release, overcharge and emergency, on every brake delay setting,
- every position of every driver's and local brake handle,
- every powered vehicle started up the way the AI does it, driven to
full power and braked to a stop (drive.h),
- the real electric units and a locomotive with wagons driven whole, as
trains of coupled vehicles stepped the way the game steps them
(consist.h),
- scenarios of the controls (scenario.h): doors, reversing and cab
change, slip and sand, emergency stops, releasers, the ep and the
electrodynamic brake, heating, loading, a collision, and frames of
several physics iterations.
* test: commands passed between vehicles
Every command RunCommand knows run on every real vehicle and recorded,
commands travelling through a train with a vehicle facing backwards, a
coupling without the control cable, and loading and unloading by commands.
* test: every switch of the cab, sent to the next vehicle
Each switch sending its state to the train, each way and to each range,
with the controllers and direction among them, on every real vehicle
driving another of its kind, recorded for both.
* test: the switches of the cab worked on a pair under the catenary
The same switches with two seconds for the vehicles to act on each, so
the pantographs rise, the main switch closes and the auxiliaries start.
* test: gauges of trains in multiple and the damage descriptions
The ammeters and the brake force the AI expects, recorded on the electric
units and locomotives in multiple driven, the damage described on the
driver's panel and ammeters showing the current of controlled vehicles.
* test: give load commands their place, as the game does
The loading test set its commands with SetInternalCommand, which leaves
TCommand::Location as it is: uninitialised in a fresh vehicle, so the
distance check of Load= and UnLoad= read garbage and the test failed
now and then. The game gives them through PutCommand with the place of
the platform, and so do the tests now.
* test: brake valves and handles no vehicle of the game data has
Fitted to a wagon and to an EU07: the valve variants and handles the
loader knows that no real vehicle uses, the CV1 ones and the test handle
among them, and a name the loader doesn't know.
* test: braking from speed with the automatic ED brake, and a draisine
Trains with the EP09, the E6ACT and the EW58 braked by ep, light and full
service applications from speed, and the draisine pumped from rest and
rolling. Only the E6ACT brings its electrodynamic brake in here.
* test: the EP09's electrodynamic brake in service braking held to a stop
start_up() took a vehicle for ready once its line breaker was closed and
its reservoir full, which a train made already moving is at once: the
EP09's manually started converter was never switched on, so there was
no 110 V and no electrodynamic brake. It now waits for the converter.
The EP09 with wagons is braked from 120 km/h by light, medium, high and
full service applications held to a stop: the motors brake, the air of
its cylinders is let out and given back as the train slows down. The
flag of the electrodynamic brake stays on at a standstill below 2.1 bar.
C strings given to CAPTURE are shown as text.
* test: the converter switched on before a train is ready, the EW58's ep-staged electrodynamic brake
start_up() called a train ready as soon as its line breaker closed and the air was there, so the converter
of a unit having it in another car than the cab (the EW58's middle car) was never switched on, and its
electrodynamic brake, gated by the 110 V, never came in. The converter and the compressor now always get
switched on first. The EW58 brakes electrically by the stages of the ep brake, not by the pipe alone.
* test: the ET42 and the 214M railbus among the real vehicles
The ET42's halves (its own series motor branch: the motors in series at the high current setting) and the
214MA, a diesel railbus with the hydraulic torque converter, the retarder and the controller of an induction
motor drive, converted from the game data and recorded in every sweep of the real vehicles.
* test: the wagons' hand brakes released with the train's brakes; the 754, SM31 and SU46
release_brakes() released the hand brake of the driver's vehicle only, so every wagon set up braked kept its
hand brake on and got dragged along. It now releases the hand and spring brakes of the whole train, as
TController::AutoRewident() does when the AI takes it over, and the traces of the trains with wagons are
recorded anew.
The 754, the SM31 and the SU46 join the real vehicles for the kinds of the diesel-electrics' field shunting
relays the others lack (RelayType 0, 1 and 46).
* test: traction on a lost and too high catenary voltage, the ET42, the diesel-electrics' shunting relays
The line breaker opened by the voltage relays of a series motor locomotive and by the limits of an induction
motor one. The ET42 at the high current setting, which keeps its halves' motors in series, and its switched
electrodynamic brake, whose current trips the overload relay from the top speed of the low setting. The field
shunting of the diesel-electrics through each kind of their relays, at full power and notched back.
* test: the EW58's electrodynamic brake stages, the EU47's speed control and braking at the voltage's limit
The stages of the EW58's motor brake set by the positions of its ep handle, the first one alone over
100 km/h. The EU47's second controller holding, raising and lowering the speed set, its local brake setting
the flag of the electrodynamic brake without the motors braking, and its brake feeding back less current into
a catenary over the drive's MaxV.
* test: diesel engines too cold and too hot to start, the 214M railbus's controller and retarder
The heat of the diesel engines: at -10 degrees the ones with the lowest water temperature set don't start
until the heater warms them, at 88 degrees the ones with a second water circuit don't start while it cools,
and the SM42 run hot at full power is kept under its highest temperature by its fans and shutters. The 214M
railbus's controller from the air brake through the retarder and neutral to power, its torque converter's
lock-up and its gearbox.
The controller helpers of the traction tests (full power, waiting for the line contactors, and notching back)
move to test::scenario.
* test: couplers coupled, uncoupled, broken and colliding; loads assigned, loaded and unloaded
Coupling by hand touching or apart and of the same kind or not, with the sounds of what changes; uncoupling a
screw coupler pressed together, stretched, with the hoses alone or broken; the automatic couplers of electric
units coupling on contact, without the control cable between two kinds; a coupler broken with its brake
hose; collisions over 15 km/h derailing. The pantographs set up by the pantstate load, a load of one kind at
a time up to the capacity, and the steps of loading and unloading.
* test: the battery drained and charged, the pantographs' tank and pressure switch, the 214M's speed control
The EU07's battery drained without the converter by the lights and the small compressor until it opens the
line breaker and nothing starts, charged by the converter, and switched off. The pantographs on their own
leaking tank until the pressure switch opens the line breaker, and the small compressor pumping it up and
priming the switch. The 214M railbus's speed control set by its buttons, steps and power limit, braking down
with the retarder, and standing by.
* test: the MHZ handles' buttons, the valves at speed, every brake material, the NESt3's relays
The overload and the high pressure buttons of the MHZ handles. The KE and the LSt at speed in the R and P
settings, under the anti-slip request and the releaser button. Every material of the brake shoes and disks
the loader takes, braking a wagon from speed, the ones no game vehicle has among them. The CV1_R and the
Oerlikon valve's relays set by its name (-ED, AL2 without ESt3) fitted to a wagon.
* test: the loader's lists and lines: the 218M, SA134 and 22WEc, a compressor list, Pmax by speed, skipped lines
The 218M (V2NList), the SA134 (HTCList) and the Elf 22WEc (ffBrakeList) join the real vehicles for the lists
the others lack. Definitions made by the tests for what no game file has: a compressor list, whose table of
whole numbers reads a factor of 0.9 as 0; the compressor's limits apart for the rear cab; the highest power
of an induction motor drive by the speed, extrapolated past the table; and the lines the loader skips or
trims (comments, a hash anywhere, leading spaces, carriage returns).
* test: what the cab and the AI call on a vehicle: gauges of the train, the split ED brake, spring brake, cut-off
The engine rotation of up to three vehicles in multiple and the lamps of the overload relay and the starting
resistors read through the control cable; the engine's idle speed and the ET42's second controller shown in
its dynamic brake; the controller of the electrodynamic brake apart from the local brake, which no game
vehicle has yet; the spring brake shut off and released, the ep brake's fuse and the handle stepped by the AI;
damaged motors cut off; the cab activated by itself; a road vehicle moved across a road, for which the tests'
track gets a width; and the lamps and the buzzer of the security system left unattended.
* test: the EP05 and its camshaft among the real vehicles, the headlights' colour and brightness
The EP05, whose camshaft closes the line breaker and the line contactors by the camshaft's own position,
converted from the game data and recorded in every sweep of the real vehicles. The Headlights section, which
only the 214M's own file has, in a definition made by the test.
* test: what the unit tests reach of the simulation core, what's dead or left, and what they found
COVERAGE.md: the blocks of Mover.cpp, hamulce.cpp, Oerlikon_ESt.cpp and friction.cpp the tests run, the code
nothing in the game runs, the code only data no game vehicle has would run, what's reachable and left, and
the behaviour the tests found that may deserve a look.
* test: check invariants of the physics on every step of every golden trace
Rules any vehicle keeps whatever a test does (no NaN, cylinders and pipes
within their limits, no current with the line breaker or contactors open,
no force without power, distance as the speed runs, no acceleration over
5 g), checked on every step, with no comparison to a recorded file. The
traces where a test or a game vehicle breaks one are excused with the
reason; the vehicles' cases are in the findings of COVERAGE.md.
* test: key figures of every golden trace, per part of the run
Duration, speeds, distance, time to stop, the brake pipe's lowest
pressure and time to recover, the peaks of the cylinders, the motor
current and the tractive force, for each part between two events, in
data/golden/<name>.figures. Compared within 0.5% or the last decimal, so
they hold on any compiler, and an intended change of behaviour shows in
a few readable lines. Traces sampled by hand keep none.
* test: keep the golden samples out of the repository, recorded on the code before a change
The samples of the golden traces are 29 MB and only mean something against
the code before the change they check, so they're recorded locally before it
(EU07_UNIT_TESTS_UPDATE_GOLDEN=1) and compared after it, and ignored by git.
The key figures and the invariants stay, and are what the CI checks.
Without samples recorded a trace compares only its key figures, but with
EU07_UNIT_TESTS_GOLDEN_EXACT=1, the check of a change which shouldn't alter
anything, it fails, so the check can't pass by having nothing to compare.
* fix: draw the noise of the control pipe pressure in one order on every compiler
The order of the two Random(10) calls in 'Random(10) - Random(10)' is
unspecified: GCC draws them the other way round than MSVC Release, which
mirrored the control pipe pressure around 5 bar and failed 32 unit tests
on the Linux CI. The draws are sequenced in the order of MSVC Release,
which the golden traces were recorded with.
* test: count the start-up rounds with an integer, not a double (SonarCloud S2193)
* test: behaviour in CHECKs, the key figures out of the repository
The key figures of the golden traces are recorded with their samples on the code
before a change, and compared after it, instead of being kept: a trace without
them checks the invariants and its test's CHECKs, which is what the CI runs.
The scenarios of the controls state what they show in CHECKs, and the runs of
every real vehicle what holds for each of them. Writing them showed scenarios
which didn't do what they were named for: the cab change stopped in the engine
room, the slip runs put the controller to full power at once and never got the
line contactors closed, and the train stopped by the alarm chain never got its
pipe charged again. They do it now; the rest went to the findings.
* test: the SonarCloud findings in the unit tests
std::format for the texts put together, emplace_back, const references, string_view parameters, std::array and std::vector for the C arrays, the ranges algorithms, names no longer shadowing the coupler ends, comments in the empty loops; start_up(), trace::check() and the converter of the definitions split up. BrakeForceR() is const, which it always was in effect, so the gauges test needs no const_cast. The golden traces compare bit for bit.