Skip to content

Commit b506ab9

Browse files
committed
Test with large ids in node_locations_t
1 parent 8c15465 commit b506ab9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test-node-locations.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ TEST_CASE("node locations in more than one block", "[NoDB]")
7676
}
7777
}
7878

79+
TEST_CASE("huge ids should work", "[NoDB]")
80+
{
81+
node_locations_t nl;
82+
83+
REQUIRE(nl.set(1ULL, {1.0, 9.9}));
84+
REQUIRE(nl.set(1ULL << 16U, {1.1, 9.8}));
85+
REQUIRE(nl.set(1ULL << 32U, {1.2, 9.7}));
86+
REQUIRE(nl.set(1ULL << 48U, {1.3, 9.6}));
87+
88+
REQUIRE(nl.size() == 4);
89+
90+
REQUIRE(nl.get(1ULL << 48U) == osmium::Location{1.3, 9.6});
91+
}
92+
7993
TEST_CASE("full node locations store", "[NoDB]")
8094
{
8195
node_locations_t nl{30};

0 commit comments

Comments
 (0)