18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 16:14:58 +01:00

fix: make the odometer test's scratch directory in the build directory for CI

Sonar (S5443) flags the shared temporary directory; the tests now use one
in their working directory. Also makes the scratch directory non-copyable
and spells out the optional checks Sonar asked about.
This commit is contained in:
jerrrrycho
2026-11-08 04:23:30 +01:00
parent 6dc42e976f
commit 1083f3cb5d
3 changed files with 8 additions and 5 deletions

View File

@@ -153,9 +153,9 @@ double guessed_state(std::string const &Vehicle) {
reading starting_state(store const &States, std::string const &Vehicle, std::filesystem::path const &Vehicledirectory) {
reading result;
if (auto const saved{States.find(Vehicle)}) {
if (auto const saved{States.find(Vehicle)}; saved.has_value()) {
result.begin(*saved, origin::saved);
} else if (auto const legacy{legacy_state(Vehicledirectory, Vehicle)}) {
} else if (auto const legacy{legacy_state(Vehicledirectory, Vehicle)}; legacy.has_value()) {
result.begin(*legacy, origin::legacy);
} else {
result.begin(guessed_state(Vehicle), origin::guessed);