Skip to content

Commit

Permalink
Track::Loader: add binary backup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreguillot committed Sep 9, 2024
1 parent 6c0ac86 commit 6e449b6
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Source/Track/AnlTrackLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,15 @@ class Track::Loader::UnitTest
checkPoints(loadFromCsv(stream, ' ', false, shouldAbort, advancement));
}

beginTest("load lab markers");
{
std::stringstream stream;
stream.write(TestResultsData::Markers_lab, TestResultsData::Markers_labSize);
std::atomic<bool> shouldAbort{false};
std::atomic<float> advancement{0.0f};
checkMakers(loadFromCsv(stream, '\t', true, shouldAbort, advancement));
}

beginTest("load json error");
{
auto const result = std::string(TestResultsData::Error_json);
Expand Down Expand Up @@ -1606,6 +1615,15 @@ class Track::Loader::UnitTest
checkMakers(loadFromBinary(stream, shouldAbort, advancement));
}

beginTest("load binary markers backup");
{
std::stringstream stream;
stream.write(TestResultsData::Markersbackup_dat, TestResultsData::Markersbackup_datSize);
std::atomic<bool> shouldAbort{false};
std::atomic<float> advancement{0.0f};
checkMakers(loadFromBinary(stream, shouldAbort, advancement));
}

beginTest("load binary points");
{
std::stringstream stream;
Expand All @@ -1615,13 +1633,13 @@ class Track::Loader::UnitTest
checkPoints(loadFromBinary(stream, shouldAbort, advancement));
}

beginTest("load lab markers");
beginTest("load binary points backup");
{
std::stringstream stream;
stream.write(TestResultsData::Markers_lab, TestResultsData::Markers_labSize);
stream.write(TestResultsData::Pointsbackup_dat, TestResultsData::Pointsbackup_datSize);
std::atomic<bool> shouldAbort{false};
std::atomic<float> advancement{0.0f};
checkMakers(loadFromCsv(stream, '\t', true, shouldAbort, advancement));
checkPoints(loadFromBinary(stream, shouldAbort, advancement));
}
}
};
Expand Down

0 comments on commit 6e449b6

Please sign in to comment.