mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
[routing][tests] Updated Turn integration tests.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
a25ae124d7
commit
014b54b1f7
@@ -569,18 +569,18 @@ UNIT_TEST(NoTurnOnForkingRoad_TurnTest)
|
|||||||
{
|
{
|
||||||
TRouteResult const routeResult = integration::CalculateRoute(
|
TRouteResult const routeResult = integration::CalculateRoute(
|
||||||
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
integration::GetVehicleComponents(VehicleType::Pedestrian),
|
||||||
mercator::FromLatLon(55.67505, 37.51851), {0.0, 0.0}, mercator::FromLatLon(55.67488, 37.5178));
|
mercator::FromLatLon(55.67505, 37.51851), {0.0, 0.0}, mercator::FromLatLon(55.6748507, 37.5177359));
|
||||||
|
|
||||||
Route const & route = *routeResult.first;
|
Route const & route = *routeResult.first;
|
||||||
RouterResultCode const result = routeResult.second;
|
RouterResultCode const result = routeResult.second;
|
||||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||||
|
|
||||||
integration::TestRouteLength(route, 51.2);
|
integration::TestRouteLength(route, 64.655);
|
||||||
|
|
||||||
|
/// @todo t[1].m_pedestrianTurn, PedestrianDirection::TurnRight is redundant here.
|
||||||
std::vector<turns::TurnItem> t;
|
std::vector<turns::TurnItem> t;
|
||||||
route.GetTurnsForTesting(t);
|
route.GetTurnsForTesting(t);
|
||||||
TEST_EQUAL(t.size(), 2, ());
|
TEST_EQUAL(t.size(), 2, ());
|
||||||
|
|
||||||
TEST_EQUAL(t[0].m_pedestrianTurn, PedestrianDirection::TurnLeft, ());
|
TEST_EQUAL(t[0].m_pedestrianTurn, PedestrianDirection::TurnLeft, ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,26 +14,6 @@ namespace turn_test
|
|||||||
using namespace routing;
|
using namespace routing;
|
||||||
using namespace routing::turns;
|
using namespace routing::turns;
|
||||||
|
|
||||||
UNIT_TEST(Russia_Moscow_NagatinoUturn_TurnTest)
|
|
||||||
{
|
|
||||||
TRouteResult const routeResult =
|
|
||||||
integration::CalculateRoute(integration::GetVehicleComponents(VehicleType::Car),
|
|
||||||
mercator::FromLatLon(55.67251, 37.63604), {0.01, -0.01},
|
|
||||||
mercator::FromLatLon(55.67293, 37.63507));
|
|
||||||
|
|
||||||
Route const & route = *routeResult.first;
|
|
||||||
RouterResultCode const result = routeResult.second;
|
|
||||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
|
||||||
|
|
||||||
integration::TestTurnCount(route, 2 /* expectedTurnCount */);
|
|
||||||
|
|
||||||
integration::GetNthTurn(route, 0)
|
|
||||||
.TestValid()
|
|
||||||
.TestDirection(CarDirection::UTurnLeft);
|
|
||||||
|
|
||||||
integration::TestRouteLength(route, 251.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Secondary should be preferred against residential.
|
// Secondary should be preferred against residential.
|
||||||
UNIT_TEST(StPetersburg_SideRoadPenalty_TurnTest)
|
UNIT_TEST(StPetersburg_SideRoadPenalty_TurnTest)
|
||||||
{
|
{
|
||||||
@@ -301,17 +281,16 @@ UNIT_TEST(Russia_HugeRoundabout_TurnTest)
|
|||||||
Route const & route = *routeResult.first;
|
Route const & route = *routeResult.first;
|
||||||
RouterResultCode const result = routeResult.second;
|
RouterResultCode const result = routeResult.second;
|
||||||
|
|
||||||
/// @todo Actualized exit num. But one exit is highway=unclassified, that (probably?) should not be counted?
|
|
||||||
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
TEST_EQUAL(result, RouterResultCode::NoError, ());
|
||||||
integration::TestTurnCount(route, 2 /* expectedTurnCount */);
|
integration::TestTurnCount(route, 2 /* expectedTurnCount */);
|
||||||
integration::GetNthTurn(route, 0)
|
integration::GetNthTurn(route, 0)
|
||||||
.TestValid()
|
.TestValid()
|
||||||
.TestDirection(CarDirection::EnterRoundAbout)
|
.TestDirection(CarDirection::EnterRoundAbout)
|
||||||
.TestRoundAboutExitNum(6);
|
.TestRoundAboutExitNum(7);
|
||||||
integration::GetNthTurn(route, 1)
|
integration::GetNthTurn(route, 1)
|
||||||
.TestValid()
|
.TestValid()
|
||||||
.TestDirection(CarDirection::LeaveRoundAbout)
|
.TestDirection(CarDirection::LeaveRoundAbout)
|
||||||
.TestRoundAboutExitNum(6);
|
.TestRoundAboutExitNum(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNIT_TEST(Belarus_Misk_ProspNezavisimostiMKAD_TurnTest)
|
UNIT_TEST(Belarus_Misk_ProspNezavisimostiMKAD_TurnTest)
|
||||||
@@ -1274,9 +1253,9 @@ UNIT_TEST(Cyprus_Governors_Beach_TurnTestNextRoad)
|
|||||||
|
|
||||||
RouteSegment::RoadNameInfo ri;
|
RouteSegment::RoadNameInfo ri;
|
||||||
route.GetNextTurnStreetName(ri);
|
route.GetNextTurnStreetName(ri);
|
||||||
TEST_EQUAL(ri.m_destination, "Governer's Beach; Pentakomo", ());
|
TEST_EQUAL(ri.m_destination, "ΑΚΤΗ ΚΥΒΕΡΝΗΤΗ; Governer's Beach; ΠΕΝΤΑΚΩΜΟ; Pentakomo", ());
|
||||||
// Aggregated network/ref tags.
|
// Aggregated network/ref tags.
|
||||||
TEST_EQUAL(ri.m_destination_ref, "CY:B/B1", ());
|
TEST_EQUAL(ri.m_destination_ref, "B1", ());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exit which is marked as non-link, but has link tags m_destination_ref and m_destination.
|
// Exit which is marked as non-link, but has link tags m_destination_ref and m_destination.
|
||||||
|
|||||||
Reference in New Issue
Block a user