Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
danpat committed Nov 1, 2018
1 parent e605d84 commit a01c761
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 52 deletions.
58 changes: 26 additions & 32 deletions unit_tests/engine/offline_facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,58 +224,52 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
{
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const Approach /*approach*/) const override
{
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
{
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const int /*bearing*/,
const int /*bearing_range*/,
const Approach /*approach*/) const override
{
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const Approach /*approach*/) const override
{
return {};
}

std::vector<PhantomNodeWithDistance>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
const Approach /*approach*/) const override
std::vector<PhantomNode> NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
const Approach /*approach*/) const override
{
return {};
}
Expand Down
12 changes: 6 additions & 6 deletions unit_tests/mocks/mock_datafacade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const int /*bearing*/,
Expand All @@ -118,15 +118,15 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
const float /*max_distance*/,
const engine::Approach /*approach*/) const override
{
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
Expand All @@ -137,7 +137,7 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const int /*bearing*/,
Expand All @@ -147,15 +147,15 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const engine::Approach /*approach*/) const override
{
return {};
}

std::vector<engine::PhantomNodeWithDistance>
std::vector<engine::PhantomNode>
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
const unsigned /*max_results*/,
const double /*max_distance*/,
Expand Down
28 changes: 14 additions & 14 deletions unit_tests/util/static_rtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
{
auto results = query.NearestPhantomNodes(input, 5, osrm::engine::Approach::UNRESTRICTED);
BOOST_CHECK_EQUAL(results.size(), 2);
BOOST_CHECK_EQUAL(results.back().phantom_node.forward_segment_id.id, 0);
BOOST_CHECK_EQUAL(results.back().phantom_node.reverse_segment_id.id, 1);
BOOST_CHECK_EQUAL(results.back().forward_segment_id.id, 0);
BOOST_CHECK_EQUAL(results.back().reverse_segment_id.id, 1);
}

{
Expand All @@ -395,13 +395,13 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
query.NearestPhantomNodes(input, 5, 45, 10, osrm::engine::Approach::UNRESTRICTED);
BOOST_CHECK_EQUAL(results.size(), 2);

BOOST_CHECK(results[0].phantom_node.forward_segment_id.enabled);
BOOST_CHECK(!results[0].phantom_node.reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[0].phantom_node.forward_segment_id.id, 1);
BOOST_CHECK(results[0].forward_segment_id.enabled);
BOOST_CHECK(!results[0].reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[0].forward_segment_id.id, 1);

BOOST_CHECK(!results[1].phantom_node.forward_segment_id.enabled);
BOOST_CHECK(results[1].phantom_node.reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[1].phantom_node.reverse_segment_id.id, 1);
BOOST_CHECK(!results[1].forward_segment_id.enabled);
BOOST_CHECK(results[1].reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[1].reverse_segment_id.id, 1);
}

{
Expand All @@ -421,13 +421,13 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
input, 11000, 45, 10, osrm::engine::Approach::UNRESTRICTED);
BOOST_CHECK_EQUAL(results.size(), 2);

BOOST_CHECK(results[0].phantom_node.forward_segment_id.enabled);
BOOST_CHECK(!results[0].phantom_node.reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[0].phantom_node.forward_segment_id.id, 1);
BOOST_CHECK(results[0].forward_segment_id.enabled);
BOOST_CHECK(!results[0].reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[0].forward_segment_id.id, 1);

BOOST_CHECK(!results[1].phantom_node.forward_segment_id.enabled);
BOOST_CHECK(results[1].phantom_node.reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[1].phantom_node.reverse_segment_id.id, 1);
BOOST_CHECK(!results[1].forward_segment_id.enabled);
BOOST_CHECK(results[1].reverse_segment_id.enabled);
BOOST_CHECK_EQUAL(results[1].reverse_segment_id.id, 1);
}
}

Expand Down

0 comments on commit a01c761

Please sign in to comment.