Adapts all unit tests and benchmarks to compile under v5 again
This commit is contained in:
committed by
Patrick Niklaus
parent
0f0db4c823
commit
1486098065
@@ -31,16 +31,15 @@ BOOST_AUTO_TEST_CASE(long_road_test)
|
||||
CompressedEdgeContainer container;
|
||||
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edge_id, name_id, access_restricted, reversed, roundabout,
|
||||
// travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT}};
|
||||
// src, tgt, dist, edge_id, name_id, access_restricted, fwd, bkwd, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE}};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[2].data));
|
||||
BOOST_ASSERT(edges[2].data.IsCompatibleTo(edges[4].data));
|
||||
@@ -72,20 +71,19 @@ BOOST_AUTO_TEST_CASE(loop_test)
|
||||
CompressedEdgeContainer container;
|
||||
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward,
|
||||
// roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{0, 5, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{4, 5, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{5, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{5, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
// src, tgt, dist, edge_id, name_id, access_restricted, fwd, bkwd, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{0, 5, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{3, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{3, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{4, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{4, 5, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{5, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{5, 4, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges.size() == 12);
|
||||
@@ -129,14 +127,13 @@ BOOST_AUTO_TEST_CASE(t_intersection)
|
||||
CompressedEdgeContainer container;
|
||||
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edge_id, name_id, access_restricted, reversed, roundabout,
|
||||
// travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{3, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
// src, tgt, dist, edge_id, name_id, access_restricted, fwd, bkwd, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 3, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{3, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[1].data));
|
||||
@@ -167,12 +164,11 @@ BOOST_AUTO_TEST_CASE(street_name_changes)
|
||||
CompressedEdgeContainer container;
|
||||
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edge_id, name_id, access_restricted, forward, backward,
|
||||
// roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 1, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 1, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
// src, tgt, dist, edge_id, name_id, access_restricted, fwd, bkwd, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 1, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 1, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
};
|
||||
|
||||
BOOST_ASSERT(edges[0].data.IsCompatibleTo(edges[1].data));
|
||||
@@ -199,12 +195,11 @@ BOOST_AUTO_TEST_CASE(direction_changes)
|
||||
CompressedEdgeContainer container;
|
||||
|
||||
std::vector<InputEdge> edges = {
|
||||
// source, target, distance, edge_id, name_id, access_restricted, reverse, roundabout,
|
||||
// travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_DEFAULT},
|
||||
// src, tgt, dist, edge_id, name_id, access_restricted, fwd, bkwd, roundabout, travel_mode
|
||||
{0, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 0, 1, SPECIAL_EDGEID, 0, false, true, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{1, 2, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
{2, 1, 1, SPECIAL_EDGEID, 0, false, false, false, true, TRAVEL_MODE_INACCESSIBLE},
|
||||
};
|
||||
|
||||
Graph graph(5, edges);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
// implements all data storage when shared memory _IS_ used
|
||||
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "engine/datafacade/datafacade_base.hpp"
|
||||
#include "contractor/query_edge.hpp"
|
||||
|
||||
@@ -11,18 +12,17 @@ namespace osrm
|
||||
namespace test
|
||||
{
|
||||
|
||||
template <class EdgeDataT>
|
||||
class MockDataFacadeT final : public osrm::engine::datafacade::BaseDataFacade<EdgeDataT>
|
||||
class MockDataFacade final : public engine::datafacade::BaseDataFacade
|
||||
{
|
||||
private:
|
||||
EdgeDataT foo;
|
||||
EdgeData foo;
|
||||
|
||||
public:
|
||||
unsigned GetNumberOfNodes() const { return 0; }
|
||||
unsigned GetNumberOfEdges() const { return 0; }
|
||||
unsigned GetOutDegree(const NodeID /* n */) const { return 0; }
|
||||
NodeID GetTarget(const EdgeID /* e */) const { return SPECIAL_NODEID; }
|
||||
const EdgeDataT &GetEdgeData(const EdgeID /* e */) const { return foo; }
|
||||
const EdgeData &GetEdgeData(const EdgeID /* e */) const { return foo; }
|
||||
EdgeID BeginEdges(const NodeID /* n */) const { return SPECIAL_EDGEID; }
|
||||
EdgeID EndEdges(const NodeID /* n */) const { return SPECIAL_EDGEID; }
|
||||
osrm::engine::datafacade::EdgeRange GetAdjacentEdgeRange(const NodeID /* node */) const
|
||||
@@ -40,10 +40,9 @@ class MockDataFacadeT final : public osrm::engine::datafacade::BaseDataFacade<Ed
|
||||
{
|
||||
return SPECIAL_EDGEID;
|
||||
}
|
||||
util::FixedPointCoordinate GetCoordinateOfNode(const unsigned /* id */) const
|
||||
util::Coordinate GetCoordinateOfNode(const unsigned /* id */) const
|
||||
{
|
||||
FixedPointCoordinate foo(0, 0);
|
||||
return foo;
|
||||
return {util::FixedLongitude{0}, util::FixedLatitude{0}};
|
||||
}
|
||||
bool EdgeIsCompressed(const unsigned /* id */) const { return false; }
|
||||
unsigned GetGeometryIndexForEdgeID(const unsigned /* id */) const { return SPECIAL_NODEID; }
|
||||
@@ -55,48 +54,99 @@ class MockDataFacadeT final : public osrm::engine::datafacade::BaseDataFacade<Ed
|
||||
std::vector<EdgeWeight> & /* result_weights */) const
|
||||
{
|
||||
}
|
||||
extractor::TurnInstruction GetTurnInstructionForEdgeID(const unsigned /* id */) const
|
||||
extractor::guidance::TurnInstruction GetTurnInstructionForEdgeID(const unsigned /* id */) const
|
||||
{
|
||||
return osrm::extractor::TurnInstruction::NoTurn;
|
||||
return extractor::guidance::TurnInstruction::NO_TURN();
|
||||
}
|
||||
extractor::TravelMode GetTravelModeForEdgeID(const unsigned /* id */) const
|
||||
{
|
||||
return TRAVEL_MODE_DEFAULT;
|
||||
return TRAVEL_MODE_INACCESSIBLE;
|
||||
}
|
||||
std::vector<typename osrm::engine::datafacade::BaseDataFacade<EdgeDataT>::RTreeLeaf>
|
||||
GetEdgesInBox(const util::FixedPointCoordinate & /* south_west */,
|
||||
const util::FixedPointCoordinate & /*north_east */)
|
||||
std::vector<RTreeLeaf> GetEdgesInBox(const util::Coordinate /* south_west */,
|
||||
const util::Coordinate /*north_east */)
|
||||
{
|
||||
std::vector<typename osrm::engine::datafacade::BaseDataFacade<EdgeDataT>::RTreeLeaf> foo;
|
||||
return foo;
|
||||
return {};
|
||||
}
|
||||
std::vector<osrm::engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodesInRange(const util::FixedPointCoordinate /* input_coordinate */,
|
||||
const float /* max_distance */,
|
||||
const int /* bearing = 0 */,
|
||||
const int /* bearing_range = 180 */)
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
|
||||
const float /*max_distance*/,
|
||||
const int /*bearing*/,
|
||||
const int /*bearing_range*/)
|
||||
{
|
||||
std::vector<osrm::engine::PhantomNodeWithDistance> foo;
|
||||
return foo;
|
||||
return {};
|
||||
}
|
||||
std::vector<osrm::engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodes(const util::FixedPointCoordinate /* input_coordinate */,
|
||||
const unsigned /* max_results */,
|
||||
const int /* bearing = 0 */,
|
||||
const int /* bearing_range = 180 */)
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/,
|
||||
const float /*max_distance*/)
|
||||
{
|
||||
std::vector<osrm::engine::PhantomNodeWithDistance> foo;
|
||||
return foo;
|
||||
return {};
|
||||
}
|
||||
std::pair<osrm::engine::PhantomNode, osrm::engine::PhantomNode>
|
||||
NearestPhantomNodeWithAlternativeFromBigComponent(
|
||||
const util::FixedPointCoordinate /* input_coordinate */,
|
||||
const int /* bearing = 0 */,
|
||||
const int /* bearing_range = 180 */)
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
|
||||
const unsigned /*max_results*/,
|
||||
const double /*max_distance*/,
|
||||
const int /*bearing*/,
|
||||
const int /*bearing_range*/)
|
||||
{
|
||||
std::pair<osrm::engine::PhantomNode, osrm::engine::PhantomNode> foo;
|
||||
return foo;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
|
||||
const unsigned /*max_results*/,
|
||||
const int /*bearing*/,
|
||||
const int /*bearing_range*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/, const unsigned /*max_results*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<engine::PhantomNodeWithDistance>
|
||||
NearestPhantomNodes(const util::Coordinate /*input_coordinate*/,
|
||||
const unsigned /*max_results*/,
|
||||
const double /*max_distance*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::pair<engine::PhantomNode, engine::PhantomNode>
|
||||
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::pair<engine::PhantomNode, engine::PhantomNode>
|
||||
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/,
|
||||
const double /*max_distance*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::pair<engine::PhantomNode, engine::PhantomNode>
|
||||
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/,
|
||||
const double /*max_distance*/,
|
||||
const int /*bearing*/,
|
||||
const int /*bearing_range*/)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::pair<engine::PhantomNode, engine::PhantomNode>
|
||||
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/,
|
||||
const int /*bearing*/,
|
||||
const int /*bearing_range*/)
|
||||
{
|
||||
return {};
|
||||
};
|
||||
|
||||
unsigned GetCheckSum() const { return 0; }
|
||||
bool IsCoreNode(const NodeID /* id */) const { return false; }
|
||||
unsigned GetNameIndexFromEdgeID(const unsigned /* id */) const { return 0; }
|
||||
@@ -105,9 +155,7 @@ class MockDataFacadeT final : public osrm::engine::datafacade::BaseDataFacade<Ed
|
||||
std::string GetTimestamp() const { return ""; }
|
||||
bool GetUTurnsDefault() const override { return true; }
|
||||
};
|
||||
|
||||
using MockDataFacade = MockDataFacadeT<contractor::QueryEdge::EdgeData>;
|
||||
} // osrm::test::
|
||||
} // osrm::
|
||||
} // ns test
|
||||
} // ns osrm
|
||||
|
||||
#endif // MOCK_DATAFACADE_HPP
|
||||
|
||||
@@ -303,19 +303,18 @@ BOOST_AUTO_TEST_CASE(regression_test)
|
||||
using Edge = std::pair<unsigned, unsigned>;
|
||||
GraphFixture fixture(
|
||||
{
|
||||
Coord{FloatLongitude{0.0}, FloatLatitude{40.0}}, //
|
||||
Coord{FloatLongitude{5.0}, FloatLatitude{35.0}}, //
|
||||
Coord{FloatLongitude{5.0},
|
||||
FloatLatitude{
|
||||
5.0,
|
||||
}}, //
|
||||
Coord{FloatLongitude{10.0}, FloatLatitude{0.0}}, //
|
||||
Coord{FloatLongitude{10.0}, FloatLatitude{20.0}}, //
|
||||
Coord{FloatLongitude{5.0}, FloatLatitude{20.0}}, //
|
||||
Coord{FloatLongitude{100.0}, FloatLatitude{40.0}}, //
|
||||
Coord{FloatLongitude{105.0}, FloatLatitude{35.0}}, //
|
||||
Coord{FloatLongitude{105.0}, FloatLatitude{5.0}}, //
|
||||
Coord{FloatLongitude{110.0}, FloatLatitude{0.0}}, //
|
||||
Coord{FloatLongitude{0.0}, FloatLatitude{40.0}}, //
|
||||
Coord{FloatLongitude{5.0}, FloatLatitude{35.0}}, //
|
||||
Coord{FloatLongitude{5.0},
|
||||
FloatLatitude{
|
||||
5.0, }}, //
|
||||
Coord{FloatLongitude{10.0}, FloatLatitude{0.0}}, //
|
||||
Coord{FloatLongitude{10.0}, FloatLatitude{20.0}}, //
|
||||
Coord{FloatLongitude{5.0}, FloatLatitude{20.0}}, //
|
||||
Coord{FloatLongitude{100.0}, FloatLatitude{40.0}}, //
|
||||
Coord{FloatLongitude{105.0}, FloatLatitude{35.0}}, //
|
||||
Coord{FloatLongitude{105.0}, FloatLatitude{5.0}}, //
|
||||
Coord{FloatLongitude{110.0}, FloatLatitude{0.0}}, //
|
||||
},
|
||||
{Edge(0, 1), Edge(2, 3), Edge(4, 5), Edge(6, 7), Edge(8, 9)});
|
||||
|
||||
@@ -399,8 +398,8 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
|
||||
using Edge = std::pair<unsigned, unsigned>;
|
||||
GraphFixture fixture(
|
||||
{
|
||||
Coord(FloatLongitude(0.0), FloatLatitude(0.0)),
|
||||
Coord(FloatLongitude(10.0), FloatLatitude(10.0)),
|
||||
Coord(FloatLongitude(0.0), FloatLatitude(0.0)),
|
||||
Coord(FloatLongitude(10.0), FloatLatitude(10.0)),
|
||||
},
|
||||
{Edge(0, 1), Edge(1, 0)});
|
||||
|
||||
@@ -408,9 +407,9 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
|
||||
std::string nodes_path;
|
||||
build_rtree<GraphFixture, MiniStaticRTree>("test_bearing", &fixture, leaves_path, nodes_path);
|
||||
MiniStaticRTree rtree(nodes_path, leaves_path, fixture.coords);
|
||||
std::unique_ptr<MockDataFacade> mockfacade_ptr(new MockDataFacade);
|
||||
MockDataFacade mockfacade;
|
||||
engine::GeospatialQuery<MiniStaticRTree, MockDataFacade> query(rtree, fixture.coords,
|
||||
*mockfacade_ptr);
|
||||
mockfacade);
|
||||
|
||||
Coordinate input(FloatLongitude(5.1), FloatLatitude(5.0));
|
||||
|
||||
@@ -462,11 +461,11 @@ BOOST_AUTO_TEST_CASE(bbox_search_tests)
|
||||
|
||||
GraphFixture fixture(
|
||||
{
|
||||
Coord(FloatLongitude(0.0), FloatLatitude(0.0)),
|
||||
Coord(FloatLongitude(1.0), FloatLatitude(1.0)),
|
||||
Coord(FloatLongitude(2.0), FloatLatitude(2.0)),
|
||||
Coord(FloatLongitude(3.0), FloatLatitude(3.0)),
|
||||
Coord(FloatLongitude(4.0), FloatLatitude(4.0)),
|
||||
Coord(FloatLongitude(0.0), FloatLatitude(0.0)),
|
||||
Coord(FloatLongitude(1.0), FloatLatitude(1.0)),
|
||||
Coord(FloatLongitude(2.0), FloatLatitude(2.0)),
|
||||
Coord(FloatLongitude(3.0), FloatLatitude(3.0)),
|
||||
Coord(FloatLongitude(4.0), FloatLatitude(4.0)),
|
||||
},
|
||||
{Edge(0, 1), Edge(1, 2), Edge(2, 3), Edge(3, 4)});
|
||||
|
||||
@@ -474,20 +473,20 @@ BOOST_AUTO_TEST_CASE(bbox_search_tests)
|
||||
std::string nodes_path;
|
||||
build_rtree<GraphFixture, MiniStaticRTree>("test_bbox", &fixture, leaves_path, nodes_path);
|
||||
MiniStaticRTree rtree(nodes_path, leaves_path, fixture.coords);
|
||||
std::unique_ptr<MockDataFacade> mockfacade_ptr(new MockDataFacade);
|
||||
MockDataFacade mockfacade;
|
||||
engine::GeospatialQuery<MiniStaticRTree, MockDataFacade> query(rtree, fixture.coords,
|
||||
*mockfacade_ptr);
|
||||
mockfacade);
|
||||
|
||||
{
|
||||
RectangleInt2D bbox = {FloatLongitude(0.5), FloatLongitude(1.5), FloatLatitude(0.5),
|
||||
FloatLatitude(1.5)};
|
||||
RectangleInt2D bbox = {
|
||||
FloatLongitude(0.5), FloatLongitude(1.5), FloatLatitude(0.5), FloatLatitude(1.5)};
|
||||
auto results = query.Search(bbox);
|
||||
BOOST_CHECK_EQUAL(results.size(), 2);
|
||||
}
|
||||
|
||||
{
|
||||
RectangleInt2D bbox = {FloatLongitude(1.5), FloatLongitude(3.5), FloatLatitude(1.5),
|
||||
FloatLatitude(3.5)};
|
||||
RectangleInt2D bbox = {
|
||||
FloatLongitude(1.5), FloatLongitude(3.5), FloatLatitude(1.5), FloatLatitude(3.5)};
|
||||
auto results = query.Search(bbox);
|
||||
BOOST_CHECK_EQUAL(results.size(), 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user