[routing] Add possibility to save routes as tracks

Signed-off-by: cyber-toad <the.cyber.toad@proton.me>
This commit is contained in:
cyber-toad
2025-03-11 10:13:57 +01:00
committed by Konstantin Pastbin
parent 9e8accc8f5
commit 45bba5fb5e
16 changed files with 165 additions and 18 deletions

View File

@@ -1639,4 +1639,18 @@ UNIT_CLASS_TEST(Runner, Bookmarks_RecentlyDeleted)
TEST(!Platform::IsFileExistsByFullPath(filePath), ());
TEST(!Platform::IsFileExistsByFullPath(deletedFilePath), ());
}
UNIT_CLASS_TEST(Runner, Bookmarks_TestSaveRoute)
{
BookmarkManager bmManager(BM_CALLBACKS);
bmManager.EnableTestMode(true);
auto const points = {m2::PointD(0.0, 0.0), m2::PointD(0.001, 0.001)};
auto const trackId = bmManager.SaveRoute(points, "London", "Paris");
auto const * track = bmManager.GetTrack(trackId);
TEST_EQUAL(track->GetName(), "London - Paris", ());
auto const line = track->GetData().m_geometry.m_lines[0];
std::vector const expectedLine = {{geometry::PointWithAltitude(m2::PointD(0.0, 0.0)), geometry::PointWithAltitude(m2::PointD(0.001, 0.001))}};
TEST_EQUAL(line, expectedLine, ());
}
} // namespace bookmarks_test