Skip to content

Commit

Permalink
Get tests building again.
Browse files Browse the repository at this point in the history
  • Loading branch information
danpat committed Jan 17, 2018
1 parent 88dd44d commit 0c15d5d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
1 change: 1 addition & 0 deletions include/engine/datafacade/datafacade_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class BaseDataFacade
virtual bool IsLeftHandDriving(const NodeID id) const = 0;

virtual bool IsSegregated(const NodeID) const = 0;

virtual std::vector<extractor::ManeuverOverride>
GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0;
};
Expand Down
26 changes: 13 additions & 13 deletions unit_tests/engine/collapse_internal_route_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ BOOST_AUTO_TEST_CASE(unchanged_collapse_route_result)
PhantomNode target;
source.forward_segment_id = {1, true};
target.forward_segment_id = {6, true};
PathData pathy{2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData pathy{0, 2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{0, 1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
InternalRouteResult one_leg_result;
one_leg_result.unpacked_path_segments = {{pathy, kathy}};
one_leg_result.segment_end_coordinates = {PhantomNodes{source, target}};
Expand All @@ -38,9 +38,9 @@ BOOST_AUTO_TEST_CASE(unchanged_collapse_route_result)

BOOST_AUTO_TEST_CASE(two_legs_to_one_leg)
{
PathData pathy{2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData pathy{0, 2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{0, 1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{0, 3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PhantomNode node_1;
PhantomNode node_2;
PhantomNode node_3;
Expand Down Expand Up @@ -69,11 +69,11 @@ BOOST_AUTO_TEST_CASE(two_legs_to_one_leg)

BOOST_AUTO_TEST_CASE(three_legs_to_two_legs)
{
PathData pathy{2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData qathy{5, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData mathy{4, 18, false, 8, 9, 13, 4, 2, {}, 4, 2, {}, 2, {3.0}, {1.0}, false};
PathData pathy{0, 2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{0, 1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData qathy{0, 5, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{0, 3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData mathy{0, 4, 18, false, 8, 9, 13, 4, 2, {}, 4, 2, {}, 2, {3.0}, {1.0}, false};
PhantomNode node_1;
PhantomNode node_2;
PhantomNode node_3;
Expand Down Expand Up @@ -112,9 +112,9 @@ BOOST_AUTO_TEST_CASE(three_legs_to_two_legs)

BOOST_AUTO_TEST_CASE(two_legs_to_two_legs)
{
PathData pathy{2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData pathy{0, 2, 17, false, 2, 3, 4, 5, 0, {}, 4, 2, {}, 2, {1.0}, {1.0}, false};
PathData kathy{0, 1, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PathData cathy{0, 3, 16, false, 1, 2, 3, 4, 1, {}, 3, 1, {}, 1, {2.0}, {3.0}, false};
PhantomNode node_1;
PhantomNode node_2;
PhantomNode node_3;
Expand Down
6 changes: 4 additions & 2 deletions unit_tests/engine/guidance_assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ BOOST_AUTO_TEST_CASE(trim_short_segments)
{}};

// Check that duplicated coordinate in the end is removed
std::vector<RouteStep> steps = {{324,
std::vector<RouteStep> steps = {{0,
324,
false,
"Central Park West",
"",
Expand All @@ -60,7 +61,8 @@ BOOST_AUTO_TEST_CASE(trim_short_segments)
0,
3,
{intersection1}},
{324,
{0,
324,
false,
"Central Park West",
"",
Expand Down
6 changes: 6 additions & 0 deletions unit_tests/engine/offline_facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
util::guidance::EntryClass GetEntryClass(const EdgeID /*turn_id*/) const override { return {}; }
bool IsLeftHandDriving(const NodeID /*id*/) const override { return false; }
bool IsSegregated(const NodeID /*id*/) const override { return false; }

std::vector<extractor::ManeuverOverride>
GetOverridesThatStartAt(const NodeID /* edge_based_node_id */) const override
{
return {};
}
};

} // datafacade
Expand Down
7 changes: 7 additions & 0 deletions unit_tests/mocks/mock_datafacade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "extractor/class_data.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "extractor/guidance/turn_lane_types.hpp"
#include "extractor/maneuver_override.hpp"
#include "extractor/travel_mode.hpp"

#include "engine/algorithm.hpp"
Expand Down Expand Up @@ -264,6 +265,12 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
result.activate(3);
return result;
}

std::vector<extractor::ManeuverOverride>
GetOverridesThatStartAt(const NodeID /* edge_based_node_id */) const override
{
return {};
}
};

template <typename AlgorithmT> class MockAlgorithmDataFacade;
Expand Down
4 changes: 3 additions & 1 deletion unit_tests/mocks/mock_scripting_environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "extractor/extraction_segment.hpp"
#include "extractor/extraction_turn.hpp"
#include "extractor/maneuver_override.hpp"
#include "extractor/profile_properties.hpp"
#include "extractor/scripting_environment.hpp"

Expand Down Expand Up @@ -40,7 +41,8 @@ class MockScriptingEnvironment : public extractor::ScriptingEnvironment
const extractor::ExtractionRelationContainer &,
std::vector<std::pair<const osmium::Node &, extractor::ExtractionNode>> &,
std::vector<std::pair<const osmium::Way &, extractor::ExtractionWay>> &,
std::vector<extractor::InputConditionalTurnRestriction> &) override final
std::vector<extractor::InputConditionalTurnRestriction> &,
std::vector<extractor::InputManeuverOverride> &) = 0;
{
}

Expand Down

0 comments on commit 0c15d5d

Please sign in to comment.