Adds generate_hints=true for dropping hints in response, resolves #1789.
Adds an `generate_hints=false` option which lets us skip generating and emitting hints for Waypoints. This can be used to decrease the response size when the user does not need hints anyway. We should think about making `false` the default here in v6.
This commit is contained in:
@@ -361,4 +361,25 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
|
||||
{
|
||||
const auto args = get_args();
|
||||
auto osrm = getOSRM(args.at(0));
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
RouteParameters params;
|
||||
params.steps = true;
|
||||
params.coordinates.push_back(get_dummy_location());
|
||||
params.coordinates.push_back(get_dummy_location());
|
||||
params.generate_hints = false;
|
||||
|
||||
json::Object result;
|
||||
const auto rc = osrm.Route(params, result);
|
||||
BOOST_CHECK(rc == Status::Ok);
|
||||
|
||||
for (auto waypoint : result.values["waypoints"].get<json::Array>().values)
|
||||
BOOST_CHECK_EQUAL(waypoint.get<json::Object>().values.count("hint"), 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user