[Routing] Integration test for mini-roundabouts.

This commit is contained in:
Olga Khlopkova 2019-12-10 17:35:37 +03:00 committed by Vladimir Byko-Ianko
parent 7b236a3283
commit 6e334a595c
2 changed files with 43 additions and 0 deletions

View file

@ -15,6 +15,7 @@ set(
online_cross_tests.cpp
pedestrian_route_test.cpp
road_graph_tests.cpp
roundabouts_tests.cpp
route_test.cpp
routing_test_tools.cpp
routing_test_tools.hpp

View file

@ -0,0 +1,42 @@
#include "testing/testing.hpp"
#include "routing/routing_integration_tests/routing_test_tools.hpp"
#include "routing/route.hpp"
#include "routing/routing_callbacks.hpp"
#include "geometry/latlon.hpp"
#include <vector>
using namespace routing;
namespace
{
struct RouteData
{
ms::LatLon m_start;
ms::LatLon m_finish;
double m_routeLengthM;
};
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}, 63.1},
{{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));
TEST_EQUAL(routeResult.second, RouterResultCode::NoError, ());
integration::TestRouteLength(*routeResult.first, route.m_routeLengthM);
}
}
} // namespace