Adapts all unit tests and benchmarks to compile under v5 again

This commit is contained in:
Daniel J. Hofmann
2016-03-11 18:03:46 +01:00
committed by Patrick Niklaus
parent 0f0db4c823
commit 1486098065
5 changed files with 173 additions and 127 deletions
+27 -28
View File
@@ -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);
}