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::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 IndexGraphStarterJoints::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 IndexGraphStarterJoints::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 +#include + 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.