forked from organicmaps/organicmaps
[bicycle routing] Writing routing_integration_tests for bicycle routing.
This commit is contained in:
parent
995d7be548
commit
d1c87452f3
3 changed files with 53 additions and 0 deletions
16
routing/routing_integration_tests/bicycle_route_test.cpp
Normal file
16
routing/routing_integration_tests/bicycle_route_test.cpp
Normal 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.);
|
||||
}
|
35
routing/routing_integration_tests/bicycle_turn_test.cpp
Normal file
35
routing/routing_integration_tests/bicycle_turn_test.cpp
Normal 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.);
|
||||
}
|
|
@ -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 \
|
||||
|
|
Loading…
Add table
Reference in a new issue