From 8d4b6f75196f063d2d43c8f0a479bb3adf7d55ab Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 4 Jul 2019 11:36:17 +0300 Subject: [PATCH] [routing] Review fixes. --- routing/routing_benchmarks/bicycle_routing_tests.cpp | 8 ++------ routing/routing_benchmarks/car_routing_tests.cpp | 8 ++------ routing/routing_benchmarks/helpers.cpp | 1 + 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/routing/routing_benchmarks/bicycle_routing_tests.cpp b/routing/routing_benchmarks/bicycle_routing_tests.cpp index 348741957e..f6c45aca3f 100644 --- a/routing/routing_benchmarks/bicycle_routing_tests.cpp +++ b/routing/routing_benchmarks/bicycle_routing_tests.cpp @@ -32,16 +32,12 @@ protected: std::unique_ptr CreateDirectionsEngine( std::shared_ptr numMwmIds) override { - std::unique_ptr engine( - new routing::BicycleDirectionsEngine(m_dataSource, numMwmIds)); - return engine; + return std::make_unique(m_dataSource, numMwmIds); } std::unique_ptr CreateModelFactory() override { - std::unique_ptr factory( - new SimplifiedModelFactory()); - return factory; + return std::make_unique>(); } }; diff --git a/routing/routing_benchmarks/car_routing_tests.cpp b/routing/routing_benchmarks/car_routing_tests.cpp index a9c1088c07..51ba9bf707 100644 --- a/routing/routing_benchmarks/car_routing_tests.cpp +++ b/routing/routing_benchmarks/car_routing_tests.cpp @@ -42,16 +42,12 @@ protected: std::unique_ptr CreateDirectionsEngine( std::shared_ptr numMwmIds) override { - std::unique_ptr engine( - new routing::BicycleDirectionsEngine(m_dataSource, numMwmIds)); - return engine; + return std::make_unique(m_dataSource, numMwmIds); } std::unique_ptr CreateModelFactory() override { - std::unique_ptr factory( - new SimplifiedModelFactory()); - return factory; + return std::make_unique>(); } }; diff --git a/routing/routing_benchmarks/helpers.cpp b/routing/routing_benchmarks/helpers.cpp index efd709a10b..e742f69ee1 100644 --- a/routing/routing_benchmarks/helpers.cpp +++ b/routing/routing_benchmarks/helpers.cpp @@ -155,6 +155,7 @@ void TestRouter(routing::IRouter & router, m2::PointD const & startPos, TEST_EQUAL(routing::RouterResultCode::NoError, resultCode, ()); TEST(route.IsValid(), ()); m2::PolylineD const & poly = route.GetPoly(); + TEST_GREATER(poly.GetSize(), 0, ()); TEST(base::AlmostEqualAbs(poly.Front(), startPos, routing::kPointsEqualEpsilon), ()); TEST(base::AlmostEqualAbs(poly.Back(), finalPos, routing::kPointsEqualEpsilon), ()); LOG(LINFO, ("Route polyline size:", route.GetPoly().GetSize()));