Skip to content

Commit 32d1258

Browse files
committed
Add some more tests for huge ids in node_locations_t
1 parent e5a97dd commit 32d1258

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test-node-locations.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ TEST_CASE("huge ids should work", "[NoDB]")
8787

8888
REQUIRE(nl.size() == 4);
8989

90+
REQUIRE(nl.get(1ULL) == osmium::Location{1.0, 9.9});
91+
REQUIRE(nl.get(1ULL << 16U) == osmium::Location{1.1, 9.8});
92+
REQUIRE(nl.get(1ULL << 32U) == osmium::Location{1.2, 9.7});
9093
REQUIRE(nl.get(1ULL << 48U) == osmium::Location{1.3, 9.6});
94+
95+
REQUIRE(nl.get(2ULL) == osmium::Location{});
96+
REQUIRE(nl.get(1ULL << 40U) == osmium::Location{});
97+
REQUIRE(nl.get((1ULL << 48U) + 1U) == osmium::Location{});
98+
REQUIRE(nl.get((1ULL << 48U) - 1U) == osmium::Location{});
9199
}
92100

93101
TEST_CASE("full node locations store", "[NoDB]")

0 commit comments

Comments
 (0)