mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 14:43:43 +00:00
[routing] Add possibility to save routes as tracks
Signed-off-by: cyber-toad <the.cyber.toad@proton.me>
This commit is contained in:
committed by
Konstantin Pastbin
parent
9e8accc8f5
commit
45bba5fb5e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user