diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index 772975788c..77d578ae1a 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -26,10 +26,7 @@ namespace vector path(arr, arr + N); return classif().GetTypeByPath(path); } - uint32_t GetType(StringIL const & lst) - { - return classif().GetTypeByPath(lst); - } + uint32_t GetType(StringIL const & lst) { return classif().GetTypeByPath(lst); } } UNIT_TEST(OsmType_SkipDummy) @@ -130,7 +127,7 @@ UNIT_TEST(OsmType_Combined) TEST_EQUAL(params.m_Types.size(), 2, (params)); TEST(params.IsTypeExist(GetType(arr[3])), ()); - TEST(params.IsTypeExist(GetType({ "building" })), ()); + TEST(params.IsTypeExist(GetType({"building"})), ()); string s; params.name.GetString(0, s); @@ -158,7 +155,7 @@ UNIT_TEST(OsmType_Address) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "building", "address" })), ()); + TEST(params.IsTypeExist(GetType({"building", "address"})), ()); TEST_EQUAL(params.house.Get(), "223/5", ()); } @@ -184,7 +181,7 @@ UNIT_TEST(OsmType_PlaceState) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "place", "state", "USA" })), ()); + TEST(params.IsTypeExist(GetType({"place", "state", "USA"})), ()); string s; TEST(params.name.GetString(0, s), ()); @@ -234,7 +231,7 @@ UNIT_TEST(OsmType_AlabamaRiver) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "waterway", "river" })), ()); + TEST(params.IsTypeExist(GetType({"waterway", "river"})), ()); } UNIT_TEST(OsmType_Synonyms) @@ -283,7 +280,7 @@ UNIT_TEST(OsmType_Synonyms) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "amenity", "atm" })), ()); + TEST(params.IsTypeExist(GetType({"amenity", "atm"})), ()); } // "NO" tag test. @@ -301,7 +298,7 @@ UNIT_TEST(OsmType_Synonyms) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "building" })), ()); + TEST(params.IsTypeExist(GetType({"building"})), ()); } } @@ -320,7 +317,7 @@ UNIT_TEST(OsmType_Capital) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "place", "city", "capital" })), ()); + TEST(params.IsTypeExist(GetType({"place", "city", "capital"})), ()); } { @@ -336,7 +333,7 @@ UNIT_TEST(OsmType_Capital) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "place", "city" })), ()); + TEST(params.IsTypeExist(GetType({"place", "city"})), ()); } } @@ -393,7 +390,7 @@ UNIT_TEST(OsmType_Layer) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "highway", "motorway", "bridge" })), ()); + TEST(params.IsTypeExist(GetType({"highway", "motorway", "bridge"})), ()); TEST_EQUAL(params.layer, 2, ()); } @@ -411,7 +408,7 @@ UNIT_TEST(OsmType_Layer) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "highway", "trunk", "tunnel" })), ()); + TEST(params.IsTypeExist(GetType({"highway", "trunk", "tunnel"})), ()); TEST_EQUAL(params.layer, -1, ()); } @@ -428,7 +425,7 @@ UNIT_TEST(OsmType_Layer) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "highway", "secondary", "bridge" })), ()); + TEST(params.IsTypeExist(GetType({"highway", "secondary", "bridge"})), ()); TEST_EQUAL(params.layer, 1, ()); } @@ -445,7 +442,7 @@ UNIT_TEST(OsmType_Layer) ftype::GetNameAndType(&e, params); TEST_EQUAL(params.m_Types.size(), 1, (params)); - TEST(params.IsTypeExist(GetType({ "highway", "primary", "tunnel" })), ()); + TEST(params.IsTypeExist(GetType({"highway", "primary", "tunnel"})), ()); TEST_EQUAL(params.layer, -1, ()); } @@ -488,10 +485,7 @@ UNIT_TEST(OsmType_Amenity) UNIT_TEST(OsmType_Hwtag) { char const * tags[][2] = { - { "hwtag", "oneway" }, - { "hwtag", "private" }, - { "hwtag", "lit" }, - { "hwtag", "nofoot" }, + {"hwtag", "oneway"}, {"hwtag", "private"}, {"hwtag", "lit"}, {"hwtag", "nofoot"}, }; { @@ -513,11 +507,11 @@ UNIT_TEST(OsmType_Hwtag) { char const * arr[][2] = { - { "oneway", "-1" }, - { "highway", "primary" }, - { "access", "private" }, - { "lit", "no" }, - { "foot", "no" }, + {"oneway", "-1"}, + {"highway", "primary"}, + {"access", "private"}, + {"lit", "no"}, + {"foot", "no"}, }; XMLElement e; @@ -535,8 +529,7 @@ UNIT_TEST(OsmType_Hwtag) { char const * arr[][2] = { - { "foot", "yes" }, - { "highway", "primary" }, + {"foot", "yes"}, {"highway", "primary"}, }; XMLElement e; @@ -569,15 +562,15 @@ UNIT_TEST(OsmType_Ferry) TEST_EQUAL(params.m_Types.size(), 2, (params)); - uint32_t type = GetType({ "highway", "primary", "bridge" }); + uint32_t type = GetType({"highway", "primary", "bridge"}); TEST(params.IsTypeExist(type), ()); TEST(carModel.IsRoad(type), ()); - type = GetType({ "route", "ferry", "motorcar" }); + type = GetType({"route", "ferry", "motorcar"}); TEST(params.IsTypeExist(type), ()); TEST(carModel.IsRoad(type), ()); - type = GetType({ "route", "ferry" }); + type = GetType({"route", "ferry"}); TEST(!params.IsTypeExist(type), ()); TEST(!carModel.IsRoad(type), ()); } diff --git a/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp index d585c89ee2..a37b8dc9b7 100644 --- a/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp +++ b/pedestrian_routing_benchmarks/pedestrian_routing_benchmarks.cpp @@ -87,4 +87,3 @@ UNIT_TEST(PedestrianRouting_UK_Short1) { TestTwoPoints(3038057, 0, 3032688, 3); UNIT_TEST(PedestrianRouting_UK_Short2) { TestTwoPoints(2947484, 2, 44889742, 0); } UNIT_TEST(PedestrianRouting_UK_Short3) { TestTwoPoints(2931545, 0, 2969395, 0); } - diff --git a/routing/features_road_graph.hpp b/routing/features_road_graph.hpp index a142052af2..e44aa45048 100644 --- a/routing/features_road_graph.hpp +++ b/routing/features_road_graph.hpp @@ -11,7 +11,6 @@ #include "std/unique_ptr.hpp" #include "std/vector.hpp" - class Index; class FeatureType; @@ -61,4 +60,4 @@ private: uint32_t m_cacheMiss; uint32_t m_cacheAccess; }; -} // namespace routing +} // namespace routing diff --git a/routing/nearest_road_pos_finder.hpp b/routing/nearest_road_pos_finder.hpp index 693649a839..ed22d47bc9 100644 --- a/routing/nearest_road_pos_finder.hpp +++ b/routing/nearest_road_pos_finder.hpp @@ -46,7 +46,7 @@ class NearestRoadPosFinder public: NearestRoadPosFinder(m2::PointD const & point, m2::PointD const & direction, - unique_ptr const & vehicleModel) + unique_ptr const & vehicleModel) : m_point(point), m_direction(direction), m_vehicleModel(vehicleModel), diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index b6e644b946..e02c554208 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -30,9 +30,7 @@ size_t const MAX_ROAD_CANDIDATES = 2; double const FEATURE_BY_POINT_RADIUS_M = 100.0; } // namespace -RoadGraphRouter::~RoadGraphRouter() -{ -} +RoadGraphRouter::~RoadGraphRouter() {} RoadGraphRouter::RoadGraphRouter(Index const * pIndex, unique_ptr && vehicleModel) : m_vehicleModel(move(vehicleModel)), m_pIndex(pIndex) @@ -42,7 +40,10 @@ RoadGraphRouter::RoadGraphRouter(Index const * pIndex, unique_ptr size_t RoadGraphRouter::GetRoadPos(m2::PointD const & pt, vector & pos) { NearestRoadPosFinder finder(pt, m2::PointD::Zero() /* undirected */, m_vehicleModel); - auto f = [&finder](FeatureType & ft) { finder.AddInformationSource(ft); }; + auto f = [&finder](FeatureType & ft) + { + finder.AddInformationSource(ft); + }; m_pIndex->ForEachInRect( f, MercatorBounds::RectByCenterXYAndSizeInMeters(pt, FEATURE_BY_POINT_RADIUS_M), FeaturesRoadGraph::GetStreetReadScale()); @@ -100,4 +101,4 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin return resultCode; } -} // namespace routing +} // namespace routing diff --git a/routing/road_graph_router.hpp b/routing/road_graph_router.hpp index 7acd427c2a..ece16747c1 100644 --- a/routing/road_graph_router.hpp +++ b/routing/road_graph_router.hpp @@ -37,4 +37,4 @@ protected: Index const * m_pIndex; // non-owning ptr }; -} // namespace routing +} // namespace routing diff --git a/routing/routing_tests/features_road_graph_test.hpp b/routing/routing_tests/features_road_graph_test.hpp index 3b65d5b48d..ef64150d26 100644 --- a/routing/routing_tests/features_road_graph_test.hpp +++ b/routing/routing_tests/features_road_graph_test.hpp @@ -6,10 +6,8 @@ #include "std/scoped_ptr.hpp" - namespace routing_test { - class Name2IdMapping { map m_name2Id; @@ -43,7 +41,6 @@ public: void GetPossibleTurns(routing::RoadPos const & pos, routing::IRoadGraph::TurnsVectorT & vec); template - void ReconstructPath(routing::RoadPos (&arr)[N], vector & vec); + void ReconstructPath(routing::RoadPos(&arr)[N], vector & vec); }; - } diff --git a/routing/routing_tests/road_graph_nearest_turns_test.cpp b/routing/routing_tests/road_graph_nearest_turns_test.cpp index 933a77951d..cddde57ef2 100644 --- a/routing/routing_tests/road_graph_nearest_turns_test.cpp +++ b/routing/routing_tests/road_graph_nearest_turns_test.cpp @@ -87,7 +87,8 @@ UNIT_TEST(RoadGraph_NearestTurns) graph.GetNearestTurns(crossPos, turns); IRoadGraph::RoadPosVectorT actual; - for (PossibleTurn const & turn : turns) { + for (PossibleTurn const & turn : turns) + { actual.push_back(turn.m_pos); TEST_EQUAL(5, turn.m_speedKMPH, ()); TEST_EQUAL(0, turn.m_metersCovered, ()); diff --git a/routing/routing_tests/vehicle_model_test.cpp b/routing/routing_tests/vehicle_model_test.cpp index 7cdffcd188..c82935137e 100644 --- a/routing/routing_tests/vehicle_model_test.cpp +++ b/routing/routing_tests/vehicle_model_test.cpp @@ -11,13 +11,11 @@ namespace { - -routing::VehicleModel::InitListT const s_testLimits = -{ - { {"highway", "trunk"}, 150 }, - { {"highway", "primary"}, 120 }, - { {"highway", "secondary"}, 80 }, - { {"highway", "residential"}, 50 }, +routing::VehicleModel::InitListT const s_testLimits = { + {{"highway", "trunk"}, 150}, + {{"highway", "primary"}, 120}, + {{"highway", "secondary"}, 80}, + {{"highway", "residential"}, 50}, }; class TestVehicleModel : public routing::VehicleModel @@ -70,14 +68,14 @@ UNIT_TEST(VehicleModel_MaxSpeed) UNIT_TEST(VehicleModel_Speed) { - CheckSpeed({ GetType("highway", "secondary", "bridge") }, 80.0); - CheckSpeed({ GetType("highway", "secondary", "tunnel") }, 80.0); - CheckSpeed({ GetType("highway", "secondary") }, 80.0); - CheckSpeed({ GetType("highway") }, 0.0); + CheckSpeed({GetType("highway", "secondary", "bridge")}, 80.0); + CheckSpeed({GetType("highway", "secondary", "tunnel")}, 80.0); + CheckSpeed({GetType("highway", "secondary")}, 80.0); + CheckSpeed({GetType("highway")}, 0.0); - CheckSpeed({ GetType("highway", "trunk") }, 150.0); - CheckSpeed({ GetType("highway", "primary") }, 120.0); - CheckSpeed({ GetType("highway", "residential") }, 50.0); + CheckSpeed({GetType("highway", "trunk")}, 150.0); + CheckSpeed({GetType("highway", "primary")}, 120.0); + CheckSpeed({GetType("highway", "residential")}, 50.0); } UNIT_TEST(VehicleModel_Speed_MultiTypes) @@ -86,10 +84,10 @@ UNIT_TEST(VehicleModel_Speed_MultiTypes) uint32_t const typeSecondary = GetType("highway", "secondary"); uint32_t const typeHighway = GetType("highway"); - CheckSpeed({ typeTunnel, typeSecondary }, 80.0); - CheckSpeed({ typeTunnel, typeHighway }, 80.0); - CheckSpeed({ typeHighway, typeTunnel }, 80.0); - CheckSpeed({ typeHighway, typeHighway }, 0.0); + CheckSpeed({typeTunnel, typeSecondary}, 80.0); + CheckSpeed({typeTunnel, typeHighway}, 80.0); + CheckSpeed({typeHighway, typeTunnel}, 80.0); + CheckSpeed({typeHighway, typeHighway}, 0.0); } UNIT_TEST(VehicleModel_OneWay) @@ -97,13 +95,13 @@ UNIT_TEST(VehicleModel_OneWay) uint32_t const typeBridge = GetType("highway", "secondary", "bridge"); uint32_t const typeOneway = GetOnewayType(); - CheckSpeed({ typeBridge, typeOneway }, 80.0); - CheckOneWay({ typeBridge, typeOneway }, true); - CheckSpeed({ typeOneway, typeBridge }, 80.0); - CheckOneWay({ typeOneway, typeBridge }, true); + CheckSpeed({typeBridge, typeOneway}, 80.0); + CheckOneWay({typeBridge, typeOneway}, true); + CheckSpeed({typeOneway, typeBridge}, 80.0); + CheckOneWay({typeOneway, typeBridge}, true); - CheckSpeed({ typeOneway }, 0.0); - CheckOneWay({ typeOneway }, true); + CheckSpeed({typeOneway}, 0.0); + CheckOneWay({typeOneway}, true); } UNIT_TEST(VehicleModel_DifferentSpeeds) @@ -112,9 +110,9 @@ UNIT_TEST(VehicleModel_DifferentSpeeds) uint32_t const typePrimary = GetType("highway", "primary"); uint32_t const typeOneway = GetOnewayType(); - CheckSpeed({ typeSecondary, typePrimary }, 80.0); - CheckSpeed({ typePrimary, typeSecondary }, 80.0); + CheckSpeed({typeSecondary, typePrimary}, 80.0); + CheckSpeed({typePrimary, typeSecondary}, 80.0); - CheckSpeed({ typePrimary, typeOneway, typeSecondary }, 80.0); - CheckOneWay({ typePrimary, typeOneway, typeSecondary }, true); + CheckSpeed({typePrimary, typeOneway, typeSecondary}, 80.0); + CheckOneWay({typePrimary, typeOneway, typeSecondary}, true); }