diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-07-29 18:45:50 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-07-30 12:14:42 +0300 |
commit | aa111d14c31c56d50988c6c8a9b847234b56a791 (patch) | |
tree | a8241a4ba219396c0670dd85e42405e905d3aa7c | |
parent | b627e25645d97ca3a167e7dabe1cd7e5b0b3e3ef (diff) | |
download | qtlocation-mapboxgl-upstream/alexshalamov_fix_grid_index_wraparound.tar.gz |
[core] Add unit test for grid indexupstream/alexshalamov_fix_grid_index_wraparound
-rw-r--r-- | test/util/grid_index.test.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/util/grid_index.test.cpp b/test/util/grid_index.test.cpp index b0a4e581a3..157e66b38d 100644 --- a/test/util/grid_index.test.cpp +++ b/test/util/grid_index.test.cpp @@ -51,3 +51,8 @@ TEST(GridIndex, CircleBox) { EXPECT_EQ(grid.query({{0, 80}, {20, 100}}), (std::vector<int16_t>{2})); } +TEST(GridIndex, IndexesFeaturesOverflow) { + GridIndex<int16_t> grid(5000, 5000, 25); + grid.insert(0, {{4500, 4500}, {4900, 4900}}); + EXPECT_EQ(grid.query({{4000, 4000}, {5000, 5000}}), (std::vector<int16_t>{0})); +} |