[bicycle routing] Writing routing_integration_tests for bicycle routing.

This commit is contained in:
Vladimir Byko-Ianko 2016-05-11 13:31:53 +03:00
parent 995d7be548
commit d1c87452f3
3 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#include "testing/testing.hpp"
#include "routing/routing_integration_tests/routing_test_tools.hpp"
#include "geometry/mercator.hpp"
using namespace routing;
using namespace routing::turns;
UNIT_TEST(RussiaMoscowSevTushinoParkPreferingBicycleWay)
{
integration::CalculateRouteAndTestRouteLength(
integration::GetBicycleComponents(),
MercatorBounds::FromLatLon(55.87445, 37.43711), {0., 0.},
MercatorBounds::FromLatLon(55.87203, 37.44274), 460.);
}

View file

@ -0,0 +1,35 @@
#include "testing/testing.hpp"
#include "routing/routing_integration_tests/routing_test_tools.hpp"
#include "routing/route.hpp"
using namespace routing;
using namespace routing::turns;
UNIT_TEST(RussiaMoscowSevTushinoParkBicycleWayTurnTest)
{
TRouteResult const routeResult = integration::CalculateRoute(
integration::GetBicycleComponents(),
MercatorBounds::FromLatLon(55.87445, 37.43711), {0.0, 0.0},
MercatorBounds::FromLatLon(55.8719, 37.4464));
Route const & route = *routeResult.first;
IRouter::ResultCode const result = routeResult.second;
TEST_EQUAL(result, IRouter::NoError, ());
integration::TestTurnCount(route, 3);
integration::GetNthTurn(route, 0)
.TestValid()
.TestDirection(TurnDirection::TurnRight);
integration::GetNthTurn(route, 1)
.TestValid()
.TestDirection(TurnDirection::TurnLeft);
integration::GetNthTurn(route, 2)
.TestValid()
.TestDirection(TurnDirection::TurnRight);
integration::TestRouteLength(route, 711.);
}

View file

@ -24,6 +24,8 @@ QT *= core
SOURCES += \
../../testing/testingmain.cpp \
bicycle_route_test.cpp \
bicycle_turn_test.cpp \
cross_section_tests.cpp \
online_cross_tests.cpp \
osrm_route_test.cpp \