From 0c15d5d8f89b99a3ff77f8ca23788917dd63facb Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Tue, 16 Jan 2018 16:03:24 -0800 Subject: [PATCH] Get tests building again. --- include/engine/datafacade/datafacade_base.hpp | 1 + .../engine/collapse_internal_route_result.cpp | 26 +++++++++---------- unit_tests/engine/guidance_assembly.cpp | 6 +++-- unit_tests/engine/offline_facade.cpp | 6 +++++ unit_tests/mocks/mock_datafacade.hpp | 7 +++++ .../mocks/mock_scripting_environment.hpp | 4 ++- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/include/engine/datafacade/datafacade_base.hpp b/include/engine/datafacade/datafacade_base.hpp index 35ce3a3d03b..c6c1ffa6da0 100644 --- a/include/engine/datafacade/datafacade_base.hpp +++ b/include/engine/datafacade/datafacade_base.hpp @@ -194,6 +194,7 @@ class BaseDataFacade virtual bool IsLeftHandDriving(const NodeID id) const = 0; virtual bool IsSegregated(const NodeID) const = 0; + virtual std::vector GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0; }; diff --git a/unit_tests/engine/collapse_internal_route_result.cpp b/unit_tests/engine/collapse_internal_route_result.cpp index ded391b6165..6e73cafbf44 100644 --- a/unit_tests/engine/collapse_internal_route_result.cpp +++ b/unit_tests/engine/collapse_internal_route_result.cpp @@ -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}}; @@ -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; @@ -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; @@ -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; diff --git a/unit_tests/engine/guidance_assembly.cpp b/unit_tests/engine/guidance_assembly.cpp index d7ec393559d..7dd5c1ee239 100644 --- a/unit_tests/engine/guidance_assembly.cpp +++ b/unit_tests/engine/guidance_assembly.cpp @@ -38,7 +38,8 @@ BOOST_AUTO_TEST_CASE(trim_short_segments) {}}; // Check that duplicated coordinate in the end is removed - std::vector steps = {{324, + std::vector steps = {{0, + 324, false, "Central Park West", "", @@ -60,7 +61,8 @@ BOOST_AUTO_TEST_CASE(trim_short_segments) 0, 3, {intersection1}}, - {324, + {0, + 324, false, "Central Park West", "", diff --git a/unit_tests/engine/offline_facade.cpp b/unit_tests/engine/offline_facade.cpp index ec8d66ecbf0..43baf31e8a1 100644 --- a/unit_tests/engine/offline_facade.cpp +++ b/unit_tests/engine/offline_facade.cpp @@ -367,6 +367,12 @@ class ContiguousInternalMemoryDataFacade 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 + GetOverridesThatStartAt(const NodeID /* edge_based_node_id */) const override + { + return {}; + } }; } // datafacade diff --git a/unit_tests/mocks/mock_datafacade.hpp b/unit_tests/mocks/mock_datafacade.hpp index 2d92972bb55..3aadeed4afe 100644 --- a/unit_tests/mocks/mock_datafacade.hpp +++ b/unit_tests/mocks/mock_datafacade.hpp @@ -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" @@ -264,6 +265,12 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade result.activate(3); return result; } + + std::vector + GetOverridesThatStartAt(const NodeID /* edge_based_node_id */) const override + { + return {}; + } }; template class MockAlgorithmDataFacade; diff --git a/unit_tests/mocks/mock_scripting_environment.hpp b/unit_tests/mocks/mock_scripting_environment.hpp index 1ca714a10be..7f1d6965ff7 100644 --- a/unit_tests/mocks/mock_scripting_environment.hpp +++ b/unit_tests/mocks/mock_scripting_environment.hpp @@ -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" @@ -40,7 +41,8 @@ class MockScriptingEnvironment : public extractor::ScriptingEnvironment const extractor::ExtractionRelationContainer &, std::vector> &, std::vector> &, - std::vector &) override final + std::vector &, + std::vector &) = 0; { }