18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 10:05:23 +01:00

test(editor): the station track picked by bands of height in a unit case; a station failing half way and one at the history cap in self-tests

The review of #508 asked for these two.

- The choice of the track a station starts or ends on is trace_station::pick_station_track(), a free function of
  editor/editorTraceStation: the tracks in reach in plan compared by bands of 3 m of height, then by the distance in plan, the
  first of two alike. editor_mode::station_track_at() collects the tracks as before and takes its pick, in the same order and
  with the same comparisons, so it picks what it picked. The unit case covers a flyover above and a bridge over a cutting
  against the track at the height clicked, a high embankment within one band, a track only far above or below, the reach and
  the width of the bands.
- st_5_station_failed: the station of st_1 made to fail after its first turnout, then after both turnouts with the line
  between them not laid. Each time the turnouts laid are taken back, the main track is as it was, the clicks are kept but the
  last one, the reason is told and Ctrl+Y has nothing to lay; the last click again lays the station in full.
- st_6_station_history_cap: the same station laid with the history capped at 2 steps, laid in full and not taken for failed.
- For them the self-test has stationfail <end|line> (the next station made to fail there, once; lay_station() asks
  selftest_station_fails(), which only the self-test sets), historycap <steps> and expect laypoints <count>.
This commit is contained in:
maj00r
2026-12-02 17:35:09 +01:00
parent c4439f7cc7
commit bdffbccd2a
11 changed files with 204 additions and 18 deletions
+3
View File
@@ -145,6 +145,9 @@ editor_mode::selftest_result editor_mode::selftest_dispatch(std::string const &c
// Tab; curve: a curve traced between bends, the shape of before, reached by the self-test alone; default:
// as the user who hasn't chosen, traced where the photo is on
// laysigma <m> the noise of the clicks from now on; 0: two pixels of the view at each
// stationfail <end|line> the next station traced on the photo made to fail: the turnout it ends with not laid (after the
// one it starts with), or the track between the turnouts (after both)
// historycap <steps> the cap of the size of the history from now on, as its window sets it: the oldest steps dropped
// laysettings <0|1> the settings of the lay tool opened under the line of their summary, or folded into it, as a
// click on that line does while the points are clicked
// endcurves logs every free end of the rails: where, the way out and the curvature its track goes on with