diff --git a/src/benchmarks/static_rtree.cpp b/src/benchmarks/static_rtree.cpp index 58f57f92c..211118087 100644 --- a/src/benchmarks/static_rtree.cpp +++ b/src/benchmarks/static_rtree.cpp @@ -1,14 +1,16 @@ -#include "extractor/query_node.hpp" -#include "util/static_rtree.hpp" -#include "extractor/edge_based_node.hpp" #include "engine/geospatial_query.hpp" +#include "extractor/query_node.hpp" +#include "extractor/edge_based_node.hpp" +#include "util/static_rtree.hpp" #include "util/timing_util.hpp" -#include "mocks/mock_datafacade.hpp" #include "util/coordinate.hpp" +#include "mocks/mock_datafacade.hpp" #include #include +#include + namespace osrm { namespace benchmarks @@ -77,7 +79,8 @@ void benchmark(BenchStaticRTree &rtree, BenchQuery &geo_query, unsigned num_quer std::vector queries; for (unsigned i = 0; i < num_queries; i++) { - queries.emplace_back(lat_udist(mt_rand), lon_udist(mt_rand)); + queries.emplace_back(util::FixedLongitude{lon_udist(mt_rand)}, + util::FixedLatitude{lat_udist(mt_rand)}); } benchmarkQuery(queries, "raw RTree queries (1 result)", [&rtree](const util::Coordinate &q) @@ -126,9 +129,8 @@ int main(int argc, char **argv) auto coords = osrm::benchmarks::loadCoordinates(nodes_path); osrm::benchmarks::BenchStaticRTree rtree(ram_path, file_path, coords); - std::unique_ptr mockfacade_ptr( - new osrm::benchmarks::MockDataFacade); - osrm::benchmarks::BenchQuery query(rtree, coords, *mockfacade_ptr); + osrm::test::MockDataFacade mockfacade; + osrm::benchmarks::BenchQuery query(rtree, coords, mockfacade); osrm::benchmarks::benchmark(rtree, query, 10000); diff --git a/src/util/coordinate_calculation.cpp b/src/util/coordinate_calculation.cpp index 1f6de1003..5d788304b 100644 --- a/src/util/coordinate_calculation.cpp +++ b/src/util/coordinate_calculation.cpp @@ -1,6 +1,5 @@ +#include "util/coordinate.hpp" #include "util/coordinate_calculation.hpp" - -#include "util/string_util.hpp" #include "util/trigonometry_table.hpp" #include @@ -8,6 +7,7 @@ #include #include +#include namespace osrm { @@ -260,11 +260,13 @@ double computeAngle(const Coordinate first, const Coordinate second, const Coord Coordinate interpolateLinear(double factor, const Coordinate from, const Coordinate to) { BOOST_ASSERT(0 <= factor && factor <= 1.0); - return { - from.lon + - toFixed(FloatLongitude(factor * static_cast(toFloating(to.lon - from.lon)))), - from.lat + - toFixed(FloatLatitude(factor * static_cast(toFloating(to.lat - from.lat))))}; + + FloatLongitude interpolated_lon{((1. - factor) * static_cast(from.lon)) + + (factor * static_cast(to.lon))}; + FloatLatitude interpolated_lat{((1. - factor) * static_cast(from.lat)) + + (factor * static_cast(to.lat))}; + + return {std::move(interpolated_lon), std::move(interpolated_lat)}; } namespace mercator diff --git a/unit_tests/extractor/graph_compressor.cpp b/unit_tests/extractor/graph_compressor.cpp index 83751bf6a..ee935a4bb 100644 --- a/unit_tests/extractor/graph_compressor.cpp +++ b/unit_tests/extractor/graph_compressor.cpp @@ -31,16 +31,15 @@ BOOST_AUTO_TEST_CASE(long_road_test) CompressedEdgeContainer container; std::vector 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 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 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 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 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); diff --git a/unit_tests/mocks/mock_datafacade.hpp b/unit_tests/mocks/mock_datafacade.hpp index 720b07607..873a53a95 100644 --- a/unit_tests/mocks/mock_datafacade.hpp +++ b/unit_tests/mocks/mock_datafacade.hpp @@ -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 MockDataFacadeT final : public osrm::engine::datafacade::BaseDataFacade +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 & /* 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::RTreeLeaf> - GetEdgesInBox(const util::FixedPointCoordinate & /* south_west */, - const util::FixedPointCoordinate & /*north_east */) + std::vector GetEdgesInBox(const util::Coordinate /* south_west */, + const util::Coordinate /*north_east */) { - std::vector::RTreeLeaf> foo; - return foo; + return {}; } - std::vector - NearestPhantomNodesInRange(const util::FixedPointCoordinate /* input_coordinate */, - const float /* max_distance */, - const int /* bearing = 0 */, - const int /* bearing_range = 180 */) + + std::vector + NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/, + const float /*max_distance*/, + const int /*bearing*/, + const int /*bearing_range*/) { - std::vector foo; - return foo; + return {}; } - std::vector - NearestPhantomNodes(const util::FixedPointCoordinate /* input_coordinate */, - const unsigned /* max_results */, - const int /* bearing = 0 */, - const int /* bearing_range = 180 */) + + std::vector + NearestPhantomNodesInRange(const util::Coordinate /*input_coordinate*/, + const float /*max_distance*/) { - std::vector foo; - return foo; + return {}; } - std::pair - NearestPhantomNodeWithAlternativeFromBigComponent( - const util::FixedPointCoordinate /* input_coordinate */, - const int /* bearing = 0 */, - const int /* bearing_range = 180 */) + + std::vector + NearestPhantomNodes(const util::Coordinate /*input_coordinate*/, + const unsigned /*max_results*/, + const double /*max_distance*/, + const int /*bearing*/, + const int /*bearing_range*/) { - std::pair foo; - return foo; + return {}; } + + std::vector + NearestPhantomNodes(const util::Coordinate /*input_coordinate*/, + const unsigned /*max_results*/, + const int /*bearing*/, + const int /*bearing_range*/) + { + return {}; + } + + std::vector + NearestPhantomNodes(const util::Coordinate /*input_coordinate*/, const unsigned /*max_results*/) + { + return {}; + } + + std::vector + NearestPhantomNodes(const util::Coordinate /*input_coordinate*/, + const unsigned /*max_results*/, + const double /*max_distance*/) + { + return {}; + } + + std::pair + NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/) + { + return {}; + } + + std::pair + NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, + const double /*max_distance*/) + { + return {}; + } + + std::pair + NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, + const double /*max_distance*/, + const int /*bearing*/, + const int /*bearing_range*/) + { + return {}; + } + + std::pair + 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; -} // osrm::test:: -} // osrm:: +} // ns test +} // ns osrm #endif // MOCK_DATAFACADE_HPP diff --git a/unit_tests/util/static_rtree.cpp b/unit_tests/util/static_rtree.cpp index d61ec2815..da1a46f66 100644 --- a/unit_tests/util/static_rtree.cpp +++ b/unit_tests/util/static_rtree.cpp @@ -303,19 +303,18 @@ BOOST_AUTO_TEST_CASE(regression_test) using Edge = std::pair; 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; 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("test_bearing", &fixture, leaves_path, nodes_path); MiniStaticRTree rtree(nodes_path, leaves_path, fixture.coords); - std::unique_ptr mockfacade_ptr(new MockDataFacade); + MockDataFacade mockfacade; engine::GeospatialQuery 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("test_bbox", &fixture, leaves_path, nodes_path); MiniStaticRTree rtree(nodes_path, leaves_path, fixture.coords); - std::unique_ptr mockfacade_ptr(new MockDataFacade); + MockDataFacade mockfacade; engine::GeospatialQuery 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); }