Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlga Khlopkova <o.khlopkova@corp.mail.ru>2020-10-16 16:17:43 +0300
committerAnatoliy V. Tomilov <tomilov@users.noreply.github.com>2020-10-16 18:14:51 +0300
commite26c9d0c7b59c876a10cb9d41104621858e45797 (patch)
tree8d9bc33142d7d539c896233b0c1dc3d82245088e /transit
parent301710c2cb029d435b339cb6cb1da25d56b84b77 (diff)
[transit] Update for tests after SubwayConverter changes.
Diffstat (limited to 'transit')
-rw-r--r--transit/world_feed/world_feed.cpp10
-rw-r--r--transit/world_feed/world_feed.hpp2
-rw-r--r--transit/world_feed/world_feed_integration_tests/world_feed_integration_tests.cpp8
3 files changed, 9 insertions, 11 deletions
diff --git a/transit/world_feed/world_feed.cpp b/transit/world_feed/world_feed.cpp
index 39450cb8f7..c2299d7441 100644
--- a/transit/world_feed/world_feed.cpp
+++ b/transit/world_feed/world_feed.cpp
@@ -762,8 +762,7 @@ void WorldFeed::ModifyLinesAndShapes()
}
auto const & pointsNeedle = m_shapes.m_data[shapeIdNeedle].m_points;
- auto pointsNeedleRev = pointsNeedle;
- std::reverse(pointsNeedleRev.begin(), pointsNeedleRev.end());
+ auto const pointsNeedleRev = GetReversed(pointsNeedle);
for (size_t j = 0; j < i; ++j)
{
@@ -1735,7 +1734,8 @@ bool WorldFeed::PrepareEdgesInRegion(std::string const & region)
CHECK(!shapePoints.empty(), ("Shape is empty."));
auto const it = m_edgesOnShapes.find(edgeId);
- CHECK(it != m_edgesOnShapes.end(), (edgeId.m_lineId));
+ if (it == m_edgesOnShapes.end())
+ continue;
for (auto const & polyline : it->second)
{
@@ -1749,10 +1749,8 @@ bool WorldFeed::PrepareEdgesInRegion(std::string const & region)
{
for (auto const & polyline : it->second)
{
- auto r = polyline;
- std::reverse(r.begin(), r.end());
std::tie(edgeData.m_shapeLink.m_startIndex, edgeData.m_shapeLink.m_endIndex) =
- FindSegmentOnShape(shapePoints, r);
+ FindSegmentOnShape(shapePoints, GetReversed(polyline));
if (!(edgeData.m_shapeLink.m_startIndex == 0 && edgeData.m_shapeLink.m_endIndex == 0))
break;
}
diff --git a/transit/world_feed/world_feed.hpp b/transit/world_feed/world_feed.hpp
index 7478ac015f..9f4a965916 100644
--- a/transit/world_feed/world_feed.hpp
+++ b/transit/world_feed/world_feed.hpp
@@ -379,7 +379,7 @@ private:
Transfers m_transfers;
Gates m_gates;
- // Mapping of the edge to its ending points on the shape polyline.
+ // Mapping of the edge to its points on the shape polyline.
std::unordered_map<EdgeId, std::vector<std::vector<m2::PointD>>, EdgeIdHasher> m_edgesOnShapes;
// Ids of entities for json'izing, split by regions.
diff --git a/transit/world_feed/world_feed_integration_tests/world_feed_integration_tests.cpp b/transit/world_feed/world_feed_integration_tests/world_feed_integration_tests.cpp
index f103575a66..1b6cfd23f8 100644
--- a/transit/world_feed/world_feed_integration_tests/world_feed_integration_tests.cpp
+++ b/transit/world_feed/world_feed_integration_tests/world_feed_integration_tests.cpp
@@ -119,16 +119,16 @@ public:
// First and last stops are connected through 1 edge with 1 nearest stop.
// Stops in the middle are connected through 2 edges with 2 nearest stops.
- TEST_EQUAL(stopsInRegions["Switzerland_Ticino"].size(), 2, ());
+ TEST_EQUAL(stopsInRegions["Switzerland_Ticino"].size(), 3, ());
TEST_EQUAL(edgesInRegions["Switzerland_Ticino"].size(), 1, ());
- TEST_EQUAL(stopsInRegions["Switzerland_Eastern"].size(), 3, ());
+ TEST_EQUAL(stopsInRegions["Switzerland_Eastern"].size(), 4, ());
TEST_EQUAL(edgesInRegions["Switzerland_Eastern"].size(), 2, ());
- TEST_EQUAL(stopsInRegions["Italy_Lombardy_Como"].size(), 3, ());
+ TEST_EQUAL(stopsInRegions["Italy_Lombardy_Como"].size(), 4, ());
TEST_EQUAL(edgesInRegions["Italy_Lombardy_Como"].size(), 2, ());
- TEST_EQUAL(stopsInRegions["Italy_Lombardy_Monza and Brianza"].size(), 2, ());
+ TEST_EQUAL(stopsInRegions["Italy_Lombardy_Monza and Brianza"].size(), 3, ());
TEST_EQUAL(edgesInRegions["Italy_Lombardy_Monza and Brianza"].size(), 1, ());
}