diff options
author | Yuri Gorshenin <y@maps.me> | 2016-09-15 12:18:36 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-09-15 17:42:54 +0300 |
commit | 222bb97b1e0b9f4ccbe2f8ab0c9d4eec8fd3e177 (patch) | |
tree | d94346bb00d70695a64373612e60f470fff7b60d /routing | |
parent | a41dc789d13150bbf0b25d64d44df5d1809d0585 (diff) |
Review fixes.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/road_graph.cpp | 4 | ||||
-rw-r--r-- | routing/road_graph.hpp | 3 | ||||
-rw-r--r-- | routing/road_graph_router.cpp | 8 | ||||
-rw-r--r-- | routing/routing_benchmarks/bicycle_routing_tests.cpp | 47 | ||||
-rw-r--r-- | routing/routing_benchmarks/helpers.cpp | 144 | ||||
-rw-r--r-- | routing/routing_benchmarks/helpers.hpp | 92 | ||||
-rw-r--r-- | routing/routing_benchmarks/pedestrian_routing_tests.cpp | 283 | ||||
-rw-r--r-- | routing/routing_benchmarks/routing_benchmarks.pro | 23 |
8 files changed, 595 insertions, 9 deletions
diff --git a/routing/road_graph.cpp b/routing/road_graph.cpp index a2ef84c276..db72d0bb2c 100644 --- a/routing/road_graph.cpp +++ b/routing/road_graph.cpp @@ -172,14 +172,14 @@ void IRoadGraph::GetFakeOutgoingEdges(Junction const & junction, TEdgeVector & e { auto const it = m_fakeOutgoingEdges.find(junction); if (it != m_fakeOutgoingEdges.cend()) - edges.insert(edges.end(), it->second.begin(), it->second.end()); + edges.insert(edges.end(), it->second.cbegin(), it->second.cend()); } void IRoadGraph::GetFakeIngoingEdges(Junction const & junction, TEdgeVector & edges) const { auto const it = m_fakeIngoingEdges.find(junction); if (it != m_fakeIngoingEdges.cend()) - edges.insert(edges.end(), it->second.begin(), it->second.end()); + edges.insert(edges.end(), it->second.cbegin(), it->second.cend()); } void IRoadGraph::ResetFakes() diff --git a/routing/road_graph.hpp b/routing/road_graph.hpp index dee5275414..b93dac3203 100644 --- a/routing/road_graph.hpp +++ b/routing/road_graph.hpp @@ -274,10 +274,7 @@ private: } } - // Map of ingoing edges for junctions. map<Junction, TEdgeVector> m_fakeIngoingEdges; - - // Map of outgoing edges for junctions. map<Junction, TEdgeVector> m_fakeOutgoingEdges; }; diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index 9e1ae3ae0e..ef8cc95587 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -96,10 +96,10 @@ bool CheckGraphConnectivity(IRoadGraph const & graph, Junction const & junction, void FindClosestEdges(IRoadGraph const & graph, m2::PointD const & point, vector<pair<Edge, Junction>> & vicinity) { - // WARNING: Take only one vicinity, with, maybe, it's inverse. It - // is an oversimplification that is not as easily solved as tuning - // up this constant because if you set it too high you risk to find - // a feature that you cannot in fact reach because of an obstacle. + // WARNING: Take only one vicinity, with, maybe, its inverse. It is + // an oversimplification that is not as easily solved as tuning up + // this constant because if you set it too high you risk to find a + // feature that you cannot in fact reach because of an obstacle. // Using only the closest feature minimizes (but not eliminates) // this risk. vector<pair<Edge, Junction>> candidates; diff --git a/routing/routing_benchmarks/bicycle_routing_tests.cpp b/routing/routing_benchmarks/bicycle_routing_tests.cpp new file mode 100644 index 0000000000..5bab41676e --- /dev/null +++ b/routing/routing_benchmarks/bicycle_routing_tests.cpp @@ -0,0 +1,47 @@ +#include "testing/testing.hpp" + +#include "routing/routing_benchmarks/helpers.hpp" + +#include "routing/bicycle_directions.hpp" +#include "routing/bicycle_model.hpp" +#include "routing/road_graph.hpp" + +#include "geometry/mercator.hpp" + +#include "std/set.hpp" +#include "std/string.hpp" + +namespace +{ +// Test preconditions: files from the kMapFiles set with '.mwm' +// extension must be placed in omim/data folder. +set<string> const kMapFiles = {"Russia_Moscow"}; + +class BicycleTest : public RoutingTest +{ +public: + BicycleTest() : RoutingTest(routing::IRoadGraph::Mode::ObeyOnewayTag, kMapFiles) {} + +protected: + // RoutingTest overrides: + unique_ptr<routing::IDirectionsEngine> CreateDirectionsEngine() override + { + unique_ptr<routing::IDirectionsEngine> engine(new routing::BicycleDirectionsEngine(m_index)); + return engine; + } + + unique_ptr<routing::IVehicleModelFactory> CreateModelFactory() override + { + unique_ptr<routing::IVehicleModelFactory> factory( + new SimplifiedModelFactory<routing::BicycleModel>()); + return factory; + } +}; + +UNIT_CLASS_TEST(BicycleTest, Smoke) +{ + m2::PointD const start = MercatorBounds::FromLatLon(55.79181, 37.56513); + m2::PointD const final = MercatorBounds::FromLatLon(55.79369, 37.56054); + TestRouters(start, final); +} +} // namespace diff --git a/routing/routing_benchmarks/helpers.cpp b/routing/routing_benchmarks/helpers.cpp new file mode 100644 index 0000000000..139a3d7e09 --- /dev/null +++ b/routing/routing_benchmarks/helpers.cpp @@ -0,0 +1,144 @@ +#include "routing/routing_benchmarks/helpers.hpp" + +#include "testing/testing.hpp" + +#include "routing/base/astar_algorithm.hpp" +#include "routing/features_road_graph.hpp" +#include "routing/route.hpp" +#include "routing/router_delegate.hpp" + +#include "indexer/classificator_loader.hpp" +#include "indexer/mwm_set.hpp" + +#include "platform/local_country_file.hpp" +#include "platform/local_country_file_utils.hpp" +#include "platform/platform.hpp" + +#include "geometry/polyline2d.hpp" + +#include "base/logging.hpp" +#include "base/math.hpp" +#include "base/timer.hpp" + +#include "std/limits.hpp" + +namespace +{ +void TestRouter(routing::IRouter & router, m2::PointD const & startPos, + m2::PointD const & finalPos, routing::Route & foundRoute) +{ + routing::RouterDelegate delegate; + LOG(LINFO, ("Calculating routing ...", router.GetName())); + routing::Route route(""); + my::Timer timer; + routing::IRouter::ResultCode const resultCode = router.CalculateRoute( + startPos, m2::PointD::Zero() /* startDirection */, finalPos, delegate, route); + double const elapsedSec = timer.ElapsedSeconds(); + TEST_EQUAL(routing::IRouter::NoError, resultCode, ()); + TEST(route.IsValid(), ()); + m2::PolylineD const & poly = route.GetPoly(); + TEST(my::AlmostEqualAbs(poly.Front(), startPos, routing::kPointsEqualEpsilon), ()); + TEST(my::AlmostEqualAbs(poly.Back(), finalPos, routing::kPointsEqualEpsilon), ()); + LOG(LINFO, ("Route polyline size:", route.GetPoly().GetSize())); + LOG(LINFO, ("Route distance, meters:", route.GetTotalDistanceMeters())); + LOG(LINFO, ("Elapsed, seconds:", elapsedSec)); + foundRoute.Swap(route); +} + +m2::PointD GetPointOnEdge(routing::Edge const & e, double posAlong) +{ + if (posAlong <= 0.0) + return e.GetStartJunction().GetPoint(); + if (posAlong >= 1.0) + return e.GetEndJunction().GetPoint(); + m2::PointD const d = e.GetEndJunction().GetPoint() - e.GetStartJunction().GetPoint(); + return e.GetStartJunction().GetPoint() + d * posAlong; +} +} // namespace + +RoutingTest::RoutingTest(routing::IRoadGraph::Mode mode, set<string> const & neededMaps) + : m_mode(mode) +{ + classificator::Load(); + + Platform & platform = GetPlatform(); + m_cig = storage::CountryInfoReader::CreateCountryInfoReader(platform); + + vector<platform::LocalCountryFile> localFiles; + platform::FindAllLocalMapsAndCleanup(numeric_limits<int64_t>::max(), localFiles); + + set<string> registeredMaps; + for (auto const & localFile : localFiles) + { + auto const & name = localFile.GetCountryName(); + if (neededMaps.count(name) == 0) + continue; + + UNUSED_VALUE(m_index.RegisterMap(localFile)); + + auto const & countryFile = localFile.GetCountryFile(); + TEST(m_index.IsLoaded(countryFile), ()); + MwmSet::MwmId const id = m_index.GetMwmIdByCountryFile(countryFile); + TEST(id.IsAlive(), ()); + + registeredMaps.insert(name); + } + + if (registeredMaps != neededMaps) + { + for (auto const & file : neededMaps) + { + if (registeredMaps.count(file) == 0) + LOG(LERROR, ("Can't find map:", file)); + } + TEST(false, ("Some maps can't be found. See error messages above.")); + } +} + +void RoutingTest::TestRouters(m2::PointD const & startPos, m2::PointD const & finalPos) +{ + // Find route by A*-bidirectional algorithm. + routing::Route routeFoundByAstarBidirectional(""); + { + auto router = + CreateRouter<routing::AStarBidirectionalRoutingAlgorithm>("test-astar-bidirectional"); + TestRouter(*router, startPos, finalPos, routeFoundByAstarBidirectional); + } + + // Find route by A* algorithm. + routing::Route routeFoundByAstar(""); + { + auto router = CreateRouter<routing::AStarRoutingAlgorithm>("test-astar"); + TestRouter(*router, startPos, finalPos, routeFoundByAstar); + } + + double constexpr kEpsilon = 1e-6; + TEST(my::AlmostEqualAbs(routeFoundByAstar.GetTotalDistanceMeters(), + routeFoundByAstarBidirectional.GetTotalDistanceMeters(), kEpsilon), + ()); +} + +void RoutingTest::TestTwoPointsOnFeature(m2::PointD const & startPos, m2::PointD const & finalPos) +{ + vector<pair<routing::Edge, routing::Junction>> startEdges; + GetNearestEdges(startPos, startEdges); + TEST(!startEdges.empty(), ()); + + vector<pair<routing::Edge, routing::Junction>> finalEdges; + GetNearestEdges(finalPos, finalEdges); + TEST(!finalEdges.empty(), ()); + + m2::PointD const startPosOnFeature = + GetPointOnEdge(startEdges.front().first, 0.0 /* the start point of the feature */); + m2::PointD const finalPosOnFeature = + GetPointOnEdge(finalEdges.front().first, 1.0 /* the end point of the feature */); + + TestRouters(startPosOnFeature, finalPosOnFeature); +} + +void RoutingTest::GetNearestEdges(m2::PointD const & pt, + vector<pair<routing::Edge, routing::Junction>> & edges) +{ + routing::FeaturesRoadGraph graph(m_index, m_mode, CreateModelFactory()); + graph.FindClosestEdges(pt, 1 /* count */, edges); +} diff --git a/routing/routing_benchmarks/helpers.hpp b/routing/routing_benchmarks/helpers.hpp new file mode 100644 index 0000000000..bf3a385e7a --- /dev/null +++ b/routing/routing_benchmarks/helpers.hpp @@ -0,0 +1,92 @@ +#pragma once + +#include "routing/road_graph.hpp" +#include "routing/router.hpp" +#include "routing/vehicle_model.hpp" +#include "routing/road_graph_router.hpp" + +#include "indexer/index.hpp" + +#include "storage/country_info_getter.hpp" + +#include "geometry/point2d.hpp" + +#include "std/set.hpp" +#include "std/shared_ptr.hpp" +#include "std/string.hpp" +#include "std/unique_ptr.hpp" +#include "std/utility.hpp" +#include "std/vector.hpp" + +class RoutingTest +{ +public: + RoutingTest(routing::IRoadGraph::Mode mode, set<string> const & neededMaps); + + virtual ~RoutingTest() = default; + + void TestRouters(m2::PointD const & startPos, m2::PointD const & finalPos); + void TestTwoPointsOnFeature(m2::PointD const & startPos, m2::PointD const & finalPos); + +protected: + virtual unique_ptr<routing::IDirectionsEngine> CreateDirectionsEngine() = 0; + virtual unique_ptr<routing::IVehicleModelFactory> CreateModelFactory() = 0; + + template <typename Algorithm> + unique_ptr<routing::IRouter> CreateRouter(string const & name) + { + auto getter = [&](m2::PointD const & pt) { return m_cig->GetRegionCountryId(pt); }; + unique_ptr<routing::IRoutingAlgorithm> algorithm(new Algorithm()); + unique_ptr<routing::IRouter> router( + new routing::RoadGraphRouter(name, m_index, getter, m_mode, CreateModelFactory(), + move(algorithm), CreateDirectionsEngine())); + return router; + } + + void GetNearestEdges(m2::PointD const & pt, + vector<pair<routing::Edge, routing::Junction>> & edges); + + routing::IRoadGraph::Mode const m_mode; + Index m_index; + unique_ptr<storage::CountryInfoGetter> m_cig; +}; + +template <typename Model> +class SimplifiedModelFactory : public routing::IVehicleModelFactory +{ +public: + // Since for test purposes we compare routes lengths to check + // algorithms consistency, we should use simplified vehicle model, + // where all available edges have max speed + class SimplifiedModel : public Model + { + public: + // IVehicleModel overrides: + // + // SimplifiedModel::GetSpeed() filters features and returns zero + // speed if feature is not allowed by the base model, or otherwise + // some speed depending of road type (0 <= speed <= maxSpeed). For + // tests purposes for all allowed features speed must be the same as + // max speed. + double GetSpeed(FeatureType const & f) const override + { + double const speed = Model::GetSpeed(f); + if (speed <= 0.0) + return 0.0; + return Model::GetMaxSpeed(); + } + }; + + SimplifiedModelFactory() : m_model(make_shared<SimplifiedModel>()) {} + + // IVehicleModelFactory overrides: + shared_ptr<routing::IVehicleModel> GetVehicleModel() const override { return m_model; } + shared_ptr<routing::IVehicleModel> GetVehicleModelForCountry( + string const & /*country*/) const override + { + return m_model; + } + +private: + shared_ptr<SimplifiedModel> const m_model; +}; diff --git a/routing/routing_benchmarks/pedestrian_routing_tests.cpp b/routing/routing_benchmarks/pedestrian_routing_tests.cpp new file mode 100644 index 0000000000..144688c857 --- /dev/null +++ b/routing/routing_benchmarks/pedestrian_routing_tests.cpp @@ -0,0 +1,283 @@ +#include "testing/testing.hpp" + +#include "routing/routing_benchmarks/helpers.hpp" + +#include "routing/pedestrian_directions.hpp" +#include "routing/pedestrian_model.hpp" +#include "routing/road_graph.hpp" + +#include "std/set.hpp" +#include "std/string.hpp" + +namespace +{ +// Test preconditions: files from the kMapFiles set with '.mwm' +// extension must be placed in omim/data folder. +set<string> const kMapFiles = +{ + "UK_England_East Midlands", + "UK_England_East of England_Essex", + "UK_England_East of England_Norfolk", + "UK_England_Greater London", + "UK_England_North East England", + "UK_England_North West England_Lancaster", + "UK_England_North West England_Manchester", + "UK_England_South East_Brighton", + "UK_England_South East_Oxford", + "UK_England_South West England_Bristol", + "UK_England_South West England_Cornwall", + "UK_England_West Midlands", + "UK_England_Yorkshire and the Humber" +}; + +class PedestrianTest : public RoutingTest +{ +public: + PedestrianTest() : RoutingTest(routing::IRoadGraph::Mode::IgnoreOnewayTag, kMapFiles) {} + +protected: + // RoutingTest overrides: + unique_ptr<routing::IDirectionsEngine> CreateDirectionsEngine() override + { + unique_ptr<routing::IDirectionsEngine> engine(new routing::PedestrianDirectionsEngine()); + return engine; + } + + unique_ptr<routing::IVehicleModelFactory> CreateModelFactory() override + { + unique_ptr<routing::IVehicleModelFactory> factory( + new SimplifiedModelFactory<routing::PedestrianModel>()); + return factory; + } +}; +} // namespace + +// Tests on features ------------------------------------------------------------------------------- +UNIT_CLASS_TEST(PedestrianTest, UK_Long1) +{ + TestTwoPointsOnFeature(m2::PointD(-1.88798, 61.90292), m2::PointD(-2.06025, 61.82824)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Long2) +{ + TestTwoPointsOnFeature(m2::PointD(-0.20434, 60.27445), m2::PointD(0.06962, 60.33909)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Long3) +{ + TestTwoPointsOnFeature(m2::PointD(-0.07706, 60.42876), m2::PointD(-0.11058, 60.20991)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Long4) +{ + TestTwoPointsOnFeature(m2::PointD(-0.48574, 60.05082), m2::PointD(-0.45973, 60.56715)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Long5) +{ + TestTwoPointsOnFeature(m2::PointD(0.11646, 60.57330), m2::PointD(0.05767, 59.93019)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Long6) +{ + TestTwoPointsOnFeature(m2::PointD(0.02771, 60.49348), m2::PointD(0.06533, 59.93155)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Medium1) +{ + TestTwoPointsOnFeature(m2::PointD(-0.10461, 60.29721), m2::PointD(-0.07532, 60.35180)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Medium2) +{ + TestTwoPointsOnFeature(m2::PointD(-0.17925, 60.06331), m2::PointD(-0.09959, 60.06880)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Medium3) +{ + TestTwoPointsOnFeature(m2::PointD(-0.26440, 60.16831), m2::PointD(-0.20113, 60.20884)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Medium4) +{ + TestTwoPointsOnFeature(m2::PointD(-0.25296, 60.46539), m2::PointD(-0.10975, 60.43955)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Medium5) +{ + TestTwoPointsOnFeature(m2::PointD(-0.03115, 60.31819), m2::PointD(0.07400, 60.33662)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Short1) +{ + TestTwoPointsOnFeature(m2::PointD(-0.10461, 60.29721), m2::PointD(-0.11905, 60.29747)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Short2) +{ + TestTwoPointsOnFeature(m2::PointD(-0.11092, 60.27172), m2::PointD(-0.08159, 60.27623)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Short3) +{ + TestTwoPointsOnFeature(m2::PointD(-0.09449, 60.25051), m2::PointD(-0.06520, 60.26647)); +} + +// Tests on points --------------------------------------------------------------------------------- +UNIT_CLASS_TEST(PedestrianTest, UK_Test1) +{ + TestRouters(m2::PointD(-0.23371, 60.18821), m2::PointD(-0.27958, 60.25155)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test2) +{ + TestRouters(m2::PointD(-0.23204, 60.22073), m2::PointD(-0.25325, 60.34312)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test3) +{ + TestRouters(m2::PointD(-0.13493, 60.21329), m2::PointD(-0.07502, 60.38699)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test4) +{ + TestRouters(m2::PointD(0.07362, 60.24965), m2::PointD(0.06262, 60.30536)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test6) +{ + TestRouters(m2::PointD(0.12973, 60.28698), m2::PointD(0.16166, 60.32989)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test7) +{ + TestRouters(m2::PointD(0.24339, 60.22193), m2::PointD(0.30297, 60.47235)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test9) +{ + TestRouters(m2::PointD(0.01390, 60.24852), m2::PointD(-0.01102, 60.29319)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test10) +{ + TestRouters(m2::PointD(-1.26084, 60.68840), m2::PointD(-1.34027, 60.37865)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test11) +{ + TestRouters(m2::PointD(-1.26084, 60.68840), m2::PointD(-1.34027, 60.37865)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test14) +{ + TestRouters(m2::PointD(-0.49921, 60.50093), m2::PointD(-0.42539, 60.46021)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test15) +{ + TestRouters(m2::PointD(-0.35293, 60.38324), m2::PointD(-0.27232, 60.48594)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test16) +{ + TestRouters(m2::PointD(-0.24521, 60.41771), m2::PointD(0.052673, 60.48102)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test17) +{ + TestRouters(m2::PointD(0.60492, 60.36565), m2::PointD(0.59411, 60.31529)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test19) +{ + TestRouters(m2::PointD(-0.42411, 60.22511), m2::PointD(-0.44178, 60.37796)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test20) +{ + TestRouters(m2::PointD(0.08776, 60.05433), m2::PointD(0.19336, 60.38398)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test21) +{ + TestRouters(m2::PointD(0.23038, 60.43846), m2::PointD(0.18335, 60.46692)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test22) +{ + TestRouters(m2::PointD(-0.33907, 60.691735), m2::PointD(-0.17824, 60.478512)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test23) +{ + TestRouters(m2::PointD(-0.02557, 60.41371), m2::PointD(0.05972, 60.31413)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test24) +{ + TestRouters(m2::PointD(-0.12511, 60.23813), m2::PointD(-0.27656, 60.05896)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test25) +{ + TestRouters(m2::PointD(-0.12511, 60.23813), m2::PointD(-0.27656, 60.05896)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test26) +{ + TestRouters(m2::PointD(-3.04538, 63.44428), m2::PointD(-2.98887, 63.47582)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test27) +{ + TestRouters(m2::PointD(-2.94653, 63.61187), m2::PointD(-2.83215, 63.51525)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test28) +{ + TestRouters(m2::PointD(-2.85275, 63.42478), m2::PointD(-2.88245, 63.38932)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test29) +{ + TestRouters(m2::PointD(-2.35266, 63.59979), m2::PointD(-2.29857, 63.54677)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test30) +{ + TestRouters(m2::PointD(-2.22043, 63.41066), m2::PointD(-2.29619, 63.65305)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test31) +{ + TestRouters(m2::PointD(-2.28078, 63.66735), m2::PointD(-2.25378, 63.62744)); +} + +// This is very slow pedestrian tests (more than 20 minutes). +#if defined(SLOW_TESTS) +UNIT_CLASS_TEST(PedestrianTest, UK_Test5) +{ + TestRouters(m2::PointD(0.07362, 60.24965), m2::PointD(0.06262, 60.30536)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test8) +{ + TestRouters(m2::PointD(-0.09007, 59.93887), m2::PointD(-0.36591, 60.38306)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test12) +{ + TestRouters(m2::PointD(-0.41581, 60.05507), m2::PointD(-0.00499, 60.55921)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test13) +{ + TestRouters(m2::PointD(-0.00847, 60.17501), m2::PointD(-0.38291, 60.48435)); +} + +UNIT_CLASS_TEST(PedestrianTest, UK_Test18) +{ + TestTwoPoints(m2::PointD(0.57712, 60.31156), m2::PointD(-1.09911, 59.24341)); +} +#endif diff --git a/routing/routing_benchmarks/routing_benchmarks.pro b/routing/routing_benchmarks/routing_benchmarks.pro new file mode 100644 index 0000000000..e1034ba9e0 --- /dev/null +++ b/routing/routing_benchmarks/routing_benchmarks.pro @@ -0,0 +1,23 @@ +TARGET = routing_benchmarks +CONFIG += console warn_on +CONFIG -= app_bundle +TEMPLATE = app + +ROOT_DIR = ../../ +DEPENDENCIES = map routing search storage indexer platform editor geometry coding base \ + osrm jansson protobuf tomcrypt stats_client succinct pugixml + +macx-*: LIBS *= "-framework IOKit" + +include($$ROOT_DIR/common.pri) + +QT *= core + +SOURCES += \ + ../../testing/testingmain.cpp \ + bicycle_routing_tests.cpp \ + helpers.cpp \ + pedestrian_routing_tests.cpp \ + +HEADERS += \ + helpers.hpp \ |