Change qi::lit for qi::symbols for the sides parameter parser.

Refactor code :
 - Suppress StartSide Enum
 - Change Side Structure for Enum

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
This commit is contained in:
FILLAU Jean-Maxime
2017-05-22 12:10:43 +02:00
committed by Patrick Niklaus
parent 2de17f3fd0
commit ec7934ea33
9 changed files with 40 additions and 86 deletions
+2 -3
View File
@@ -146,9 +146,8 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
}
std::pair<engine::PhantomNode, engine::PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(
const util::Coordinate /*input_coordinate*/,
const engine::SideValue /*side_value*/) const override
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/,
const engine::Side /*side*/) const override
{
return {};
}
+1 -1
View File
@@ -57,7 +57,7 @@ inline std::ostream &operator<<(std::ostream &out, Bearing bearing)
inline std::ostream &operator<<(std::ostream &out, Side side)
{
out << Side::toString(side);
out << side;
return out;
}
}
+12 -15
View File
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(invalid_route_urls)
BOOST_CHECK_EQUAL(testInvalidOptions<RouteParameters>("1,2;3,4?overview=false&radiuses=foo"),
32UL);
BOOST_CHECK_EQUAL(testInvalidOptions<RouteParameters>("1,2;3,4?overview=false&sides=foo"),
30UL);
29UL);
BOOST_CHECK_EQUAL(testInvalidOptions<RouteParameters>("1,2;3,4?overview=false&hints=foo"),
29UL);
BOOST_CHECK_EQUAL(testInvalidOptions<RouteParameters>("1,2;3,4?overview=false&hints=;;; ;"),
@@ -400,22 +400,19 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
BOOST_CHECK_EQUAL(result_17->annotations, true);
std::vector<boost::optional<engine::Side>> sides_18 = {
boost::none,
engine::Side{engine::SideValue::DEFAULT},
engine::Side{engine::SideValue::BOTH},
engine::Side{engine::SideValue::OPPOSITE},
boost::none, engine::Side::DEFAULT, engine::Side::BOTH, engine::Side::OPPOSITE,
};
RouteParameters reference_18{false,
false,
false,
RouteParameters::GeometriesType::Polyline,
RouteParameters::OverviewType::Simplified,
boost::optional<bool>{},
coords_3,
std::vector<boost::optional<engine::Hint>>{},
std::vector<boost::optional<double>>{},
std::vector<boost::optional<engine::Bearing>>{},
sides_18};
false,
false,
RouteParameters::GeometriesType::Polyline,
RouteParameters::OverviewType::Simplified,
boost::optional<bool>{},
coords_3,
std::vector<boost::optional<engine::Hint>>{},
std::vector<boost::optional<double>>{},
std::vector<boost::optional<engine::Bearing>>{},
sides_18};
auto result_18 = parseParameters<RouteParameters>("1,2;3,4;5,6;7,8?steps=false&sides=;d;b;o");
BOOST_CHECK(result_18);