mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -44,19 +44,18 @@ TestAbsentRegionsFinder::TestAbsentRegionsFinder()
|
||||
{
|
||||
m_numMwmIds = CreateNumMwmIds(m_framework.GetStorage());
|
||||
|
||||
m_countryFileGetter = [this](m2::PointD const & p) -> std::string {
|
||||
return m_callbacks.m_countryInfoGetter().GetRegionCountryId(p);
|
||||
};
|
||||
m_countryFileGetter = [this](m2::PointD const & p) -> std::string
|
||||
{ return m_callbacks.m_countryInfoGetter().GetRegionCountryId(p); };
|
||||
|
||||
m_localFileChecker = [&](std::string const & countryFile) {
|
||||
m_localFileChecker = [&](std::string const & countryFile)
|
||||
{
|
||||
MwmSet::MwmId const mwmId =
|
||||
m_callbacks.m_dataSourceGetter().GetMwmIdByCountryFile(platform::CountryFile(countryFile));
|
||||
return mwmId.IsAlive();
|
||||
};
|
||||
}
|
||||
|
||||
void TestAbsentRegionsFinder::TestRegions(Checkpoints const & checkpoints,
|
||||
std::set<std::string> const & planRegions)
|
||||
void TestAbsentRegionsFinder::TestRegions(Checkpoints const & checkpoints, std::set<std::string> const & planRegions)
|
||||
{
|
||||
std::set<std::string> const & factRegions = GetRegions(checkpoints);
|
||||
TEST_EQUAL(planRegions, factRegions, ());
|
||||
@@ -64,8 +63,7 @@ void TestAbsentRegionsFinder::TestRegions(Checkpoints const & checkpoints,
|
||||
|
||||
std::set<std::string> TestAbsentRegionsFinder::GetRegions(Checkpoints const & checkpoints)
|
||||
{
|
||||
AbsentRegionsFinder finder(m_countryFileGetter, m_localFileChecker, m_numMwmIds,
|
||||
m_callbacks.m_dataSourceGetter());
|
||||
AbsentRegionsFinder finder(m_countryFileGetter, m_localFileChecker, m_numMwmIds, m_callbacks.m_dataSourceGetter());
|
||||
RouterDelegate delegate;
|
||||
|
||||
finder.GenerateAbsentRegions(checkpoints, delegate);
|
||||
@@ -87,8 +85,7 @@ std::set<std::string> TestAbsentRegionsFinder::GetRegions(Checkpoints const & ch
|
||||
*/
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Karelia_Krasnodar)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(61.76, 34.45),
|
||||
mercator::FromLatLon(45.07, 38.94)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(61.76, 34.45), mercator::FromLatLon(45.07, 38.94)};
|
||||
|
||||
// Current test set.
|
||||
/*
|
||||
@@ -107,13 +104,18 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Karelia_Krasnodar)
|
||||
*/
|
||||
|
||||
// Organic test set.
|
||||
std::set<std::string> const planRegions{
|
||||
"Russia_Krasnodar Krai", "Russia_Leningradskaya Oblast_Southeast", "Russia_Lipetsk Oblast",
|
||||
"Russia_Moscow Oblast_East", "Russia_Republic of Karelia_South", "Russia_Rostov Oblast",
|
||||
"Russia_Ryazan Oblast", "Russia_Tula Oblast", "Russia_Tver Oblast",
|
||||
"Russia_Vologda Oblast", "Russia_Voronezh Oblast",
|
||||
"Ukraine_Luhansk Oblast"
|
||||
};
|
||||
std::set<std::string> const planRegions{"Russia_Krasnodar Krai",
|
||||
"Russia_Leningradskaya Oblast_Southeast",
|
||||
"Russia_Lipetsk Oblast",
|
||||
"Russia_Moscow Oblast_East",
|
||||
"Russia_Republic of Karelia_South",
|
||||
"Russia_Rostov Oblast",
|
||||
"Russia_Ryazan Oblast",
|
||||
"Russia_Tula Oblast",
|
||||
"Russia_Tver Oblast",
|
||||
"Russia_Vologda Oblast",
|
||||
"Russia_Voronezh Oblast",
|
||||
"Ukraine_Luhansk Oblast"};
|
||||
|
||||
TestRegions(checkpoints, planRegions);
|
||||
}
|
||||
@@ -121,12 +123,10 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Karelia_Krasnodar)
|
||||
// From "Canada_Ontario_Kingston" to "US_Maryland_and_DC".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Kingston_DC)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(45.38, -75.69),
|
||||
mercator::FromLatLon(38.91, -77.031)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(45.38, -75.69), mercator::FromLatLon(38.91, -77.031)};
|
||||
|
||||
std::set<std::string> const planRegions{"Canada_Ontario_Kingston", "US_Maryland_Baltimore",
|
||||
"US_Maryland_and_DC", "US_New York_North",
|
||||
"US_New York_West", "US_Pennsylvania_Central",
|
||||
std::set<std::string> const planRegions{"Canada_Ontario_Kingston", "US_Maryland_Baltimore", "US_Maryland_and_DC",
|
||||
"US_New York_North", "US_New York_West", "US_Pennsylvania_Central",
|
||||
"US_Pennsylvania_Scranton"};
|
||||
|
||||
TestRegions(checkpoints, planRegions);
|
||||
@@ -136,11 +136,10 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Kingston_DC)
|
||||
// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=39.95763%2C-106.79994%3B49.92034%2C-106.99302
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Colorado_Saskatchewan)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(39.95763, -106.79994),
|
||||
mercator::FromLatLon(49.92034, -106.99302)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(39.95763, -106.79994), mercator::FromLatLon(49.92034, -106.99302)};
|
||||
|
||||
std::set<std::string> const planRegions{"Canada_Saskatchewan_Saskatoon",
|
||||
"US_Colorado_Aspen", "US_Montana_East", "US_Wyoming"};
|
||||
std::set<std::string> const planRegions{"Canada_Saskatchewan_Saskatoon", "US_Colorado_Aspen", "US_Montana_East",
|
||||
"US_Wyoming"};
|
||||
|
||||
TestRegions(checkpoints, planRegions);
|
||||
}
|
||||
@@ -149,18 +148,20 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Colorado_Saskatchewan)
|
||||
// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.87763%2C4.44676%3B50.76935%2C6.42488
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Belgium_Germany)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.87763, 4.44676),
|
||||
mercator::FromLatLon(50.76935, 6.42488)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.87763, 4.44676), mercator::FromLatLon(50.76935, 6.42488)};
|
||||
|
||||
// OSRM, Valhalla with E40.
|
||||
std::set<std::string> const expected1 = {
|
||||
"Belgium_Flemish Brabant", "Belgium_Walloon Brabant", "Belgium_Liege",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen",
|
||||
"Belgium_Flemish Brabant",
|
||||
"Belgium_Walloon Brabant",
|
||||
"Belgium_Liege",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen",
|
||||
};
|
||||
|
||||
// GraphHopper with E314.
|
||||
std::set<std::string> const expected2 = {
|
||||
"Belgium_Flemish Brabant", "Belgium_Limburg",
|
||||
"Belgium_Flemish Brabant",
|
||||
"Belgium_Limburg",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen",
|
||||
"Netherlands_Limburg",
|
||||
};
|
||||
@@ -173,18 +174,17 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Belgium_Germany)
|
||||
// https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.76935%2C6.42488%3B50.78285%2C4.46508
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Germany_Belgium)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.76935, 6.42488),
|
||||
mercator::FromLatLon(50.78285, 4.46508)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.76935, 6.42488), mercator::FromLatLon(50.78285, 4.46508)};
|
||||
|
||||
// Valhalla with E40.
|
||||
std::set<std::string> const expected1 = {
|
||||
"Belgium_Flemish Brabant", "Belgium_Walloon Brabant", "Belgium_Liege", "Belgium_Limburg",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen"
|
||||
};
|
||||
std::set<std::string> const expected1 = {"Belgium_Flemish Brabant", "Belgium_Walloon Brabant", "Belgium_Liege",
|
||||
"Belgium_Limburg",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen"};
|
||||
|
||||
// OSRM, GraphHopper with E314.
|
||||
std::set<std::string> const expected2 = {
|
||||
"Belgium_Flemish Brabant", "Belgium_Limburg",
|
||||
"Belgium_Flemish Brabant",
|
||||
"Belgium_Limburg",
|
||||
"Germany_North Rhine-Westphalia_Regierungsbezirk Koln_Aachen",
|
||||
"Netherlands_Limburg",
|
||||
};
|
||||
@@ -196,8 +196,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Germany_Belgium)
|
||||
// From "Kazakhstan_South" to "Mongolia".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Kazakhstan_Mongolia)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(46.12223, 79.28636),
|
||||
mercator::FromLatLon(47.04792, 97.74559)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(46.12223, 79.28636), mercator::FromLatLon(47.04792, 97.74559)};
|
||||
|
||||
std::set<std::string> const planRegions{"Kazakhstan_South", "China_Xinjiang", "Mongolia"};
|
||||
|
||||
@@ -207,11 +206,9 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Kazakhstan_Mongolia)
|
||||
// From "Bolivia_North" to "Brazil_North Region_East".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Bolivia_Brazil)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(-16.54128, -60.83588),
|
||||
mercator::FromLatLon(-7.38744, -51.29514)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(-16.54128, -60.83588), mercator::FromLatLon(-7.38744, -51.29514)};
|
||||
|
||||
std::set<std::string> const planRegions{"Bolivia_North", "Brazil_Mato Grosso",
|
||||
"Brazil_North Region_East"};
|
||||
std::set<std::string> const planRegions{"Bolivia_North", "Brazil_Mato Grosso", "Brazil_North Region_East"};
|
||||
|
||||
TestRegions(checkpoints, planRegions);
|
||||
}
|
||||
@@ -219,8 +216,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Bolivia_Brazil)
|
||||
// From "Egypt" to "Sudan_West".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Egypt_Sudan)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(25.84571, 30.34731),
|
||||
mercator::FromLatLon(19.82398, 30.20142)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(25.84571, 30.34731), mercator::FromLatLon(19.82398, 30.20142)};
|
||||
|
||||
std::set<std::string> const planRegions{"Egypt", "Sudan_West"};
|
||||
|
||||
@@ -230,8 +226,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Egypt_Sudan)
|
||||
// From "Sudan_West" to "Chad".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Sudan_Chad)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(12.91113, 25.01158),
|
||||
mercator::FromLatLon(13.44014, 20.23824)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(12.91113, 25.01158), mercator::FromLatLon(13.44014, 20.23824)};
|
||||
|
||||
std::set<std::string> const planRegions{"Sudan_West", "Chad"};
|
||||
|
||||
@@ -241,8 +236,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Sudan_Chad)
|
||||
// From "Australia_Sydney" to "Australia_Victoria".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Sydney_Victoria)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(-35.08077, 148.45423),
|
||||
mercator::FromLatLon(-36.81267, 145.74843)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(-35.08077, 148.45423), mercator::FromLatLon(-36.81267, 145.74843)};
|
||||
|
||||
std::set<std::string> const planRegions{"Australia_Sydney", "Australia_Victoria"};
|
||||
|
||||
@@ -252,8 +246,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Sydney_Victoria)
|
||||
// From "Thailand_South" to "Cambodia".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Thailand_Cambodia)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(7.89, 98.30),
|
||||
mercator::FromLatLon(11.56, 104.86)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(7.89, 98.30), mercator::FromLatLon(11.56, 104.86)};
|
||||
|
||||
std::set<std::string> const planRegions{"Thailand_South", "Cambodia"};
|
||||
|
||||
@@ -264,8 +257,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Thailand_Cambodia)
|
||||
// RegionsRouter.
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, China)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(30.78611, 102.55829),
|
||||
mercator::FromLatLon(27.54127, 102.02502)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(30.78611, 102.55829), mercator::FromLatLon(27.54127, 102.02502)};
|
||||
|
||||
TestRegions(checkpoints, {});
|
||||
}
|
||||
@@ -273,8 +265,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, China)
|
||||
// Inside "Finland_Eastern Finland_North".
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Finland)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(63.54162, 28.71141),
|
||||
mercator::FromLatLon(64.6790, 28.73029)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(63.54162, 28.71141), mercator::FromLatLon(64.6790, 28.73029)};
|
||||
|
||||
TestRegions(checkpoints, {});
|
||||
}
|
||||
@@ -294,8 +285,7 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, BC_Alberta)
|
||||
// https://github.com/organicmaps/organicmaps/issues/1721
|
||||
UNIT_CLASS_TEST(TestAbsentRegionsFinder, Germany_Cologne_Croatia_Zagreb)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.924, 6.943),
|
||||
mercator::FromLatLon(45.806, 15.963)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(50.924, 6.943), mercator::FromLatLon(45.806, 15.963)};
|
||||
|
||||
/// @todo Optimal route should include Graz-Maribor-Zagreb.
|
||||
auto const & rgns = GetRegions(checkpoints);
|
||||
@@ -312,4 +302,4 @@ UNIT_CLASS_TEST(TestAbsentRegionsFinder, Russia_SPB_Pechory)
|
||||
TEST(!rgn.starts_with("Estonia"), ());
|
||||
}
|
||||
|
||||
} // namespace absent_regions_finder_tests
|
||||
} // namespace absent_regions_finder_tests
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
|
||||
namespace bicycle_route_test
|
||||
{
|
||||
using namespace integration;
|
||||
@@ -17,28 +16,23 @@ UNIT_TEST(RussiaMoscowSevTushinoParkPreferingBicycleWay)
|
||||
{
|
||||
// Prefer a good quality dedicated cycleway over bad quality path + footway.
|
||||
/// @todo: replace with a better case that prefers a longer cycleway to e.g. shorter track of same quality.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.87445, 37.43711), {0., 0.},
|
||||
mercator::FromLatLon(55.87203, 37.44274), 460.0);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.87445, 37.43711),
|
||||
{0., 0.}, mercator::FromLatLon(55.87203, 37.44274), 460.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaMoscowNahimovskyLongRoute)
|
||||
{
|
||||
// Get onto a secondary and follow it. Same as GraphHopper.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.66151, 37.63320), {0., 0.},
|
||||
mercator::FromLatLon(55.67695, 37.56220), 5670.0);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.66151, 37.63320),
|
||||
{0., 0.}, mercator::FromLatLon(55.67695, 37.56220), 5670.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_UseSteps)
|
||||
{
|
||||
// Use the steps as the detour is way too long.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.4403114, 37.7740223), {0., 0.},
|
||||
mercator::FromLatLon(55.439703, 37.7725059), 139.058);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.4403114, 37.7740223), {0., 0.},
|
||||
mercator::FromLatLon(55.439703, 37.7725059), 139.058);
|
||||
}
|
||||
|
||||
UNIT_TEST(Italy_AvoidSteps)
|
||||
@@ -46,57 +40,51 @@ UNIT_TEST(Italy_AvoidSteps)
|
||||
// 690m detour instead of taking a 120m shortcut via steps.
|
||||
// Same as Valhalla. But GraphHopper prefers steps.
|
||||
// https://github.com/organicmaps/organicmaps/issues/2253
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(42.4631, 14.21342), {0., 0.},
|
||||
mercator::FromLatLon(42.46343, 14.2125), 687.788);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(42.4631, 14.21342),
|
||||
{0., 0.}, mercator::FromLatLon(42.46343, 14.2125), 687.788);
|
||||
}
|
||||
|
||||
UNIT_TEST(SwedenStockholmCyclewayPriority)
|
||||
{
|
||||
/// @todo(pastk): DELETE: the cycleway is the shortest and the only obvious option here anyway, what's the value of this test?
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(59.33151, 18.09347), {0., 0.},
|
||||
mercator::FromLatLon(59.33052, 18.09391), 113.0);
|
||||
/// @todo(pastk): DELETE: the cycleway is the shortest and the only obvious option here anyway, what's the value of
|
||||
/// this test?
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(59.33151, 18.09347),
|
||||
{0., 0.}, mercator::FromLatLon(59.33052, 18.09391), 113.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(Poland_PreferCyclewayDetour)
|
||||
{
|
||||
// Prefer a longer cycleway route with a little uphill
|
||||
// rather than a 130m shorter route via a residential.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.043813, 20.016456), {0., 0.},
|
||||
mercator::FromLatLon(50.047522, 20.029986), 1354.04);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.043813, 20.016456), {0., 0.},
|
||||
mercator::FromLatLon(50.047522, 20.029986), 1354.04);
|
||||
}
|
||||
|
||||
UNIT_TEST(Poland_PreferCycleway_AvoidPrimary)
|
||||
{
|
||||
// Prefer a 180m longer and a little uphill cycleway detour to avoid a straight primary road.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.031478, 19.948912), {0., 0.},
|
||||
mercator::FromLatLon(50.036289, 19.941198), 993.818);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.031478, 19.948912), {0., 0.},
|
||||
mercator::FromLatLon(50.036289, 19.941198), 993.818);
|
||||
}
|
||||
|
||||
UNIT_TEST(NetherlandsAmsterdamBicycleNo)
|
||||
{
|
||||
// Snap start/finish point to the closest suitable road.
|
||||
// The closest road here has a bicycle=no tag so its ignored and the next closest cycleway is used.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(52.32716, 5.05932), {0., 0.},
|
||||
mercator::FromLatLon(52.32587, 5.06121), 338.0);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(52.32716, 5.05932),
|
||||
{0., 0.}, mercator::FromLatLon(52.32587, 5.06121), 338.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(NetherlandsAmsterdamBicycleYes)
|
||||
{
|
||||
// Test that a highway=unclassified gets a significant boost due to presence of bicycle=yes tag.
|
||||
/// @todo(pastk): it shouldn't as there is no cycling infra (cycleway:both=no https://www.openstreetmap.org/way/214196820)
|
||||
/// and bicycle=yes means "its legal", not "its fast", see https://github.com/organicmaps/organicmaps/issues/9593
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(52.32872, 5.07527), {0.0, 0.0},
|
||||
/// @todo(pastk): it shouldn't as there is no cycling infra (cycleway:both=no
|
||||
/// https://www.openstreetmap.org/way/214196820) and bicycle=yes means "its legal", not "its fast", see
|
||||
/// https://github.com/organicmaps/organicmaps/issues/9593
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(52.32872, 5.07527), {0.0, 0.0},
|
||||
mercator::FromLatLon(52.33853, 5.08941));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
@@ -106,20 +94,16 @@ UNIT_TEST(NetherlandsAmsterdamBicycleYes)
|
||||
UNIT_TEST(Netherlands_Amsterdam_OnewaySt_CyclewayOpposite)
|
||||
{
|
||||
// Bicycles can go against the car traffic on oneway=yes roads if there is a cycleway=opposite tag.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(52.37571, 4.88591), {0., 0.},
|
||||
mercator::FromLatLon(52.37736, 4.88744), 212.8);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(52.37571, 4.88591),
|
||||
{0., 0.}, mercator::FromLatLon(52.37736, 4.88744), 212.8);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaMoscowKashirskoe16ToCapLongRoute)
|
||||
{
|
||||
// There is no dedicated bicycle infra, except short end part. All OSM routers give different results,
|
||||
// OM yields a short and logical route shortcutting via some service roads and footways (allowed in Russia).
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.66230, 37.63214), {0., 0.},
|
||||
mercator::FromLatLon(55.68927, 37.70356), 6968.64);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.66230, 37.63214),
|
||||
{0., 0.}, mercator::FromLatLon(55.68927, 37.70356), 6968.64);
|
||||
}
|
||||
|
||||
UNIT_TEST(Germany_UseServiceCountrysideRoads)
|
||||
@@ -129,37 +113,33 @@ UNIT_TEST(Germany_UseServiceCountrysideRoads)
|
||||
// Goes by smaller roads, including service ones. Also avoids extra 60m uphill
|
||||
// of the secondary road route. Most similar to Valhalla, but 2km shorter.
|
||||
// https://github.com/organicmaps/organicmaps/issues/6027
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(49.1423, 10.068), {0., 0.},
|
||||
mercator::FromLatLon(49.3023, 10.5738), 47769.2);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(49.1423, 10.068),
|
||||
{0., 0.}, mercator::FromLatLon(49.3023, 10.5738), 47769.2);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaMoscowServicePassThrough)
|
||||
{
|
||||
// Passing through living_street and service is allowed in Russia.
|
||||
TRouteResult route =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.79649, 37.53738), {0., 0.},
|
||||
mercator::FromLatLon(55.79618, 37.54071));
|
||||
TRouteResult route = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.79649, 37.53738), {0., 0.},
|
||||
mercator::FromLatLon(55.79618, 37.54071));
|
||||
TEST_EQUAL(route.second, RouterResultCode::NoError, ());
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_Moscow_UseAllowedFootways)
|
||||
{
|
||||
// Shortcut via footways if its allowed in the country.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.6572884, 37.6142816), {0., 0.},
|
||||
mercator::FromLatLon(55.6576455, 37.6164412), 182.766);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.6572884, 37.6142816), {0., 0.},
|
||||
mercator::FromLatLon(55.6576455, 37.6164412), 182.766);
|
||||
}
|
||||
|
||||
UNIT_TEST(Spain_Barcelona_UsePedestrianAndLivingStreet)
|
||||
{
|
||||
// Don't make long detours to avoid pedestrian and living streets.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(41.40080, 2.16026), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.39937, 2.15735), 516.14 /* expectedRouteMeters */);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(41.40080, 2.16026),
|
||||
{0.0, 0.0}, mercator::FromLatLon(41.39937, 2.15735),
|
||||
516.14 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Poland_UseLivingStreet)
|
||||
@@ -167,8 +147,8 @@ UNIT_TEST(Poland_UseLivingStreet)
|
||||
// Don't make a long detour via an uphill residential to avoid a living street.
|
||||
// https://github.com/organicmaps/organicmaps/pull/9692#discussion_r1851446320
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.006085, 19.962158), {0.0, 0.0},
|
||||
mercator::FromLatLon(50.006664, 19.957639), 335.978 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(50.006085, 19.962158), {0.0, 0.0},
|
||||
mercator::FromLatLon(50.006664, 19.957639), 335.978 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Poland_UseLivingStreet2)
|
||||
@@ -176,35 +156,30 @@ UNIT_TEST(Poland_UseLivingStreet2)
|
||||
// Don't make a long detour via service and residential to avoid a living street.
|
||||
// (a more strict and longer test than above)
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.096027, 19.90433), {0.0, 0.0},
|
||||
mercator::FromLatLon(50.099875, 19.889867), 1124.7 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(50.096027, 19.90433), {0.0, 0.0},
|
||||
mercator::FromLatLon(50.099875, 19.889867), 1124.7 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaKerchStraitFerryRoute)
|
||||
{
|
||||
// Use a cross-mwm ferry.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(45.4167, 36.7658), {0.0, 0.0},
|
||||
mercator::FromLatLon(45.3653, 36.6161), 17151.4);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(45.4167, 36.7658),
|
||||
{0.0, 0.0}, mercator::FromLatLon(45.3653, 36.6161), 17151.4);
|
||||
}
|
||||
|
||||
UNIT_TEST(SwedenStockholmBicyclePastFerry)
|
||||
{
|
||||
// Several consecutive ferries.
|
||||
CalculateRouteAndTestRouteLength(
|
||||
GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(59.4725, 18.51355), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.42533, 18.35991), 14338.0);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(59.4725, 18.51355),
|
||||
{0.0, 0.0}, mercator::FromLatLon(59.42533, 18.35991), 14338.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(CrossMwmKaliningradRegionToLiepaja)
|
||||
{
|
||||
// A cross mwm route (3 regions). Includes a ferry.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(54.63519, 21.80749), {0., 0.},
|
||||
mercator::FromLatLon(56.51119, 21.01847), 266992);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(54.63519, 21.80749), {0., 0.},
|
||||
mercator::FromLatLon(56.51119, 21.01847), 266992);
|
||||
}
|
||||
|
||||
UNIT_TEST(Lithuania_Avoid_Ferry_Long_Route)
|
||||
@@ -218,19 +193,18 @@ UNIT_TEST(Lithuania_Avoid_Ferry_Long_Route)
|
||||
// OM uses a much shorter (56km vs 64km) route with bicycle=yes tracks and a short path section.
|
||||
/// @todo(pastk): the route goes through a landuse=military briefly and OM doesn't account for that.
|
||||
/// And too much preference is given to bicycle=yes track, see https://github.com/organicmaps/organicmaps/issues/9593
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.3405073, 21.4595925), {0., 0.},
|
||||
mercator::FromLatLon(55.7140174, 21.1365445), 56243.2);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.3405073, 21.4595925), {0., 0.},
|
||||
mercator::FromLatLon(55.7140174, 21.1365445), 56243.2);
|
||||
}
|
||||
|
||||
UNIT_TEST(SpainTenerifeAdejeVilaflor)
|
||||
{
|
||||
// Test on riding up from Adeje (sea level) to Vilaflor (altitude 1400 meters).
|
||||
// A long ETA due to going uphill.
|
||||
TRouteResult const res = CalculateRoute(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(28.11984, -16.72592), {0., 0.},
|
||||
mercator::FromLatLon(28.15865, -16.63704));
|
||||
TRouteResult const res =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(28.11984, -16.72592), {0., 0.},
|
||||
mercator::FromLatLon(28.15865, -16.63704));
|
||||
TEST_EQUAL(res.second, RouterResultCode::NoError, ());
|
||||
|
||||
TestRouteLength(*res.first, 26401);
|
||||
@@ -241,9 +215,9 @@ UNIT_TEST(SpainTenerifeVilaflorAdeje)
|
||||
{
|
||||
// Test on riding down from Vilaflor (altitude 1400 meters) to Adeje (sea level).
|
||||
// A short ETA going downhill.
|
||||
TRouteResult const res = CalculateRoute(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(28.15865, -16.63704), {0., 0.},
|
||||
mercator::FromLatLon(28.11984, -16.72592));
|
||||
TRouteResult const res =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(28.15865, -16.63704), {0., 0.},
|
||||
mercator::FromLatLon(28.11984, -16.72592));
|
||||
TEST_EQUAL(res.second, RouterResultCode::NoError, ());
|
||||
|
||||
TestRouteLength(*res.first, 24582);
|
||||
@@ -255,16 +229,15 @@ UNIT_TEST(Munich_OnewayBicycle1)
|
||||
{
|
||||
/// @todo Should combine TurnSlightLeft, TurnLeft, TurnLeft into UTurnLeft?
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(48.1601673, 11.5630245), {0.0, 0.0},
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(48.1601673, 11.5630245), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.1606349, 11.5631699), 264.042 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Munich_OnewayBicycle2)
|
||||
{
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(48.17819, 11.57286), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.17867, 11.57303), 201.532 /* expectedRouteMeters */);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(48.17819, 11.57286),
|
||||
{0.0, 0.0}, mercator::FromLatLon(48.17867, 11.57303),
|
||||
201.532 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(London_GreenwichTunnel)
|
||||
@@ -274,24 +247,25 @@ UNIT_TEST(London_GreenwichTunnel)
|
||||
// https://github.com/organicmaps/organicmaps/issues/8028
|
||||
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(51.4817397, -0.0100070258), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.4883739, -0.00809729298), 1183.12 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(51.4817397, -0.0100070258), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.4883739, -0.00809729298), 1183.12 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Batumi_AvoidServiceDetour)
|
||||
{
|
||||
// Go straight via a residential without a short detour via service road.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(41.6380014, 41.6269446), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.6392113, 41.6260084), 160.157 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(41.6380014, 41.6269446), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.6392113, 41.6260084), 160.157 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Gdansk_AvoidLongCyclewayDetour)
|
||||
{
|
||||
/// @todo(pastk): DELETE: the preferred route goes by a shared cycleway also - replace with a better case (the next one!)
|
||||
/// @todo(pastk): DELETE: the preferred route goes by a shared cycleway also - replace with a better case (the next
|
||||
/// one!)
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(54.2632738, 18.6771661), {0.0, 0.0},
|
||||
mercator::FromLatLon(54.2698882, 18.6765837), 760.749 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(54.2632738, 18.6771661), {0.0, 0.0},
|
||||
mercator::FromLatLon(54.2698882, 18.6765837), 760.749 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Netherlands_AvoidLongCyclewayDetour)
|
||||
@@ -299,8 +273,8 @@ UNIT_TEST(Netherlands_AvoidLongCyclewayDetour)
|
||||
// Same as GraphHopper.
|
||||
// The first sample from https://github.com/organicmaps/organicmaps/issues/1772
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(52.253405,6.182288), {0.0, 0.0},
|
||||
mercator::FromLatLon(52.247599,6.197973), 1440.8 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(52.253405, 6.182288), {0.0, 0.0},
|
||||
mercator::FromLatLon(52.247599, 6.197973), 1440.8 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Poland_AvoidDetourAndExtraCrossings)
|
||||
@@ -311,18 +285,18 @@ UNIT_TEST(Poland_AvoidDetourAndExtraCrossings)
|
||||
// for more aggressive ones depending on light phase to go through one traffic light only).
|
||||
// https://github.com/organicmaps/organicmaps/issues/7954
|
||||
// https://github.com/organicmaps/organicmaps/pull/9692#discussion_r1849627559
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(50.08227, 20.03348), {0.0, 0.0},
|
||||
mercator::FromLatLon(50.08253, 20.03191), 157.7 /* expectedRouteMeters */);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(50.08227, 20.03348),
|
||||
{0.0, 0.0}, mercator::FromLatLon(50.08253, 20.03191),
|
||||
157.7 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Germany_DontAvoidNocyclewayResidential)
|
||||
{
|
||||
// No strange detours to avoid a nocycleway residential. Same as GraphHopper.
|
||||
// https://github.com/organicmaps/organicmaps/issues/4059#issuecomment-1399338757
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(51.33772, 12.41432), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.33837, 12.40958), 359.495 /* expectedRouteMeters */);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(51.33772, 12.41432),
|
||||
{0.0, 0.0}, mercator::FromLatLon(51.33837, 12.40958),
|
||||
359.495 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(UK_UseNocyclewayTertiary)
|
||||
@@ -330,8 +304,8 @@ UNIT_TEST(UK_UseNocyclewayTertiary)
|
||||
// A preferred route is through nocycleway tertiary roads. Same as all OSM routers.
|
||||
// The detour is via a shared cycleway and with 130m less alt gain, but is 4km longer.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(51.3826906, -2.3481788), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.3615095, -2.3114138), 4468.83 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(51.3826906, -2.3481788), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.3615095, -2.3114138), 4468.83 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Germany_UseResidential)
|
||||
@@ -339,8 +313,8 @@ UNIT_TEST(Germany_UseResidential)
|
||||
// No long detour to avoid a short residential.
|
||||
// https://github.com/organicmaps/organicmaps/issues/9330
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(48.1464472, 11.5589919), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.1418297, 11.5602123), 614.963 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(48.1464472, 11.5589919), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.1418297, 11.5602123), 614.963 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Belarus_StraightFootway)
|
||||
@@ -348,16 +322,16 @@ UNIT_TEST(Belarus_StraightFootway)
|
||||
// Prefer footways over roads in Belarus due to local laws.
|
||||
// https://github.com/organicmaps/organicmaps/issues/4145
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(53.8670285, 30.3162749), {0.0, 0.0},
|
||||
mercator::FromLatLon(53.876436, 30.3348084), 1613.34 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(53.8670285, 30.3162749), {0.0, 0.0},
|
||||
mercator::FromLatLon(53.876436, 30.3348084), 1613.34 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Spain_Madrid_DedicatedCycleway)
|
||||
{
|
||||
// Check that OM uses dedicated "Carril bici del Paseo de la Castellana".
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(40.459616, -3.690031), {0.0, 0.0},
|
||||
mercator::FromLatLon(40.4403523, -3.69267444), 2283.89 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(40.459616, -3.690031), {0.0, 0.0},
|
||||
mercator::FromLatLon(40.4403523, -3.69267444), 2283.89 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Seoul_ElevationDetour)
|
||||
@@ -367,8 +341,8 @@ UNIT_TEST(Seoul_ElevationDetour)
|
||||
// Valhalla and GraphHopper prefer a longer route also.
|
||||
// https://github.com/organicmaps/organicmaps/issues/7047
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(37.510519, 127.101251), {0.0, 0.0},
|
||||
mercator::FromLatLon(37.513874, 127.099234), 663.547 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(37.510519, 127.101251), {0.0, 0.0},
|
||||
mercator::FromLatLon(37.513874, 127.099234), 663.547 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Spain_Zaragoza_Fancy_NoBicycle_Crossings)
|
||||
@@ -376,8 +350,8 @@ UNIT_TEST(Spain_Zaragoza_Fancy_NoBicycle_Crossings)
|
||||
// A highway=crossing node https://www.openstreetmap.org/node/258776322 on the way
|
||||
// has bicycle=no, which doesn't prevent routing along this road.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(41.6523561, -0.881151311), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.6476614, -0.885694674), 649.855 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(41.6523561, -0.881151311), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.6476614, -0.885694674), 649.855 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Germany_Use_Bicycle_Track)
|
||||
@@ -386,8 +360,8 @@ UNIT_TEST(Germany_Use_Bicycle_Track)
|
||||
/// @todo Still prefers a no-cycling-infra but bicycle=yes secondary rather than a paved track,
|
||||
/// see https://github.com/organicmaps/organicmaps/issues/1201#issuecomment-946042937
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(48.420723, 9.90350146), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.4080367, 9.86597073), 3778.41 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(48.420723, 9.90350146), {0.0, 0.0},
|
||||
mercator::FromLatLon(48.4080367, 9.86597073), 3778.41 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Finland_Use_Tertiary_LowTraffic)
|
||||
@@ -396,8 +370,8 @@ UNIT_TEST(Finland_Use_Tertiary_LowTraffic)
|
||||
// https://github.com/orgs/organicmaps/discussions/5158#discussioncomment-5938807
|
||||
/// @todo(pastk): prefer roads with lower maxspeed.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(61.5445696, 23.9394003), {0.0, 0.0},
|
||||
mercator::FromLatLon(61.6153965, 23.876755), 9876.65 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(61.5445696, 23.9394003), {0.0, 0.0},
|
||||
mercator::FromLatLon(61.6153965, 23.876755), 9876.65 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Belarus_Stolbcy_Use_Unpaved)
|
||||
@@ -406,18 +380,17 @@ UNIT_TEST(Belarus_Stolbcy_Use_Unpaved)
|
||||
// Closer as GraphHopper. Valhalla detours the unpaved street.
|
||||
// OSRM shortcuts through paths and a ford.
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(53.471389, 26.7422186), {0.0, 0.0},
|
||||
mercator::FromLatLon(53.454082, 26.7560061), 4620.81 /* expectedRouteMeters */);
|
||||
mercator::FromLatLon(53.471389, 26.7422186), {0.0, 0.0},
|
||||
mercator::FromLatLon(53.454082, 26.7560061), 4620.81 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_UseTrunk_Long)
|
||||
{
|
||||
// Prefer riding via a straight trunk road instead of taking a long +30% detour via smaller roads.
|
||||
/// @todo(pastk): DELETE: This test is controversial as this route has sections with longer relative trunk-avoiding detours
|
||||
/// e.g. from 67.9651692,32.8685132 to 68.022093,32.9654391 its +40% longer via a teriary and its OK?
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(66.271, 33.048), {0.0, 0.0},
|
||||
mercator::FromLatLon(68.95, 33.045), 404262 /* expectedRouteMeters */);
|
||||
/// @todo(pastk): DELETE: This test is controversial as this route has sections with longer relative trunk-avoiding
|
||||
/// detours e.g. from 67.9651692,32.8685132 to 68.022093,32.9654391 its +40% longer via a teriary and its OK?
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(66.271, 33.048),
|
||||
{0.0, 0.0}, mercator::FromLatLon(68.95, 33.045), 404262 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
/// @todo(pastk): find a good "avoid trunk" test case where trunk allows cycling.
|
||||
@@ -455,7 +428,8 @@ UNIT_TEST(UK_ForbidGates_WithoutAccess)
|
||||
// A barrier=gate without explicit access leads to a long detour.
|
||||
// https://www.openstreetmap.org/node/6993853766
|
||||
/// @todo OSRM/Valhalla/GraphHopper ignore such gates,
|
||||
/// see https://www.openstreetmap.org/directions?engine=fossgis_valhalla_bicycle&route=51.3579329%2C-2.3137701%3B51.3574666%2C-2.3152644
|
||||
/// see
|
||||
/// https://www.openstreetmap.org/directions?engine=fossgis_valhalla_bicycle&route=51.3579329%2C-2.3137701%3B51.3574666%2C-2.3152644
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(51.3579329, -2.3137701), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.3574666, -2.31526436), 1149.28);
|
||||
@@ -472,4 +446,4 @@ UNIT_TEST(UK_Canterbury_AvoidDismount)
|
||||
mercator::FromLatLon(51.2818863, 1.05725286), 976);
|
||||
}
|
||||
|
||||
} // namespace bicycle_route_test
|
||||
} // namespace bicycle_route_test
|
||||
|
||||
@@ -13,9 +13,9 @@ using namespace routing::turns;
|
||||
|
||||
UNIT_TEST(RussiaMoscowSevTushinoParkBicycleWayTurnTest)
|
||||
{
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.87467, 37.43658), {0.0, 0.0}, mercator::FromLatLon(55.8719, 37.4464));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.87467, 37.43658), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.8719, 37.4464));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -31,10 +31,9 @@ UNIT_TEST(RussiaMoscowSevTushinoParkBicycleWayTurnTest)
|
||||
|
||||
UNIT_TEST(SpainTenerifeSlightTurnMain_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(28.09214, -16.73121), {0.0, 0.0},
|
||||
mercator::FromLatLon(28.09227, -16.7303));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(28.09214, -16.73121), {0.0, 0.0},
|
||||
mercator::FromLatLon(28.09227, -16.7303));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -48,10 +47,9 @@ UNIT_TEST(SpainTenerifeSlightTurnMain_TurnTest)
|
||||
|
||||
UNIT_TEST(RussiaMoscowGerPanfilovtsev22BicycleWayTurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.85630, 37.41004), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.85717, 37.41052));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.85630, 37.41004), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.85717, 37.41052));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -67,9 +65,9 @@ UNIT_TEST(Russia_Moscow_SalameiNerisPossibleTurnCorrectionBicycleWay_TurnTest)
|
||||
{
|
||||
using namespace integration;
|
||||
|
||||
TRouteResult const routeResult = CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.85854, 37.36795), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.85364, 37.37318));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.85854, 37.36795),
|
||||
{0.0, 0.0}, mercator::FromLatLon(55.85364, 37.37318));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -88,9 +86,9 @@ UNIT_TEST(Russia_Moscow_SalameiNerisNoUTurnBicycleWay_TurnTest)
|
||||
{
|
||||
using namespace integration;
|
||||
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.85854, 37.36795), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.85765, 37.36793));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.85854, 37.36795), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.85765, 37.36793));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -118,8 +116,8 @@ UNIT_TEST(Russia_Moscow_SalameiNerisNoUTurnBicycleWay_TurnTest)
|
||||
UNIT_TEST(RussiaMoscowSevTushinoParkBicycleOnePointOnewayRoadTurnTest)
|
||||
{
|
||||
m2::PointD const point = mercator::FromLatLon(55.8719, 37.4464);
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle), point, {0.0, 0.0}, point);
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), point, {0.0, 0.0}, point);
|
||||
|
||||
RouterResultCode const result = routeResult.second;
|
||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||
@@ -128,8 +126,8 @@ UNIT_TEST(RussiaMoscowSevTushinoParkBicycleOnePointOnewayRoadTurnTest)
|
||||
UNIT_TEST(RussiaMoscowSevTushinoParkBicycleOnePointTwowayRoadTurnTest)
|
||||
{
|
||||
m2::PointD const point = mercator::FromLatLon(55.87102, 37.44222);
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Bicycle), point, {0.0, 0.0}, point);
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle), point, {0.0, 0.0}, point);
|
||||
|
||||
RouterResultCode const result = routeResult.second;
|
||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||
@@ -137,10 +135,9 @@ UNIT_TEST(RussiaMoscowSevTushinoParkBicycleOnePointTwowayRoadTurnTest)
|
||||
|
||||
UNIT_TEST(Russia_Moscow_TatishchevaOnewayCarRoad_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.71566, 37.61568), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.71519, 37.61566));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.71566, 37.61568), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.71519, 37.61566));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -158,10 +155,9 @@ UNIT_TEST(Russia_Moscow_TatishchevaOnewayCarRoad_TurnTest)
|
||||
|
||||
UNIT_TEST(Russia_Moscow_SvobodiOnewayBicycleWay_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.87277, 37.44002), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.87362, 37.43853));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.87277, 37.44002), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.87362, 37.43853));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -181,10 +177,9 @@ UNIT_TEST(Russia_Moscow_SvobodiOnewayBicycleWay_TurnTest)
|
||||
|
||||
UNIT_TEST(TurnsNearAltufievskoeShosseLongFakeSegmentTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.91569, 37.58972), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.9162315, 37.5861694));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.91569, 37.58972), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.9162315, 37.5861694));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -208,10 +203,9 @@ UNIT_TEST(TurnsNearAltufievskoeShosseLongFakeSegmentTest)
|
||||
|
||||
UNIT_TEST(TurnsNearMoscowRiverShortFakeSegmentTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.71484, 37.54868), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.71586, 37.54594));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.71484, 37.54868), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.71586, 37.54594));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -231,9 +225,9 @@ UNIT_TEST(TurnsNearMKAD85kmShortFakeSegmentTest)
|
||||
{
|
||||
using namespace integration;
|
||||
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.91788, 37.58603), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.91684, 37.57884));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Bicycle), mercator::FromLatLon(55.91788, 37.58603), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.91684, 37.57884));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -261,10 +255,9 @@ UNIT_TEST(TurnsNearMKAD85kmShortFakeSegmentTest)
|
||||
|
||||
UNIT_TEST(TurnsNearKhladkombinatTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.86973, 37.45825), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.87020, 37.46011));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Bicycle),
|
||||
mercator::FromLatLon(55.86973, 37.45825), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.87020, 37.46011));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -278,4 +271,4 @@ UNIT_TEST(TurnsNearKhladkombinatTest)
|
||||
integration::GetNthTurn(route, 1).TestValid().TestDirection(CarDirection::TurnLeft);
|
||||
integration::GetNthTurn(route, 2).TestValid().TestDirection(CarDirection::TurnRight);
|
||||
}
|
||||
} // namespace bicycle_turn_test
|
||||
} // namespace bicycle_turn_test
|
||||
|
||||
@@ -47,8 +47,7 @@ void TestConcurrentAccessToFeatures(string const & mwm)
|
||||
// If hardware_concurrency() returns 1 it means that only one core is available.
|
||||
// In the both cases 2 threads should be used for this test.
|
||||
auto const threadNumber = max(thread::hardware_concurrency(), static_cast<unsigned int>(2));
|
||||
LOG(LINFO, ("Parsing geometry of", featureNumber, "features in", threadNumber,
|
||||
"threads simultaneously.", local));
|
||||
LOG(LINFO, ("Parsing geometry of", featureNumber, "features in", threadNumber, "threads simultaneously.", local));
|
||||
|
||||
mutex guardCtorMtx;
|
||||
auto parseGeometries = [&](vector<m2::PointD> & points)
|
||||
@@ -96,8 +95,7 @@ UNIT_TEST(ConcurrentFeatureParsingTest)
|
||||
{
|
||||
classificator::Load();
|
||||
|
||||
vector<string> const mwms = {"Russia_Moscow", "Nepal_Kathmandu",
|
||||
"Netherlands_North Holland_Amsterdam"};
|
||||
vector<string> const mwms = {"Russia_Moscow", "Nepal_Kathmandu", "Netherlands_North Holland_Amsterdam"};
|
||||
|
||||
for (auto const & mwm : mwms)
|
||||
TestConcurrentAccessToFeatures(mwm);
|
||||
|
||||
@@ -23,23 +23,21 @@ UNIT_TEST(CrossCountry_EAEU_Borders_Russia_to_Russia_through_Belarus)
|
||||
{
|
||||
/// @todo Uses tertiary instead of longer (7km) primary. Can't say fo sure is it ok or not, but looks good.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(53.83281, 32.47602) /* startPoint */, {0.0, 0.0} /* startDirection */,
|
||||
mercator::FromLatLon(52.79681, 32.98167) /* finalPoint */, 188'085 /* expectedRouteMeters */);
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(53.83281, 32.47602) /* startPoint */,
|
||||
{0.0, 0.0} /* startDirection */, mercator::FromLatLon(52.79681, 32.98167) /* finalPoint */,
|
||||
188'085 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_UsePrimaryDetour_NotSecondaryTown)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(50.215143, 39.4498585), {0.0, 0.0},
|
||||
mercator::FromLatLon(49.9025281, 40.5213712), 123949);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(50.215143, 39.4498585), {0.0, 0.0},
|
||||
mercator::FromLatLon(49.9025281, 40.5213712), 123949);
|
||||
|
||||
/// @todo Should prefer trunk detour with maxspeed=90 than secondary with maxspeed=60.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(45.2849983, 38.2432247), {0.0, 0.0},
|
||||
mercator::FromLatLon(45.237346, 38.0046459), 28534.8);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(45.2849983, 38.2432247), {0.0, 0.0},
|
||||
mercator::FromLatLon(45.237346, 38.0046459), 28534.8);
|
||||
}
|
||||
|
||||
// In this case the shortest way from Belgorod oblast to Crimea is through Ukraine. But we add
|
||||
@@ -51,14 +49,12 @@ UNIT_TEST(CrossCountry_Russia_Belgorod_Oblast_to_Crimea)
|
||||
// This routes go via Russia only.
|
||||
// Some subroutes are checked in Russia_UsePrimaryDetour_NotSecondaryTown.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(50.39589, 38.83377) /* startPoint */, {0.0, 0.0} /* startDirection */,
|
||||
mercator::FromLatLon(45.06336, 34.48566) /* finalPoint */, 1'144'970);
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(50.39589, 38.83377) /* startPoint */,
|
||||
{0.0, 0.0} /* startDirection */, mercator::FromLatLon(45.06336, 34.48566) /* finalPoint */, 1'144'970);
|
||||
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(50.39589, 38.83377) /* startPoint */, {0.0, 0.0} /* startDirection */,
|
||||
mercator::FromLatLon(45.1048391, 35.1297058) /* finalPoint */, 1'096'360);
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(50.39589, 38.83377) /* startPoint */,
|
||||
{0.0, 0.0} /* startDirection */, mercator::FromLatLon(45.1048391, 35.1297058) /* finalPoint */, 1'096'360);
|
||||
}
|
||||
|
||||
// In this case the shortest way from Lithuania to Poland is through Russia, Kaliningrad Oblast. But
|
||||
@@ -67,9 +63,9 @@ UNIT_TEST(CrossCountry_Russia_Belgorod_Oblast_to_Crimea)
|
||||
UNIT_TEST(CrossCountry_Lithuania_to_Poland)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(55.10055, 22.30228) /* startPoint */, {0.0, 0.0} /* startDirection */,
|
||||
mercator::FromLatLon(54.27745, 22.33767) /* finalPoint */, 191'963 /* expectedRouteMeters */);
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(55.10055, 22.30228) /* startPoint */,
|
||||
{0.0, 0.0} /* startDirection */, mercator::FromLatLon(54.27745, 22.33767) /* finalPoint */,
|
||||
191'963 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
// In this case the shortest way from Hungary to Slovakia is through Ukraine. But we add penalty for
|
||||
@@ -78,7 +74,7 @@ UNIT_TEST(CrossCountry_Lithuania_to_Poland)
|
||||
UNIT_TEST(CrossCountry_Hungary_to_Slovakia)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(48.39107, 22.18352) /* startPoint */, {0.0, 0.0} /* startDirection */,
|
||||
mercator::FromLatLon(48.69826, 22.23454) /* finalPoint */, 100'015 /* expectedRouteMeters */);
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(48.39107, 22.18352) /* startPoint */,
|
||||
{0.0, 0.0} /* startDirection */, mercator::FromLatLon(48.69826, 22.23454) /* finalPoint */,
|
||||
100'015 /* expectedRouteMeters */);
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ public:
|
||||
MwmValue const * GetValue() { return m_handle.GetValue(); }
|
||||
};
|
||||
|
||||
void TestAltitudeOfAllMwmFeatures(string const & countryId,
|
||||
Altitude const altitudeLowerBoundMeters,
|
||||
void TestAltitudeOfAllMwmFeatures(string const & countryId, Altitude const altitudeLowerBoundMeters,
|
||||
Altitude const altitudeUpperBoundMeters)
|
||||
{
|
||||
FeaturesGuard features(countryId);
|
||||
@@ -89,8 +88,7 @@ UNIT_TEST(GetAltitude_AllMwmFeaturesTest)
|
||||
{
|
||||
classificator::Load();
|
||||
|
||||
TestAltitudeOfAllMwmFeatures("Russia_Moscow", 50 /* altitudeLowerBoundMeters */,
|
||||
300 /* altitudeUpperBoundMeters */);
|
||||
TestAltitudeOfAllMwmFeatures("Russia_Moscow", 50 /* altitudeLowerBoundMeters */, 300 /* altitudeUpperBoundMeters */);
|
||||
TestAltitudeOfAllMwmFeatures("Nepal_Kathmandu", 250 /* altitudeLowerBoundMeters */,
|
||||
6000 /* altitudeUpperBoundMeters */);
|
||||
TestAltitudeOfAllMwmFeatures("Netherlands_North Holland_Amsterdam", -25 /* altitudeLowerBoundMeters */,
|
||||
|
||||
@@ -47,8 +47,7 @@ void ReverseCheckpoints(Checkpoints const & checkpoints)
|
||||
UNIT_TEST(Guides_TwoPointsOnTrack)
|
||||
{
|
||||
// Checkpoints lie on the track.
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.14367, 11.57257),
|
||||
mercator::FromLatLon(48.13999, 11.56873)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.14367, 11.57257), mercator::FromLatLon(48.13999, 11.56873)};
|
||||
|
||||
double const expectedDistM = 600.8;
|
||||
double const expectedTimeS = 721.0;
|
||||
@@ -64,8 +63,7 @@ UNIT_TEST(Guides_TwoPointsOnTrack)
|
||||
UNIT_TEST(Guides_TwoPointsOnTrackOneViaOsm)
|
||||
{
|
||||
// Start is further from track then |kEqDistToTrackPointM|, but finish is closer.
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.13998, 11.56982),
|
||||
mercator::FromLatLon(48.14448, 11.57259)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.13998, 11.56982), mercator::FromLatLon(48.14448, 11.57259)};
|
||||
|
||||
double const expectedDistM = 788.681;
|
||||
double const expectedTimeS = 903.3;
|
||||
@@ -91,8 +89,7 @@ UNIT_TEST(Guides_FinishPointOnTrack)
|
||||
// route through the track and the second part - through the OSM roads.
|
||||
UNIT_TEST(Guides_StartPointOnTrack)
|
||||
{
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.14168, 11.57244),
|
||||
mercator::FromLatLon(48.13741, 11.56095)};
|
||||
Checkpoints const checkpoints{mercator::FromLatLon(48.14168, 11.57244), mercator::FromLatLon(48.13741, 11.56095)};
|
||||
|
||||
TestGuideRoute(checkpoints, 1200.45 /* expectedDistM */, 1056.45 /* expectedTimeS */, 52 /* expectedPointsCount */);
|
||||
}
|
||||
@@ -100,11 +97,10 @@ UNIT_TEST(Guides_StartPointOnTrack)
|
||||
// Start and finish lie on the track; 3 intermediate points are far away from the track.
|
||||
UNIT_TEST(Guides_MultipleIntermediatePoints)
|
||||
{
|
||||
Checkpoints const checkpoints(
|
||||
{mercator::FromLatLon(48.14403, 11.57259), mercator::FromLatLon(48.14439, 11.57480),
|
||||
mercator::FromLatLon(48.14192, 11.57548), mercator::FromLatLon(48.14106, 11.57279),
|
||||
mercator::FromLatLon(48.14044, 11.57061)});
|
||||
Checkpoints const checkpoints({mercator::FromLatLon(48.14403, 11.57259), mercator::FromLatLon(48.14439, 11.57480),
|
||||
mercator::FromLatLon(48.14192, 11.57548), mercator::FromLatLon(48.14106, 11.57279),
|
||||
mercator::FromLatLon(48.14044, 11.57061)});
|
||||
|
||||
TestGuideRoute(checkpoints, 1231.91 /* expectedDistM */, 1042.65 /* expectedTimeS */, 67 /* expectedPointsCount */);
|
||||
}
|
||||
} // namespace guides_tests
|
||||
} // namespace guides_tests
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
|
||||
namespace pedestrian_route_test
|
||||
{
|
||||
using namespace routing;
|
||||
@@ -16,50 +15,44 @@ using mercator::FromLatLon;
|
||||
|
||||
UNIT_TEST(GermanyBremenJunctionToCycleway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.41947, 10.75148), {0., 0.},
|
||||
mercator::FromLatLon(52.41868, 10.75274), 137.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.41947, 10.75148), {0., 0.},
|
||||
mercator::FromLatLon(52.41868, 10.75274), 137.);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad424aTo1207)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9963, 37.2036), {0., 0.},
|
||||
mercator::FromLatLon(55.9955, 37.1948), 659.213);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9963, 37.2036), {0., 0.},
|
||||
mercator::FromLatLon(55.9955, 37.1948), 659.213);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad924aTo418)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9999, 37.2021), 2447.75);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9999, 37.2021), 2447.75);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad924aToFilaretovskyChurch)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9915, 37.1808), 1194.84);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9915, 37.1808), 1194.84);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad924aTo1145)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9924, 37.1853), 1162.74);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9924, 37.1853), 1162.74);
|
||||
}
|
||||
|
||||
UNIT_TEST(MoscowMuzeonToLebedinoeOzeroGorkyPark)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.7348, 37.606), {0., 0.},
|
||||
mercator::FromLatLon(55.724, 37.5956), 1640.0);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.7348, 37.606), {0., 0.},
|
||||
mercator::FromLatLon(55.724, 37.5956), 1640.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad315parkingToMusicSchoolBus_BadRoute)
|
||||
@@ -71,338 +64,297 @@ UNIT_TEST(Zgrad315parkingToMusicSchoolBus_BadRoute)
|
||||
// mercator::FromLatLon(55.999963, 37.2179159), 164.);
|
||||
|
||||
// A bit far end point and the route is ok.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9996, 37.2174), {0., 0.},
|
||||
mercator::FromLatLon(55.9999757, 37.217925), 165.423);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9996, 37.2174), {0., 0.},
|
||||
mercator::FromLatLon(55.9999757, 37.217925), 165.423);
|
||||
}
|
||||
|
||||
UNIT_TEST(Zgrad924aToKrukovo)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9802, 37.1736), 1030);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.9844, 37.1808), {0., 0.},
|
||||
mercator::FromLatLon(55.9802, 37.1736), 1030);
|
||||
}
|
||||
|
||||
UNIT_TEST(MoscowMailRuStarbucksToPetrovskoRazumovskyAlley)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.7971, 37.5376), {0., 0.},
|
||||
mercator::FromLatLon(55.7953, 37.5597), 1802.31);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.7971, 37.5376), {0., 0.},
|
||||
mercator::FromLatLon(55.7953, 37.5597), 1802.31);
|
||||
}
|
||||
|
||||
UNIT_TEST(AustraliaMelburn_AvoidMotorway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(-37.7936, 144.985), {0., 0.},
|
||||
mercator::FromLatLon(-37.7896, 145.025), 4659.5);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(-37.7936, 144.985), {0., 0.},
|
||||
mercator::FromLatLon(-37.7896, 145.025), 4659.5);
|
||||
}
|
||||
|
||||
UNIT_TEST(AustriaWein_AvoidTrunk)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(48.233, 16.3562), {0., 0.},
|
||||
mercator::FromLatLon(48.2458, 16.3704), 2172.23);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(48.233, 16.3562), {0., 0.},
|
||||
mercator::FromLatLon(48.2458, 16.3704), 2172.23);
|
||||
}
|
||||
|
||||
UNIT_TEST(FranceParis_AvoidBridleway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(48.859, 2.25452), {0., 0.},
|
||||
mercator::FromLatLon(48.8634, 2.24315), 1049.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(48.859, 2.25452), {0., 0.},
|
||||
mercator::FromLatLon(48.8634, 2.24315), 1049.);
|
||||
}
|
||||
|
||||
UNIT_TEST(HungaryBudapest_AvoidMotorway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.56566, 19.14942), {0., 0.},
|
||||
mercator::FromLatLon(47.593, 19.24018), 10179.6);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.56566, 19.14942), {0., 0.},
|
||||
mercator::FromLatLon(47.593, 19.24018), 10179.6);
|
||||
}
|
||||
|
||||
UNIT_TEST(PolandWarshaw_AvoidCycleway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.2487, 21.0173), {0., 0.},
|
||||
mercator::FromLatLon(52.25, 21.0164), 182.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.2487, 21.0173), {0., 0.},
|
||||
mercator::FromLatLon(52.25, 21.0164), 182.);
|
||||
}
|
||||
|
||||
UNIT_TEST(SwedenStockholmSlussenHiltonToMaritimeMuseum)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.32046, 18.06924), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.32751, 18.09092), 3445.22);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.32046, 18.06924), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.32751, 18.09092), 3445.22);
|
||||
}
|
||||
|
||||
UNIT_TEST(SwedenStockholmSlussenHiltonToAfChapmanHostel)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.32045, 18.06928), {0., 0.},
|
||||
mercator::FromLatLon(59.3254, 18.08022), 2170.87);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.32045, 18.06928), {0., 0.},
|
||||
mercator::FromLatLon(59.3254, 18.08022), 2170.87);
|
||||
}
|
||||
|
||||
UNIT_TEST(EstoniaTallinnRadissonHiltonToCatherdalChurch)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.4362, 24.7682), {0., 0.},
|
||||
mercator::FromLatLon(59.437, 24.7392), 1972.54);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.4362, 24.7682), {0., 0.},
|
||||
mercator::FromLatLon(59.437, 24.7392), 1972.54);
|
||||
}
|
||||
|
||||
UNIT_TEST(EstoniaTallinnRadissonHiltonToSkypeOffice)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.4362, 24.7682), {0., 0.},
|
||||
mercator::FromLatLon(59.3971, 24.661), 8673.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.4362, 24.7682), {0., 0.},
|
||||
mercator::FromLatLon(59.3971, 24.661), 8673.);
|
||||
}
|
||||
|
||||
UNIT_TEST(BelarusMinksHotelYubileyniToChurchSaintsSimonAndHelen)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.9112, 27.5466), {0., 0.},
|
||||
mercator::FromLatLon(53.8965, 27.5476), 2151.28);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.9112, 27.5466), {0., 0.},
|
||||
mercator::FromLatLon(53.8965, 27.5476), 2151.28);
|
||||
}
|
||||
|
||||
UNIT_TEST(BelarusMinksBarURatushiToMoscowBusStation)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.9045, 27.5569), {0., 0.},
|
||||
mercator::FromLatLon(53.889, 27.5466), 2395.3);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.9045, 27.5569), {0., 0.},
|
||||
mercator::FromLatLon(53.889, 27.5466), 2395.3);
|
||||
}
|
||||
|
||||
UNIT_TEST(BelarusBobruisk50LetVlksmToSanatoryShinnik)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.1638, 29.1804), {0., 0.},
|
||||
mercator::FromLatLon(53.179, 29.1682), 2400.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.1638, 29.1804), {0., 0.},
|
||||
mercator::FromLatLon(53.179, 29.1682), 2400.);
|
||||
}
|
||||
|
||||
UNIT_TEST(BelarusBobruisk50LetVlksmToArena)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.1638, 29.1804), {0., 0.},
|
||||
mercator::FromLatLon(53.1424, 29.2467), 6123.0);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.1638, 29.1804), {0., 0.},
|
||||
mercator::FromLatLon(53.1424, 29.2467), 6123.0);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogSyzranov10k3ToSoftech)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2, 38.8878), 3752.68);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2, 38.8878), 3752.68);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogSyzranov10k3ToTruseE)
|
||||
{
|
||||
// In the end prefers longer footway instead of secondary (no other tags).
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2048, 38.9441), 7536.52);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2048, 38.9441), 7536.52);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogSyzranov10k3ToLazo5k2)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2584, 38.9128), 7563.05);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2183, 38.8634), {0., 0.},
|
||||
mercator::FromLatLon(47.2584, 38.9128), 7563.05);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogJukova2ToBolBulvarnaya8)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2768, 38.9282), {0., 0.},
|
||||
mercator::FromLatLon(47.2412, 38.8902), 6239.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2768, 38.9282), {0., 0.},
|
||||
mercator::FromLatLon(47.2412, 38.8902), 6239.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogCheckhova267k2ToKotlostroy33)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2200, 38.8906), {0., 0.},
|
||||
mercator::FromLatLon(47.2459, 38.8937), 3485.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2200, 38.8906), {0., 0.},
|
||||
mercator::FromLatLon(47.2459, 38.8937), 3485.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaTaganrogCheckhova267k2ToBolBulvarnaya8)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2200, 38.8906), {0., 0.},
|
||||
mercator::FromLatLon(47.2412, 38.8902), 2834.47);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2200, 38.8906), {0., 0.},
|
||||
mercator::FromLatLon(47.2412, 38.8902), 2834.47);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaRostovOnDonPrKosmonavtovToDneprovsky120b)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2811, 39.7178), {0., 0.},
|
||||
mercator::FromLatLon(47.2875, 39.759), 4300.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.2811, 39.7178), {0., 0.},
|
||||
mercator::FromLatLon(47.2875, 39.759), 4300.);
|
||||
}
|
||||
|
||||
UNIT_TEST(TurkeyKemerPalmetResortToYachtClub)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(36.6143, 30.5572), {0., 0.},
|
||||
mercator::FromLatLon(36.6004, 30.576), 2992.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(36.6143, 30.5572), {0., 0.},
|
||||
mercator::FromLatLon(36.6004, 30.576), 2992.);
|
||||
}
|
||||
|
||||
UNIT_TEST(CzechPragueNode5ToHilton)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0653, 14.4031), {0., 0.},
|
||||
mercator::FromLatLon(50.0933, 14.4397), 5106.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0653, 14.4031), {0., 0.},
|
||||
mercator::FromLatLon(50.0933, 14.4397), 5106.);
|
||||
}
|
||||
|
||||
/// @todo Here maybe some +-100m differencies. OM workd like OSRM here.
|
||||
/// @{
|
||||
UNIT_TEST(CzechPragueHiltonToKarlovMost)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.0864, 14.4124), 2483);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.0864, 14.4124), 2483);
|
||||
}
|
||||
|
||||
UNIT_TEST(CzechPragueHiltonToNicholasChurch)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.088, 14.4032), 3196);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.088, 14.4032), 3196);
|
||||
}
|
||||
/// @}
|
||||
|
||||
UNIT_TEST(CzechPragueHiltonToKvetniceViewpoint)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.0806, 14.3973), 4649.68);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(50.0933, 14.4397), {0., 0.},
|
||||
mercator::FromLatLon(50.0806, 14.3973), 4649.68);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaSaintPetersburgMoyka93ToAlexanderColumn)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.939, 30.3159), 2307.17);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.939, 30.3159), 2307.17);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaSaintPetersburgMoyka93ToMarsovoPole)
|
||||
{
|
||||
// OM follows left bank of Griboedova, while can keep right bank and make a small detour around church.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.9436, 30.3318), 2755);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.9436, 30.3318), 2755);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaSaintPetersburgMoyka93ToAvrora)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.9554, 30.3378), 4614.66);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9241, 30.323), {0., 0.},
|
||||
mercator::FromLatLon(59.9554, 30.3378), 4614.66);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaSaintPetersburgPetrPaulChurchToDolphins)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9502, 30.3165), {0., 0.},
|
||||
mercator::FromLatLon(59.973, 30.2702), 4507.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.9502, 30.3165), {0., 0.},
|
||||
mercator::FromLatLon(59.973, 30.2702), 4507.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaPetergofEntranceToErmitagePalace)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.8806, 29.904), {0., 0.},
|
||||
mercator::FromLatLon(59.8889, 29.9034), 1073.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.8806, 29.904), {0., 0.},
|
||||
mercator::FromLatLon(59.8889, 29.9034), 1073.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaPetergofMarlyPalaceToTrainStation)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.8887, 29.8963), {0., 0.},
|
||||
mercator::FromLatLon(59.8648, 29.9251), 3885.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(59.8887, 29.8963), {0., 0.},
|
||||
mercator::FromLatLon(59.8648, 29.9251), 3885.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaMoscowMailRuToTsarCannon)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.79703, 37.53761), {0., 0.},
|
||||
mercator::FromLatLon(55.75146, 37.61792), 7989.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.79703, 37.53761), {0., 0.},
|
||||
mercator::FromLatLon(55.75146, 37.61792), 7989.);
|
||||
}
|
||||
|
||||
UNIT_TEST(RussiaMoscowHovrinoStationToKasperskyLab)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.8701, 37.50833), {0., 0.},
|
||||
mercator::FromLatLon(55.83715, 37.48132), 5162.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.8701, 37.50833), {0., 0.},
|
||||
mercator::FromLatLon(55.83715, 37.48132), 5162.);
|
||||
}
|
||||
|
||||
UNIT_TEST(ItalyRome_WalkOverStreetWithSidewalkBoth)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(41.9052, 12.4106), {0., 0.},
|
||||
mercator::FromLatLon(41.9226, 12.4216), 2413.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(41.9052, 12.4106), {0., 0.},
|
||||
mercator::FromLatLon(41.9226, 12.4216), 2413.);
|
||||
}
|
||||
|
||||
UNIT_TEST(USARedlandsEsriHQToRedlandsCommunity)
|
||||
{
|
||||
// OM makes like OSRM with footway.
|
||||
// Valhalla uses shorter South San Mateo + West Olive.
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(34.0556, -117.19567), {0., 0.},
|
||||
mercator::FromLatLon(34.03682, -117.20649), 3212.65);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(34.0556, -117.19567), {0., 0.},
|
||||
mercator::FromLatLon(34.03682, -117.20649), 3212.65);
|
||||
}
|
||||
|
||||
UNIT_TEST(USANewYorkEmpireStateBuildingToUnitedNations)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(40.74844, -73.98566), {0., 0.},
|
||||
mercator::FromLatLon(40.75047, -73.96759), 2265.);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(40.74844, -73.98566), {0., 0.},
|
||||
mercator::FromLatLon(40.75047, -73.96759), 2265.);
|
||||
}
|
||||
|
||||
// Test on walking around a ford on an mwm border.
|
||||
UNIT_TEST(CrossMwmRussiaPStaiToBelarusDrazdy)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.014, 30.95552), {0., 0.},
|
||||
mercator::FromLatLon(55.01437, 30.8858), 4835.76);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.014, 30.95552), {0., 0.},
|
||||
mercator::FromLatLon(55.01437, 30.8858), 4835.76);
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_ZgradPanfilovskyUndergroundCrossing_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.98401, 37.17979), {0., 0.},
|
||||
mercator::FromLatLon(55.98419, 37.17938));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(55.98401, 37.17979), {0., 0.},
|
||||
mercator::FromLatLon(55.98419, 37.17938));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -421,10 +373,9 @@ UNIT_TEST(Russia_ZgradPanfilovskyUndergroundCrossing_TurnTest)
|
||||
|
||||
UNIT_TEST(Russia_Moscow_HydroprojectBridgeCrossing_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.80867, 37.50575), {0., 0.},
|
||||
mercator::FromLatLon(55.80884, 37.50668));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(55.80867, 37.50575), {0., 0.},
|
||||
mercator::FromLatLon(55.80884, 37.50668));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -446,10 +397,9 @@ UNIT_TEST(Russia_Moscow_HydroprojectBridgeCrossing_TurnTest)
|
||||
|
||||
UNIT_TEST(Belarus_Minsk_RenaissanceHotelUndergroundCross_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(53.89296, 27.52775), {0., 0.},
|
||||
mercator::FromLatLon(53.89262, 27.52838));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(53.89296, 27.52775), {0., 0.},
|
||||
mercator::FromLatLon(53.89262, 27.52838));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -470,17 +420,16 @@ UNIT_TEST(Belarus_Minsk_RenaissanceHotelUndergroundCross_TurnTest)
|
||||
|
||||
UNIT_TEST(MoscowVodnyStadiumHighwayPlatform)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.83955, 37.48692), {0., 0.},
|
||||
mercator::FromLatLon(55.84061, 37.48636), 136.115);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.83955, 37.48692), {0., 0.},
|
||||
mercator::FromLatLon(55.84061, 37.48636), 136.115);
|
||||
}
|
||||
|
||||
UNIT_TEST(Russia_Moscow_SevTushinoParkPedestrianOnePoint_TurnTest)
|
||||
{
|
||||
m2::PointD const point = mercator::FromLatLon(55.8719, 37.4464);
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), point, {0.0, 0.0}, point);
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Pedestrian), point, {0.0, 0.0}, point);
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -493,10 +442,9 @@ UNIT_TEST(Russia_Moscow_SevTushinoParkPedestrianOnePoint_TurnTest)
|
||||
|
||||
UNIT_TEST(MoscowKashirskoe16ToVorobeviGori)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.66230, 37.63214), {0., 0.},
|
||||
mercator::FromLatLon(55.70934, 37.54232), 9232.81);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.66230, 37.63214), {0., 0.},
|
||||
mercator::FromLatLon(55.70934, 37.54232), 9232.81);
|
||||
}
|
||||
|
||||
// Test on building pedestrian route past ferry.
|
||||
@@ -506,36 +454,32 @@ UNIT_TEST(SwitzerlandSaintBlaisePedestrianPastFerry)
|
||||
// Check with intermediate point {47.0098, 6.9770}
|
||||
|
||||
/// @todo After reducing GetFerryLandingPenalty, the app takes ferry here (1184 meters, 708 seconds).
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.010336, 6.982954), {0.0, 0.0},
|
||||
mercator::FromLatLon(47.005817, 6.970227), 1662.43);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(47.010336, 6.982954), {0.0, 0.0},
|
||||
mercator::FromLatLon(47.005817, 6.970227), 1662.43);
|
||||
}
|
||||
|
||||
// Test on building pedestrian route past ferry.
|
||||
UNIT_TEST(NetherlandsAmsterdamPedestrianPastFerry)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.38075, 4.89938), {0.0, 0.0},
|
||||
mercator::FromLatLon(52.40194, 4.89038), 2553.18);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(52.38075, 4.89938), {0.0, 0.0},
|
||||
mercator::FromLatLon(52.40194, 4.89038), 2553.18);
|
||||
}
|
||||
|
||||
// Test on building pedestrian route past ferry.
|
||||
UNIT_TEST(ItalyVenicePedestrianPastFerry)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(45.4375, 12.33549), {0.0, 0.0},
|
||||
mercator::FromLatLon(45.44057, 12.33393), 725.4);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(45.4375, 12.33549), {0.0, 0.0},
|
||||
mercator::FromLatLon(45.44057, 12.33393), 725.4);
|
||||
}
|
||||
|
||||
// Test on climbing from Priut11 to Elbrus mountain.
|
||||
UNIT_TEST(RussiaPriut11Elbrus)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteTime(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(43.31475, 42.46035), {0., 0.},
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(43.31475, 42.46035), {0., 0.},
|
||||
mercator::FromLatLon(43.35254, 42.43788), 37753.4 /* expectedTimeSeconds */);
|
||||
}
|
||||
|
||||
@@ -543,34 +487,31 @@ UNIT_TEST(RussiaPriut11Elbrus)
|
||||
UNIT_TEST(RussiaElbrusPriut11)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteTime(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(43.35254, 42.43788), {0., 0.},
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(43.35254, 42.43788), {0., 0.},
|
||||
mercator::FromLatLon(43.31475, 42.46035), 15878.9 /* expectedTimeSeconds */);
|
||||
}
|
||||
|
||||
// Test on going straight forward on primary road.
|
||||
UNIT_TEST(BudvaPrimaryRoad)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(42.2884527, 18.8456794), {0., 0.},
|
||||
mercator::FromLatLon(42.2880575, 18.8492896), 412.66);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(42.2884527, 18.8456794), {0., 0.},
|
||||
mercator::FromLatLon(42.2880575, 18.8492896), 412.66);
|
||||
}
|
||||
|
||||
// Test on start and finish route which lies on a feature crossed by a mwm border and a ford.
|
||||
UNIT_TEST(RussiaSmolenskAriaFeatureCrossingBorderWithFord)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.01727, 30.91566), {0., 0.},
|
||||
mercator::FromLatLon(55.01867, 30.91285), 298.6);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.01727, 30.91566), {0., 0.},
|
||||
mercator::FromLatLon(55.01867, 30.91285), 298.6);
|
||||
}
|
||||
|
||||
UNIT_TEST(NoTurnOnForkingRoad_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.67505, 37.51851), {0.0, 0.0}, mercator::FromLatLon(55.6748507, 37.5177359));
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(55.67505, 37.51851), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.6748507, 37.5177359));
|
||||
|
||||
Route const & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -588,8 +529,8 @@ UNIT_TEST(NoTurnOnForkingRoad_TurnTest)
|
||||
UNIT_TEST(NoTurnOnForkingRoad2_TurnTest)
|
||||
{
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(55.68336, 37.49492), {0.0, 0.0}, mercator::FromLatLon(55.68488, 37.49789));
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian), mercator::FromLatLon(55.68336, 37.49492), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.68488, 37.49789));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -609,10 +550,9 @@ UNIT_TEST(NoTurnOnForkingRoad2_TurnTest)
|
||||
|
||||
UNIT_TEST(Hungary_UseFootways)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(45.8587043, 18.2863972), {0., 0.},
|
||||
mercator::FromLatLon(45.858625, 18.285348), 95.7657);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(45.8587043, 18.2863972), {0., 0.},
|
||||
mercator::FromLatLon(45.858625, 18.285348), 95.7657);
|
||||
}
|
||||
|
||||
UNIT_TEST(France_Uphill_Downlhill)
|
||||
@@ -622,9 +562,9 @@ UNIT_TEST(France_Uphill_Downlhill)
|
||||
|
||||
double timeDownhill, timeUphill;
|
||||
{
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(45.32111, 3.69535), {0., 0.},
|
||||
FromLatLon(45.235327, 3.857533));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(45.32111, 3.69535), {0., 0.},
|
||||
FromLatLon(45.235327, 3.857533));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -636,9 +576,9 @@ UNIT_TEST(France_Uphill_Downlhill)
|
||||
}
|
||||
|
||||
{
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(45.235327, 3.857533), {0., 0.},
|
||||
FromLatLon(45.32111, 3.69535));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(45.235327, 3.857533), {0., 0.},
|
||||
FromLatLon(45.32111, 3.69535));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -655,26 +595,23 @@ UNIT_TEST(France_Uphill_Downlhill)
|
||||
// https://github.com/organicmaps/organicmaps/issues/1342
|
||||
UNIT_TEST(Crimea_Altitude_Mountains)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(44.7600296, 34.3247698), {0., 0.},
|
||||
mercator::FromLatLon(44.7632754, 34.313077), 1303.43);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(44.7600296, 34.3247698), {0., 0.},
|
||||
mercator::FromLatLon(44.7632754, 34.313077), 1303.43);
|
||||
}
|
||||
|
||||
// https://github.com/organicmaps/organicmaps/issues/2803
|
||||
UNIT_TEST(Italy_Rome_Altitude_Footway)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(41.899384, 12.4980887), {0., 0.},
|
||||
mercator::FromLatLon(41.9007759, 12.4994956), 203.861);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(41.899384, 12.4980887), {0., 0.},
|
||||
mercator::FromLatLon(41.9007759, 12.4994956), 203.861);
|
||||
}
|
||||
|
||||
UNIT_TEST(Romania_Mountains_ETA)
|
||||
{
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(45.5450, 25.2584), {0., 0.},
|
||||
FromLatLon(45.5223, 25.2806));
|
||||
FromLatLon(45.5450, 25.2584), {0., 0.}, FromLatLon(45.5223, 25.2806));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -688,18 +625,17 @@ UNIT_TEST(Romania_Mountains_ETA)
|
||||
// Check piligrim routes here: www santiago.nl/downloads/
|
||||
UNIT_TEST(Spain_N634_Piligrim_Road)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(43.5488528, -6.4696861), {0., 0.},
|
||||
mercator::FromLatLon(43.5435194, -6.5340694), 7217.93);
|
||||
integration::CalculateRouteAndTestRouteLength(integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||
mercator::FromLatLon(43.5488528, -6.4696861), {0., 0.},
|
||||
mercator::FromLatLon(43.5435194, -6.5340694), 7217.93);
|
||||
}
|
||||
|
||||
// https://github.com/organicmaps/organicmaps/issues/5410
|
||||
UNIT_TEST(Australia_Mountains_Downlhill)
|
||||
{
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(-33.7374217, 150.283098), {0., 0.},
|
||||
FromLatLon(-33.7375399, 150.283358));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(-33.7374217, 150.283098), {0., 0.},
|
||||
FromLatLon(-33.7375399, 150.283358));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -713,20 +649,18 @@ UNIT_TEST(Australia_Mountains_Downlhill)
|
||||
|
||||
UNIT_TEST(Turkey_UsePrimary)
|
||||
{
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(38.7352697, 35.516104), {0., 0.},
|
||||
FromLatLon(38.7398797, 35.5170627), 679.702);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(38.7352697, 35.516104),
|
||||
{0., 0.}, FromLatLon(38.7398797, 35.5170627), 679.702);
|
||||
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(38.7168708, 35.4903164), {0., 0.},
|
||||
FromLatLon(38.7207386, 35.4811178), 1050.39);
|
||||
CalculateRouteAndTestRouteLength(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(38.7168708, 35.4903164),
|
||||
{0., 0.}, FromLatLon(38.7207386, 35.4811178), 1050.39);
|
||||
}
|
||||
|
||||
UNIT_TEST(Georgia_UsePrimary)
|
||||
{
|
||||
TRouteResult const routeResult = CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian),
|
||||
FromLatLon(42.7175722, 42.0496444), {0., 0.},
|
||||
FromLatLon(43.0451, 42.3742778));
|
||||
TRouteResult const routeResult =
|
||||
CalculateRoute(GetVehicleComponents(VehicleType::Pedestrian), FromLatLon(42.7175722, 42.0496444), {0., 0.},
|
||||
FromLatLon(43.0451, 42.3742778));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
TEST(routeResult.first, ());
|
||||
@@ -737,4 +671,4 @@ UNIT_TEST(Georgia_UsePrimary)
|
||||
TEST(22 * 3600 < eta && eta < 24 * 3600, (eta));
|
||||
}
|
||||
|
||||
} // namespace pedestrian_route_test
|
||||
} // namespace pedestrian_route_test
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "indexer/feature_altitude.hpp"
|
||||
#include "indexer/mwm_set.hpp"
|
||||
|
||||
#include "routing_common/car_model.hpp"
|
||||
#include "routing/features_road_graph.hpp"
|
||||
#include "routing/road_graph.hpp"
|
||||
#include "routing_common/car_model.hpp"
|
||||
|
||||
#include "routing/routing_integration_tests/routing_test_tools.hpp"
|
||||
|
||||
@@ -46,8 +46,7 @@ UNIT_TEST(FakeEdgesCombinatorialExplosion)
|
||||
geometry::PointWithAltitude const j(m2::PointD(mercator::FromLatLon(50.73208, -1.21279)),
|
||||
geometry::kDefaultAltitudeMeters);
|
||||
std::vector<std::pair<routing::Edge, geometry::PointWithAltitude>> sourceVicinity;
|
||||
graph.FindClosestEdges(mercator::RectByCenterXYAndSizeInMeters(
|
||||
j.GetPoint(), FeaturesRoadGraph::kClosestEdgesRadiusM),
|
||||
graph.FindClosestEdges(mercator::RectByCenterXYAndSizeInMeters(j.GetPoint(), FeaturesRoadGraph::kClosestEdgesRadiusM),
|
||||
20 /* count */, sourceVicinity);
|
||||
// In case of the combinatorial explosion mentioned above all the memory was consumed for
|
||||
// FeaturesRoadGraph::m_fakeIngoingEdges and FeaturesRoadGraph::m_fakeOutgoingEdges fields.
|
||||
|
||||
@@ -22,17 +22,16 @@ struct RouteData
|
||||
|
||||
UNIT_TEST(MiniRoundabout_CalculateRoute)
|
||||
{
|
||||
std::vector<RouteData> const routesWithMiniRoundabouts{
|
||||
{{51.45609, 0.05974}, {51.45562, 0.06005}, 61.3},
|
||||
{{51.49746, -0.40027}, {51.49746, -0.40111}, 65.64},
|
||||
{{55.98700, -3.38256}, {55.98665, -3.38260}, 43.6},
|
||||
{{52.22163, 21.09296}, {52.22189, 21.09286}, 41.5}};
|
||||
std::vector<RouteData> const routesWithMiniRoundabouts{{{51.45609, 0.05974}, {51.45562, 0.06005}, 61.3},
|
||||
{{51.49746, -0.40027}, {51.49746, -0.40111}, 65.64},
|
||||
{{55.98700, -3.38256}, {55.98665, -3.38260}, 43.6},
|
||||
{{52.22163, 21.09296}, {52.22189, 21.09286}, 41.5}};
|
||||
|
||||
for (auto const & route : routesWithMiniRoundabouts)
|
||||
{
|
||||
TRouteResult const routeResult = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(route.m_start),
|
||||
{0.0, 0.0}, mercator::FromLatLon(route.m_finish));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(route.m_start), {0.0, 0.0},
|
||||
mercator::FromLatLon(route.m_finish));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,6 @@
|
||||
#include "base/math.hpp"
|
||||
#include "base/stl_helpers.hpp"
|
||||
|
||||
|
||||
namespace integration
|
||||
{
|
||||
using namespace routing;
|
||||
@@ -59,19 +58,14 @@ unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter()
|
||||
return storage::CountryInfoReader::CreateCountryInfoGetter(platform);
|
||||
}
|
||||
|
||||
unique_ptr<IndexRouter> CreateVehicleRouter(DataSource & dataSource,
|
||||
storage::CountryInfoGetter const & infoGetter,
|
||||
unique_ptr<IndexRouter> CreateVehicleRouter(DataSource & dataSource, storage::CountryInfoGetter const & infoGetter,
|
||||
traffic::TrafficCache const & trafficCache,
|
||||
vector<LocalCountryFile> const & localFiles,
|
||||
VehicleType vehicleType)
|
||||
vector<LocalCountryFile> const & localFiles, VehicleType vehicleType)
|
||||
{
|
||||
auto const countryFileGetter = [&infoGetter](m2::PointD const & pt) {
|
||||
return infoGetter.GetRegionCountryId(pt);
|
||||
};
|
||||
auto const countryFileGetter = [&infoGetter](m2::PointD const & pt) { return infoGetter.GetRegionCountryId(pt); };
|
||||
|
||||
auto const getMwmRectByName = [&infoGetter](string const & countryId) -> m2::RectD {
|
||||
return infoGetter.GetLimitRectForLeaf(countryId);
|
||||
};
|
||||
auto const getMwmRectByName = [&infoGetter](string const & countryId) -> m2::RectD
|
||||
{ return infoGetter.GetLimitRectForLeaf(countryId); };
|
||||
|
||||
auto countryParentGetter = std::make_unique<storage::CountryParentGetter>();
|
||||
CHECK(countryParentGetter, ());
|
||||
@@ -93,10 +87,9 @@ unique_ptr<IndexRouter> CreateVehicleRouter(DataSource & dataSource,
|
||||
TEST(!numMwmIds->IsEmpty(), ());
|
||||
|
||||
bool const loadAltitudes = vehicleType != VehicleType::Car;
|
||||
auto indexRouter = make_unique<IndexRouter>(vehicleType, loadAltitudes,
|
||||
*countryParentGetter, countryFileGetter,
|
||||
getMwmRectByName, numMwmIds,
|
||||
MakeNumMwmTree(*numMwmIds, infoGetter), trafficCache, dataSource);
|
||||
auto indexRouter =
|
||||
make_unique<IndexRouter>(vehicleType, loadAltitudes, *countryParentGetter, countryFileGetter, getMwmRectByName,
|
||||
numMwmIds, MakeNumMwmTree(*numMwmIds, infoGetter), trafficCache, dataSource);
|
||||
|
||||
return indexRouter;
|
||||
}
|
||||
@@ -106,25 +99,25 @@ void GetAllLocalFiles(vector<LocalCountryFile> & localFiles)
|
||||
platform::FindAllLocalMapsAndCleanup(numeric_limits<int64_t>::max() /* latestVersion */, localFiles);
|
||||
|
||||
// Leave only real country files for routing test.
|
||||
localFiles.erase(std::remove_if(localFiles.begin(), localFiles.end(), [](LocalCountryFile const & file)
|
||||
localFiles.erase(std::remove_if(localFiles.begin(), localFiles.end(),
|
||||
[](LocalCountryFile const & file)
|
||||
{
|
||||
auto const & name = file.GetCountryName();
|
||||
return name == WORLD_FILE_NAME || name == WORLD_COASTS_FILE_NAME;
|
||||
}), localFiles.end());
|
||||
}),
|
||||
localFiles.end());
|
||||
|
||||
for (auto & file : localFiles)
|
||||
file.SyncWithDisk();
|
||||
}
|
||||
|
||||
shared_ptr<VehicleRouterComponents>
|
||||
CreateAllMapsComponents(VehicleType vehicleType, std::set<std::string> const & skipMaps)
|
||||
shared_ptr<VehicleRouterComponents> CreateAllMapsComponents(VehicleType vehicleType,
|
||||
std::set<std::string> const & skipMaps)
|
||||
{
|
||||
vector<LocalCountryFile> localFiles;
|
||||
GetAllLocalFiles(localFiles);
|
||||
base::EraseIf(localFiles, [&skipMaps](LocalCountryFile const & cf)
|
||||
{
|
||||
return skipMaps.count(cf.GetCountryName()) > 0;
|
||||
});
|
||||
base::EraseIf(localFiles,
|
||||
[&skipMaps](LocalCountryFile const & cf) { return skipMaps.count(cf.GetCountryName()) > 0; });
|
||||
TEST(!localFiles.empty(), ());
|
||||
|
||||
return make_shared<VehicleRouterComponents>(localFiles, vehicleType);
|
||||
@@ -142,9 +135,8 @@ IRouterComponents & GetVehicleComponents(VehicleType vehicleType)
|
||||
return *(it->second);
|
||||
}
|
||||
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint, m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint)
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint)
|
||||
{
|
||||
RouterDelegate delegate;
|
||||
shared_ptr<Route> route = make_shared<Route>("mapsme", 0 /* route id */);
|
||||
@@ -155,8 +147,8 @@ TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
return TRouteResult(route, result);
|
||||
}
|
||||
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
Checkpoints const & checkpoints, GuidesTracks && guides)
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents, Checkpoints const & checkpoints,
|
||||
GuidesTracks && guides)
|
||||
{
|
||||
RouterDelegate delegate;
|
||||
shared_ptr<Route> route = make_shared<Route>("mapsme", 0 /* route id */);
|
||||
@@ -205,8 +197,7 @@ void TestRouteLength(Route const & route, double expectedRouteMeters, double rel
|
||||
double const delta = max(expectedRouteMeters * relativeError, kErrorMeters);
|
||||
double const routeMeters = route.GetTotalDistanceMeters();
|
||||
TEST(AlmostEqualAbs(routeMeters, expectedRouteMeters, delta),
|
||||
("Route length test failed. Expected:", expectedRouteMeters, "have:", routeMeters,
|
||||
"delta:", delta));
|
||||
("Route length test failed. Expected:", expectedRouteMeters, "have:", routeMeters, "delta:", delta));
|
||||
}
|
||||
|
||||
void TestRouteTime(Route const & route, double expectedRouteSeconds, double relativeError)
|
||||
@@ -214,81 +205,72 @@ void TestRouteTime(Route const & route, double expectedRouteSeconds, double rela
|
||||
double const delta = max(expectedRouteSeconds * relativeError, kErrorSeconds);
|
||||
double const routeSeconds = route.GetTotalTimeSec();
|
||||
TEST(AlmostEqualAbs(routeSeconds, expectedRouteSeconds, delta),
|
||||
("Route time test failed. Expected:", expectedRouteSeconds, "have:", routeSeconds,
|
||||
"delta:", delta));
|
||||
("Route time test failed. Expected:", expectedRouteSeconds, "have:", routeSeconds, "delta:", delta));
|
||||
}
|
||||
|
||||
void TestRoutePointsNumber(Route const & route, size_t expectedPointsNumber, double relativeError)
|
||||
{
|
||||
CHECK_GREATER_OR_EQUAL(relativeError, 0.0, ());
|
||||
size_t const routePoints = route.GetPoly().GetSize();
|
||||
TEST(AlmostEqualRel(static_cast<double>(routePoints),
|
||||
static_cast<double>(expectedPointsNumber), relativeError),
|
||||
TEST(AlmostEqualRel(static_cast<double>(routePoints), static_cast<double>(expectedPointsNumber), relativeError),
|
||||
("Route points test failed. Expected:", expectedPointsNumber, "have:", routePoints,
|
||||
"relative error:", relativeError));
|
||||
}
|
||||
|
||||
void CalculateRouteAndTestRouteLength(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint, double expectedRouteMeters,
|
||||
double relativeError /* = 0.02 */)
|
||||
void CalculateRouteAndTestRouteLength(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint,
|
||||
double expectedRouteMeters, double relativeError /* = 0.02 */)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
CalculateRoute(routerComponents, startPoint, startDirection, finalPoint);
|
||||
TRouteResult routeResult = CalculateRoute(routerComponents, startPoint, startDirection, finalPoint);
|
||||
RouterResultCode const result = routeResult.second;
|
||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||
CHECK(routeResult.first, ());
|
||||
TestRouteLength(*routeResult.first, expectedRouteMeters, relativeError);
|
||||
}
|
||||
|
||||
void CalculateRouteAndTestRouteTime(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint, double expectedTimeSeconds,
|
||||
double relativeError /* = 0.07 */)
|
||||
void CalculateRouteAndTestRouteTime(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint,
|
||||
double expectedTimeSeconds, double relativeError /* = 0.07 */)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
CalculateRoute(routerComponents, startPoint, startDirection, finalPoint);
|
||||
TRouteResult routeResult = CalculateRoute(routerComponents, startPoint, startDirection, finalPoint);
|
||||
RouterResultCode const result = routeResult.second;
|
||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||
CHECK(routeResult.first, ());
|
||||
TestRouteTime(*routeResult.first, expectedTimeSeconds, relativeError);
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestValid() const
|
||||
TestTurn const & TestTurn::TestValid() const
|
||||
{
|
||||
TEST(m_isValid, ());
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestNotValid() const
|
||||
TestTurn const & TestTurn::TestNotValid() const
|
||||
{
|
||||
TEST(!m_isValid, ());
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestPoint(m2::PointD const & expectedPoint, double inaccuracyMeters) const
|
||||
TestTurn const & TestTurn::TestPoint(m2::PointD const & expectedPoint, double inaccuracyMeters) const
|
||||
{
|
||||
double const distanceMeters = ms::DistanceOnEarth(expectedPoint.y, expectedPoint.x, m_point.y, m_point.x);
|
||||
TEST_LESS(distanceMeters, inaccuracyMeters, ());
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestDirection(routing::turns::CarDirection expectedDirection) const
|
||||
TestTurn const & TestTurn::TestDirection(routing::turns::CarDirection expectedDirection) const
|
||||
{
|
||||
TEST_EQUAL(m_direction, expectedDirection, ());
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestOneOfDirections(
|
||||
set<routing::turns::CarDirection> const & expectedDirections) const
|
||||
TestTurn const & TestTurn::TestOneOfDirections(set<routing::turns::CarDirection> const & expectedDirections) const
|
||||
{
|
||||
TEST(expectedDirections.find(m_direction) != expectedDirections.cend(), (m_direction));
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TestTurn & TestTurn::TestRoundAboutExitNum(uint32_t expectedRoundAboutExitNum) const
|
||||
TestTurn const & TestTurn::TestRoundAboutExitNum(uint32_t expectedRoundAboutExitNum) const
|
||||
{
|
||||
TEST_EQUAL(m_roundAboutExitNum, expectedRoundAboutExitNum, ());
|
||||
return *this;
|
||||
@@ -351,10 +333,8 @@ LocalCountryFile GetLocalCountryFileByCountryId(platform::CountryFile const & co
|
||||
GetAllLocalFiles(localFiles);
|
||||
|
||||
for (auto const & lf : localFiles)
|
||||
{
|
||||
if (lf.GetCountryFile() == country)
|
||||
return lf;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
} // namespace integration
|
||||
|
||||
@@ -51,13 +51,11 @@ using namespace routing;
|
||||
using namespace turns;
|
||||
using platform::LocalCountryFile;
|
||||
|
||||
std::shared_ptr<FeaturesFetcher> CreateFeaturesFetcher(
|
||||
std::vector<LocalCountryFile> const & localFiles);
|
||||
std::shared_ptr<FeaturesFetcher> CreateFeaturesFetcher(std::vector<LocalCountryFile> const & localFiles);
|
||||
|
||||
std::unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter();
|
||||
|
||||
std::unique_ptr<IndexRouter> CreateVehicleRouter(DataSource & dataSource,
|
||||
storage::CountryInfoGetter const & infoGetter,
|
||||
std::unique_ptr<IndexRouter> CreateVehicleRouter(DataSource & dataSource, storage::CountryInfoGetter const & infoGetter,
|
||||
traffic::TrafficCache const & trafficCache,
|
||||
std::vector<LocalCountryFile> const & localFiles,
|
||||
VehicleType vehicleType);
|
||||
@@ -66,9 +64,9 @@ class IRouterComponents
|
||||
{
|
||||
public:
|
||||
IRouterComponents(std::vector<LocalCountryFile> const & localFiles)
|
||||
: m_featuresFetcher(CreateFeaturesFetcher(localFiles)), m_infoGetter(CreateCountryInfoGetter())
|
||||
{
|
||||
}
|
||||
: m_featuresFetcher(CreateFeaturesFetcher(localFiles))
|
||||
, m_infoGetter(CreateCountryInfoGetter())
|
||||
{}
|
||||
|
||||
virtual ~IRouterComponents() = default;
|
||||
|
||||
@@ -86,10 +84,9 @@ class VehicleRouterComponents : public IRouterComponents
|
||||
public:
|
||||
VehicleRouterComponents(std::vector<LocalCountryFile> const & localFiles, VehicleType vehicleType)
|
||||
: IRouterComponents(localFiles)
|
||||
, m_indexRouter(CreateVehicleRouter(m_featuresFetcher->GetDataSource(), *m_infoGetter,
|
||||
m_trafficCache, localFiles, vehicleType))
|
||||
{
|
||||
}
|
||||
, m_indexRouter(CreateVehicleRouter(m_featuresFetcher->GetDataSource(), *m_infoGetter, m_trafficCache, localFiles,
|
||||
vehicleType))
|
||||
{}
|
||||
|
||||
IRouter & GetRouter() const override { return *m_indexRouter; }
|
||||
|
||||
@@ -100,23 +97,20 @@ private:
|
||||
|
||||
void GetAllLocalFiles(std::vector<LocalCountryFile> & localFiles);
|
||||
void TestOnlineCrosses(ms::LatLon const & startPoint, ms::LatLon const & finalPoint,
|
||||
std::vector<std::string> const & expected,
|
||||
IRouterComponents & routerComponents);
|
||||
std::vector<std::string> const & expected, IRouterComponents & routerComponents);
|
||||
void TestOnlineFetcher(ms::LatLon const & startPoint, ms::LatLon const & finalPoint,
|
||||
std::vector<std::string> const & expected,
|
||||
IRouterComponents & routerComponents);
|
||||
std::vector<std::string> const & expected, IRouterComponents & routerComponents);
|
||||
|
||||
std::shared_ptr<VehicleRouterComponents>
|
||||
CreateAllMapsComponents(VehicleType vehicleType, std::set<std::string> const & skipMaps);
|
||||
std::shared_ptr<VehicleRouterComponents> CreateAllMapsComponents(VehicleType vehicleType,
|
||||
std::set<std::string> const & skipMaps);
|
||||
|
||||
IRouterComponents & GetVehicleComponents(VehicleType vehicleType);
|
||||
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint, m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint);
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint);
|
||||
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
Checkpoints const & checkpoints, GuidesTracks && guides);
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents, Checkpoints const & checkpoints,
|
||||
GuidesTracks && guides);
|
||||
|
||||
void TestTurnCount(Route const & route, uint32_t expectedTurnCount);
|
||||
void TestTurns(Route const & route, std::vector<CarDirection> const & expectedTurns);
|
||||
@@ -128,20 +122,15 @@ void TestTurns(Route const & route, std::vector<CarDirection> const & expectedTu
|
||||
/// && expectedRouteMeters + expectedRouteMeters * relativeError >= route->GetDistance()
|
||||
void TestRouteLength(Route const & route, double expectedRouteMeters, double relativeError = 0.01);
|
||||
void TestRouteTime(Route const & route, double expectedRouteSeconds, double relativeError = 0.01);
|
||||
void TestRoutePointsNumber(Route const & route, size_t expectedPointsNumber,
|
||||
double relativeError = 0.1);
|
||||
void TestRoutePointsNumber(Route const & route, size_t expectedPointsNumber, double relativeError = 0.1);
|
||||
|
||||
void CalculateRouteAndTestRouteLength(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint, double expectedRouteMeters,
|
||||
double relativeError = 0.02);
|
||||
void CalculateRouteAndTestRouteLength(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint,
|
||||
double expectedRouteMeters, double relativeError = 0.02);
|
||||
|
||||
void CalculateRouteAndTestRouteTime(IRouterComponents const & routerComponents,
|
||||
m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection,
|
||||
m2::PointD const & finalPoint, double expectedTimeSeconds,
|
||||
double relativeError = 0.07);
|
||||
void CalculateRouteAndTestRouteTime(IRouterComponents const & routerComponents, m2::PointD const & startPoint,
|
||||
m2::PointD const & startDirection, m2::PointD const & finalPoint,
|
||||
double expectedTimeSeconds, double relativeError = 0.07);
|
||||
|
||||
void CheckSubwayExistence(Route const & route);
|
||||
void CheckSubwayAbsent(Route const & route);
|
||||
@@ -155,25 +144,21 @@ class TestTurn
|
||||
uint32_t const m_roundAboutExitNum;
|
||||
bool const m_isValid;
|
||||
|
||||
TestTurn()
|
||||
: m_point({0.0, 0.0})
|
||||
, m_direction(CarDirection::None)
|
||||
, m_roundAboutExitNum(0)
|
||||
, m_isValid(false)
|
||||
{
|
||||
}
|
||||
TestTurn() : m_point({0.0, 0.0}), m_direction(CarDirection::None), m_roundAboutExitNum(0), m_isValid(false) {}
|
||||
TestTurn(m2::PointD const & pnt, CarDirection direction, uint32_t roundAboutExitNum)
|
||||
: m_point(pnt), m_direction(direction), m_roundAboutExitNum(roundAboutExitNum), m_isValid(true)
|
||||
{
|
||||
}
|
||||
: m_point(pnt)
|
||||
, m_direction(direction)
|
||||
, m_roundAboutExitNum(roundAboutExitNum)
|
||||
, m_isValid(true)
|
||||
{}
|
||||
|
||||
public:
|
||||
const TestTurn & TestValid() const;
|
||||
const TestTurn & TestNotValid() const;
|
||||
const TestTurn & TestPoint(m2::PointD const & expectedPoint, double inaccuracyMeters = 3.) const;
|
||||
const TestTurn & TestDirection(CarDirection expectedDirection) const;
|
||||
const TestTurn & TestOneOfDirections(std::set<CarDirection> const & expectedDirections) const;
|
||||
const TestTurn & TestRoundAboutExitNum(uint32_t expectedRoundAboutExitNum) const;
|
||||
TestTurn const & TestValid() const;
|
||||
TestTurn const & TestNotValid() const;
|
||||
TestTurn const & TestPoint(m2::PointD const & expectedPoint, double inaccuracyMeters = 3.) const;
|
||||
TestTurn const & TestDirection(CarDirection expectedDirection) const;
|
||||
TestTurn const & TestOneOfDirections(std::set<CarDirection> const & expectedDirections) const;
|
||||
TestTurn const & TestRoundAboutExitNum(uint32_t expectedRoundAboutExitNum) const;
|
||||
};
|
||||
|
||||
/// Extracting appropriate TestTurn if any. If not TestTurn::isValid() returns false.
|
||||
|
||||
@@ -120,8 +120,10 @@ UNIT_TEST(SmallRoutes_JustNoError)
|
||||
};
|
||||
|
||||
std::vector<std::tuple<ms::LatLon, ms::LatLon, m2::PointD, VehicleType>> routesWithDir = {
|
||||
{{-45.433213, -72.739150}, {-45.434484, -72.738892},
|
||||
{-1.3387623880589671899e-06, -4.2558102819612031453e-07}, VehicleType::Car}, // 1
|
||||
{{-45.433213, -72.739150},
|
||||
{-45.434484, -72.738892},
|
||||
{-1.3387623880589671899e-06, -4.2558102819612031453e-07},
|
||||
VehicleType::Car}, // 1
|
||||
};
|
||||
|
||||
size_t number = 0;
|
||||
@@ -134,12 +136,9 @@ UNIT_TEST(SmallRoutes_JustNoError)
|
||||
std::tie(start, finish, type) = route;
|
||||
|
||||
LOG(LINFO, ("Start test without direction, number:", number));
|
||||
TRouteResult result =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(type),
|
||||
mercator::FromLatLon(start), {0., 0.},
|
||||
mercator::FromLatLon(finish));
|
||||
TEST_EQUAL(result.second, RouterResultCode::NoError,
|
||||
(std::get<0>(route), std::get<1>(route), std::get<2>(route)));
|
||||
TRouteResult result = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(type), mercator::FromLatLon(start), {0., 0.}, mercator::FromLatLon(finish));
|
||||
TEST_EQUAL(result.second, RouterResultCode::NoError, (std::get<0>(route), std::get<1>(route), std::get<2>(route)));
|
||||
}
|
||||
|
||||
number = 0;
|
||||
@@ -153,10 +152,8 @@ UNIT_TEST(SmallRoutes_JustNoError)
|
||||
std::tie(start, finish, direction, type) = route;
|
||||
|
||||
LOG(LINFO, ("Start test with direction, number:", number));
|
||||
TRouteResult result =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(type),
|
||||
mercator::FromLatLon(start), direction,
|
||||
mercator::FromLatLon(finish));
|
||||
TRouteResult result = integration::CalculateRoute(
|
||||
integration::GetVehicleComponents(type), mercator::FromLatLon(start), direction, mercator::FromLatLon(finish));
|
||||
TEST_EQUAL(result.second, RouterResultCode::NoError, ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,16 +45,16 @@ location::GpsInfo MoveTo(ms::LatLon const & coords, double speed = -1)
|
||||
|
||||
void ChangePosition(ms::LatLon const & coords, double speedKmPH, RoutingSession & routingSession)
|
||||
{
|
||||
routingSession.OnLocationPositionChanged(MoveTo({coords.m_lat, coords.m_lon}, measurement_utils::KmphToMps(speedKmPH)));
|
||||
routingSession.OnLocationPositionChanged(
|
||||
MoveTo({coords.m_lat, coords.m_lon}, measurement_utils::KmphToMps(speedKmPH)));
|
||||
}
|
||||
|
||||
void InitRoutingSession(ms::LatLon const & from, ms::LatLon const & to, RoutingSession & routingSession,
|
||||
SpeedCameraManagerMode mode = SpeedCameraManagerMode::Auto)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(from), m2::PointD::Zero(),
|
||||
mercator::FromLatLon(to));
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car), mercator::FromLatLon(from),
|
||||
m2::PointD::Zero(), mercator::FromLatLon(to));
|
||||
|
||||
Route & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -67,7 +67,8 @@ void InitRoutingSession(ms::LatLon const & from, ms::LatLon const & to, RoutingS
|
||||
routingSession.GetSpeedCamManager().SetMode(mode);
|
||||
string const engShortJson = R"(
|
||||
{
|
||||
"unknown_camera": ")" + kCameraOnTheWay + R"("
|
||||
"unknown_camera": ")" + kCameraOnTheWay +
|
||||
R"("
|
||||
}
|
||||
)";
|
||||
routingSession.SetLocaleWithJsonForTesting(engShortJson, "en");
|
||||
@@ -77,9 +78,7 @@ bool CheckVoiceNotification(RoutingSession & routingSession)
|
||||
{
|
||||
vector<string> notifications;
|
||||
routingSession.GenerateNotifications(notifications, false);
|
||||
return any_of(notifications.begin(), notifications.end(), [](auto const & item) {
|
||||
return item == kCameraOnTheWay;
|
||||
});
|
||||
return any_of(notifications.begin(), notifications.end(), [](auto const & item) { return item == kCameraOnTheWay; });
|
||||
}
|
||||
|
||||
bool CheckBeepSignal(RoutingSession & routingSession)
|
||||
@@ -138,10 +137,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_2)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.74070, 37.61681} /* from */,
|
||||
{55.74885, 37.61036} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.74070, 37.61681} /* from */, {55.74885, 37.61036} /* to */, routingSession, mode);
|
||||
|
||||
{
|
||||
double const speedKmPH = 100.0;
|
||||
@@ -162,10 +158,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_3)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession, mode);
|
||||
|
||||
// No danger here.
|
||||
{
|
||||
@@ -198,10 +191,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_4)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.65601, 37.53822} /* from */,
|
||||
{55.65760, 37.52312} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.65601, 37.53822} /* from */, {55.65760, 37.52312} /* to */, routingSession, mode);
|
||||
|
||||
{
|
||||
double const speedKmPH = 100.0;
|
||||
@@ -228,10 +218,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_5)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession, mode);
|
||||
|
||||
// No danger here.
|
||||
{
|
||||
@@ -261,10 +248,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_6)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession, mode);
|
||||
|
||||
// Exceed speed limit before beep zone.
|
||||
{
|
||||
@@ -296,10 +280,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_7)
|
||||
for (auto const mode : modes)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
mode);
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession, mode);
|
||||
|
||||
// Exceed speed limit before beep zone.
|
||||
{
|
||||
@@ -356,8 +337,7 @@ UNIT_TEST(SpeedCameraNotification_AutoAlwaysMode_8)
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.6755737, 37.5264126}, // from
|
||||
{55.67052, 37.51893}, // to
|
||||
routingSession,
|
||||
mode);
|
||||
routingSession, mode);
|
||||
|
||||
{
|
||||
double const speedKmPH = 180.0;
|
||||
@@ -398,9 +378,7 @@ UNIT_TEST(SpeedCameraNotification_AlwaysMode_1)
|
||||
{
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession,
|
||||
SpeedCameraManagerMode::Always);
|
||||
|
||||
{
|
||||
@@ -422,9 +400,7 @@ UNIT_TEST(SpeedCameraNotification_AutoMode_1)
|
||||
{
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession,
|
||||
SpeedCameraManagerMode::Auto);
|
||||
|
||||
{
|
||||
@@ -440,9 +416,7 @@ UNIT_TEST(SpeedCameraNotification_NeverMode_1)
|
||||
{
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */,
|
||||
{55.75947, 37.58484} /* to */,
|
||||
routingSession,
|
||||
InitRoutingSession({55.76801, 37.59363} /* from */, {55.75947, 37.58484} /* to */, routingSession,
|
||||
SpeedCameraManagerMode::Never);
|
||||
|
||||
{
|
||||
@@ -477,8 +451,8 @@ UNIT_TEST(SpeedCameraNotification_NeverMode_1)
|
||||
UNIT_TEST(SpeedCameraNotification_CameraOnMiniRoundabout)
|
||||
{
|
||||
RoutingSession routingSession;
|
||||
InitRoutingSession({41.201998, 69.109587} /* from */, {41.200358, 69.107051} /* to */,
|
||||
routingSession, SpeedCameraManagerMode::Never);
|
||||
InitRoutingSession({41.201998, 69.109587} /* from */, {41.200358, 69.107051} /* to */, routingSession,
|
||||
SpeedCameraManagerMode::Never);
|
||||
double const speedKmPH = 100.0;
|
||||
ChangePosition({41.201998, 69.109587}, speedKmPH, routingSession);
|
||||
TEST(!NoCameraFound(routingSession), ());
|
||||
|
||||
@@ -22,10 +22,9 @@ void MoveRoute(Route & route, ms::LatLon const & coords)
|
||||
|
||||
UNIT_TEST(RussiaTulskayaToPaveletskayaStreetNamesTest)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(55.70839, 37.62145), {0., 0.},
|
||||
mercator::FromLatLon(55.73198, 37.63945));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car),
|
||||
mercator::FromLatLon(55.70839, 37.62145), {0., 0.},
|
||||
mercator::FromLatLon(55.73198, 37.63945));
|
||||
|
||||
Route & route = *routeResult.first;
|
||||
RouterResultCode const result = routeResult.second;
|
||||
@@ -54,7 +53,7 @@ UNIT_TEST(RussiaTulskayaToPaveletskayaStreetNamesTest)
|
||||
|
||||
// No more extra last turn, so TestNextStreetName returns "".
|
||||
integration::TestCurrentStreetName(route, "Валовая улица");
|
||||
//integration::TestNextStreetName(route, "улица Зацепский Вал");
|
||||
// integration::TestNextStreetName(route, "улица Зацепский Вал");
|
||||
|
||||
MoveRoute(route, ms::LatLon(55.730912, 37.636191));
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ using namespace routing;
|
||||
|
||||
UNIT_TEST(Transit_Moscow_CenterToKotelniki_CrossMwm)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.75018, 37.60971), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.67245, 37.86130));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.75018, 37.60971), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.67245, 37.86130));
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
integration::TestRouteLength(*routeResult.first, 22968.6);
|
||||
@@ -24,10 +23,9 @@ UNIT_TEST(Transit_Moscow_CenterToKotelniki_CrossMwm)
|
||||
|
||||
UNIT_TEST(Transit_Moscow_DubrovkaToTrtykovskya)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.71813, 37.67756), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.74089, 37.62831));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.71813, 37.67756), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.74089, 37.62831));
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
integration::TestRouteLength(*routeResult.first, 7622.19);
|
||||
@@ -38,10 +36,9 @@ UNIT_TEST(Transit_Moscow_DubrovkaToTrtykovskya)
|
||||
|
||||
UNIT_TEST(Transit_Moscow_NoSubwayTest)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.73893, 37.62438), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.73470, 37.62617));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(55.73893, 37.62438), {0.0, 0.0},
|
||||
mercator::FromLatLon(55.73470, 37.62617));
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
integration::TestRouteLength(*routeResult.first, 604.86);
|
||||
@@ -52,10 +49,9 @@ UNIT_TEST(Transit_Moscow_NoSubwayTest)
|
||||
|
||||
UNIT_TEST(Transit_Piter_FrunzenskyaToPlochadVosstaniya)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(59.90511, 30.31425), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.93096, 30.35872));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(59.90511, 30.31425), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.93096, 30.35872));
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
/// @todo Check https://github.com/organicmaps/organicmaps/issues/1669 for details.
|
||||
@@ -67,10 +63,9 @@ UNIT_TEST(Transit_Piter_FrunzenskyaToPlochadVosstaniya)
|
||||
|
||||
UNIT_TEST(Transit_Piter_TooLongPedestrian)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(59.90511, 30.31425), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.78014, 30.50036));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(59.90511, 30.31425), {0.0, 0.0},
|
||||
mercator::FromLatLon(59.78014, 30.50036));
|
||||
|
||||
/// @todo Returns valid route now with long pedestrian part in the end, I don't see problems here.
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
@@ -85,10 +80,9 @@ UNIT_TEST(Transit_Piter_TooLongPedestrian)
|
||||
|
||||
UNIT_TEST(Transit_Vatikan_NotEnoughGraphDataAtThenEnd)
|
||||
{
|
||||
TRouteResult const routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(41.89543, 12.41481), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.89203, 12.46263));
|
||||
TRouteResult const routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(41.89543, 12.41481), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.89203, 12.46263));
|
||||
|
||||
/// @todo Returns valid route now with long pedestrian part in the end, I don't see problems here.
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
@@ -103,10 +97,9 @@ UNIT_TEST(Transit_Vatikan_NotEnoughGraphDataAtThenEnd)
|
||||
|
||||
UNIT_TEST(Transit_Vatikan_CorneliaToOttaviano)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(41.90052, 12.42642), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.90414, 12.45640));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(41.90052, 12.42642), {0.0, 0.0},
|
||||
mercator::FromLatLon(41.90414, 12.45640));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
@@ -119,10 +112,9 @@ UNIT_TEST(Transit_Vatikan_CorneliaToOttaviano)
|
||||
|
||||
UNIT_TEST(Transit_London_PoplarToOval)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(51.50818, -0.01634), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.48041, -0.10843));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(51.50818, -0.01634), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.48041, -0.10843));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
@@ -134,10 +126,9 @@ UNIT_TEST(Transit_London_PoplarToOval)
|
||||
|
||||
UNIT_TEST(Transit_London_DeptfordBridgeToCyprus)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(51.47149, -0.030558), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.51242, 0.07101));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(51.47149, -0.030558), {0.0, 0.0},
|
||||
mercator::FromLatLon(51.51242, 0.07101));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
@@ -150,10 +141,9 @@ UNIT_TEST(Transit_London_DeptfordBridgeToCyprus)
|
||||
|
||||
UNIT_TEST(Transit_Washington_FoggyToShaw)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(38.89582, -77.04934), {0.0, 0.0},
|
||||
mercator::FromLatLon(38.91516, -77.01513));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(38.89582, -77.04934), {0.0, 0.0},
|
||||
mercator::FromLatLon(38.91516, -77.01513));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
@@ -166,10 +156,9 @@ UNIT_TEST(Transit_Washington_FoggyToShaw)
|
||||
|
||||
UNIT_TEST(Transit_NewYork_GrassmereToPleasantPlains)
|
||||
{
|
||||
TRouteResult routeResult =
|
||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(40.60536, -74.07736), {0.0, 0.0},
|
||||
mercator::FromLatLon(40.53015, -74.21559));
|
||||
TRouteResult routeResult = integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Transit),
|
||||
mercator::FromLatLon(40.60536, -74.07736), {0.0, 0.0},
|
||||
mercator::FromLatLon(40.53015, -74.21559));
|
||||
|
||||
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
|
||||
|
||||
@@ -179,4 +168,4 @@ UNIT_TEST(Transit_NewYork_GrassmereToPleasantPlains)
|
||||
CHECK(routeResult.first, ());
|
||||
integration::CheckSubwayExistence(*routeResult.first);
|
||||
}
|
||||
} // namespace transit_route_test
|
||||
} // namespace transit_route_test
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user