MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

unit_tests/library/limits.cpp:25–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23BOOST_AUTO_TEST_SUITE(limits)
24
25BOOST_AUTO_TEST_CASE(test_trip_limits)
26{
27 using namespace osrm;
28
29 EngineConfig config;
30 config.storage_config = {OSRM_TEST_DATA_DIR "/ch/monaco.osrm"};
31 config.use_shared_memory = false;
32 config.max_locations_trip = 2;
33
34 OSRM osrm{config};
35
36 TripParameters params;
37 params.coordinates.emplace_back(getZeroCoordinate());
38 params.coordinates.emplace_back(getZeroCoordinate());
39 params.coordinates.emplace_back(getZeroCoordinate());
40
41 engine::api::ResultT result = json::Object();
42
43 const auto rc = osrm.Trip(params, result);
44
45 BOOST_CHECK(rc == Status::Error);
46
47 // Make sure we're not accidentally hitting a guard code path before
48 auto &json_result = std::get<json::Object>(result);
49 const auto code = std::get<json::String>(json_result.values["code"]).value;
50 BOOST_CHECK(code == "TooBig"); // per the New-Server API spec
51}
52
53BOOST_AUTO_TEST_CASE(test_route_limits)
54{

Callers

nothing calls this directly

Calls 8

getZeroCoordinateFunction · 0.85
ObjectClass · 0.50
emplace_backMethod · 0.45
TripMethod · 0.45
RouteMethod · 0.45
TableMethod · 0.45
MatchMethod · 0.45
NearestMethod · 0.45

Tested by

no test coverage detected