Allow multiple GeoJSON files with locations data

This commit is contained in:
Michael Krasnyk
2017-09-22 16:42:00 +02:00
parent 095b345713
commit 476bc347b4
4 changed files with 24 additions and 21 deletions
@@ -49,7 +49,8 @@ BOOST_AUTO_TEST_CASE(polygon_tests)
}
]})json");
LocationDependentData data(fixture.temporary_file);
LocationDependentData data({fixture.temporary_file});
BOOST_CHECK_EQUAL(data(point_t(0, 0), "answer").which(), 0);
BOOST_CHECK_EQUAL(boost::get<double>(data(point_t(1, 1), "answer")), 42);
BOOST_CHECK_EQUAL(boost::get<double>(data(point_t(0, 1), "answer")), 42);
@@ -79,7 +80,8 @@ BOOST_AUTO_TEST_CASE(multy_polygon_tests)
}
]})json");
LocationDependentData data(fixture.temporary_file);
LocationDependentData data({fixture.temporary_file});
BOOST_CHECK_EQUAL(data(point_t(0, 2), "answer").which(), 0);
BOOST_CHECK_EQUAL(data(point_t(0, -3), "answer").which(), 0);
BOOST_CHECK_EQUAL(boost::get<double>(data(point_t(0, 0), "answer")), 42.);
@@ -109,7 +111,8 @@ BOOST_AUTO_TEST_CASE(polygon_merging_tests)
}
]})json");
LocationDependentData data(fixture.temporary_file);
LocationDependentData data({fixture.temporary_file});
BOOST_CHECK_EQUAL(boost::get<std::string>(data(point_t(-3, 3), "answer")), "a");
BOOST_CHECK_EQUAL(boost::get<std::string>(data(point_t(-3, 1), "answer")), "a");
BOOST_CHECK_EQUAL(boost::get<std::string>(data(point_t(-3, -3), "answer")), "a");
@@ -137,7 +140,7 @@ BOOST_AUTO_TEST_CASE(staircase_polygon)
}
]})json");
LocationDependentData data(fixture.temporary_file);
LocationDependentData data({fixture.temporary_file});
// all corners
BOOST_CHECK_NE(data(point_t(0, 0), "answer").which(), 0);