diff options
author | Mikhail Gorbushin <m.gorbushin@corp.mail.ru> | 2019-05-27 20:43:51 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2019-05-29 14:32:05 +0300 |
commit | 3190864ee4b0904e1049ea54b50814e0a47bc450 (patch) | |
tree | 3a38764cb9d78ec21ea8fda4b20bd51efc284151 /routing | |
parent | 7d2f1aeccc969d2c92d2ba0d1cc4f9f620dadb5a (diff) |
[routing] review fixes
Diffstat (limited to 'routing')
-rw-r--r-- | routing/index_graph_starter_joints.hpp | 14 | ||||
-rw-r--r-- | routing/index_router.cpp | 2 | ||||
-rw-r--r-- | routing/routing_integration_tests/small_routes.cpp | 9 |
3 files changed, 16 insertions, 9 deletions
diff --git a/routing/index_graph_starter_joints.hpp b/routing/index_graph_starter_joints.hpp index 4e52345bdf..f6e9059dfb 100644 --- a/routing/index_graph_starter_joints.hpp +++ b/routing/index_graph_starter_joints.hpp @@ -237,11 +237,8 @@ void IndexGraphStarterJoints<Graph>::Init(Segment const & startSegment, Segment else m_endJoint = CreateFakeJoint(m_graph.GetFinishSegment(), m_graph.GetFinishSegment()); - m_reconstructedFakeJoints.emplace(m_startJoint, - ReconstructedPath({m_startSegment}, true /* fromStart */)); - - m_reconstructedFakeJoints.emplace(m_endJoint, - ReconstructedPath({m_endSegment}, false /* fromStart */)); + m_reconstructedFakeJoints[m_startJoint] = ReconstructedPath({m_startSegment}, true /* fromStart */); + m_reconstructedFakeJoints[m_endJoint] = ReconstructedPath({m_endSegment}, false /* fromStart */); m_startOutEdges = FindFirstJoints(startSegment, true /* fromStart */); m_endOutEdges = FindFirstJoints(endSegment, false /* fromStart */); @@ -300,6 +297,7 @@ std::vector<Segment> IndexGraphStarterJoints<Graph>::ReconstructJoint(JointSegme CHECK(it != m_reconstructedFakeJoints.cend(), ("Can not find such fake joint")); auto path = it->second.m_path; + ASSERT(!path.empty(), ()); if (path.front() == m_startSegment && path.back() == m_endSegment) path.pop_back(); @@ -578,13 +576,13 @@ std::vector<JointEdge> IndexGraphStarterJoints<Graph>::FindFirstJoints(Segment c { CHECK(!IsRealSegment(fake), ()); - bool const haveSameFront = + bool const hasSameFront = m_graph.GetPoint(fake, true /* front */) == m_graph.GetPoint(segment, true); - bool const haveSameBack = + bool const hasSameBack = m_graph.GetPoint(fake, false /* front */) == m_graph.GetPoint(segment, false); - return (fromStart && haveSameFront) || (!fromStart && haveSameBack); + return (fromStart && hasSameFront) || (!fromStart && hasSameBack); }; while (!queue.empty()) diff --git a/routing/index_router.cpp b/routing/index_router.cpp index c6da691b49..3c1cf224ff 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -474,6 +474,8 @@ RouterResultCode IndexRouter::DoCalculateRoute(Checkpoints const & checkpoints, IndexGraphStarter::CheckValidRoute(segments); + // TODO (@gmoryes) https://jira.mail.ru/browse/MAPSME-10694 + // We should do RedressRoute for each subroute separately. auto redressResult = RedressRoute(segments, delegate, *starter, route); if (redressResult != RouterResultCode::NoError) return redressResult; diff --git a/routing/routing_integration_tests/small_routes.cpp b/routing/routing_integration_tests/small_routes.cpp index 226cb81baf..f301ceaeff 100644 --- a/routing/routing_integration_tests/small_routes.cpp +++ b/routing/routing_integration_tests/small_routes.cpp @@ -1,9 +1,16 @@ #include "testing/testing.hpp" +#include "routing/vehicle_mask.hpp" + #include "routing/routing_integration_tests/routing_test_tools.hpp" #include "geometry/mercator.hpp" +#include "base/logging.hpp" + +#include <tuple> +#include <vector> + using namespace routing; namespace @@ -11,7 +18,7 @@ namespace // This is set of small routes was received from users' crashes. // It crashed into astar_algorithm.hpp in CHECK() about A* invariant // for bidirectional algo. -// These tests should run without any errors. +// These tests should just passed without any crash. UNIT_TEST(SmallRoutes_JustNoError) { // Do not touch the coords here! It's must be written in this format. |