| 23 | BOOST_AUTO_TEST_SUITE(limits) |
| 24 | |
| 25 | BOOST_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 | |
| 53 | BOOST_AUTO_TEST_CASE(test_route_limits) |
| 54 | { |
nothing calls this directly
no test coverage detected