Asserts on valid v5 conforming maneuver types, resolves #3035
This commit is contained in:
parent
b72dc8c0cf
commit
8ed6bb8a1b
@ -175,10 +175,18 @@ std::string modeToString(const extractor::TravelMode mode)
|
|||||||
util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver)
|
util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver)
|
||||||
{
|
{
|
||||||
util::json::Object step_maneuver;
|
util::json::Object step_maneuver;
|
||||||
|
|
||||||
|
std::string maneuver_type;
|
||||||
|
|
||||||
if (maneuver.waypoint_type == guidance::WaypointType::None)
|
if (maneuver.waypoint_type == guidance::WaypointType::None)
|
||||||
step_maneuver.values["type"] = detail::instructionTypeToString(maneuver.instruction.type);
|
maneuver_type = detail::instructionTypeToString(maneuver.instruction.type);
|
||||||
else
|
else
|
||||||
step_maneuver.values["type"] = detail::waypointTypeToString(maneuver.waypoint_type);
|
maneuver_type = detail::waypointTypeToString(maneuver.waypoint_type);
|
||||||
|
|
||||||
|
// These invalid responses should never happen: log if they do happen
|
||||||
|
BOOST_ASSERT_MSG(maneuver_type != "invalid", "unexpected invalid maneuver type");
|
||||||
|
|
||||||
|
step_maneuver.values["type"] = std::move(maneuver_type);
|
||||||
|
|
||||||
if (detail::isValidModifier(maneuver))
|
if (detail::isValidModifier(maneuver))
|
||||||
step_maneuver.values["modifier"] =
|
step_maneuver.values["modifier"] =
|
||||||
|
Loading…
Reference in New Issue
Block a user