void test_func_all(TIndex& index) { const osmium::unsigned_object_id_type id1 = 12; const osmium::unsigned_object_id_type id2 = 3; const osmium::Location loc1{1.2, 4.5}; const osmium::Location loc2{3.5, -7.2}; REQUIRE_THROWS_AS(index.get(id1), const osmium::not_found&); index.set(id1, loc1); index.set(id2, loc2); index.sort(); REQUIRE_THROWS_AS(index.get(0), const osmium::not_found&); REQUIRE_THROWS_AS(index.get(1), const osmium::not_found&); REQUIRE_THROWS_AS(index.get(5), const osmium::not_found&); REQUIRE_THROWS_AS(index.get(100), const osmium::not_found&); REQUIRE_THROWS_WITH(index.get(0), "id 0 not found"); REQUIRE_THROWS_WITH(index.get(1), "id 1 not found"); REQUIRE(index.get_noexcept(0) == osmium::Location{}); REQUIRE(index.get_noexcept(1) == osmium::Location{}); REQUIRE(index.get_noexcept(5) == osmium::Location{}); REQUIRE(index.get_noexcept(100) == osmium::Location{}); }
void test_func_all(TIndex& index) { osmium::object_id_type id1 = 12; osmium::object_id_type id2 = 3; osmium::Location loc1(1.2, 4.5); osmium::Location loc2(3.5, -7.2); BOOST_CHECK_THROW(index.get(id1), osmium::not_found); index.set(id1, loc1); index.set(id2, loc2); index.sort(); BOOST_CHECK_THROW(index.get(5), osmium::not_found); BOOST_CHECK_THROW(index.get(100), osmium::not_found); }