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 14:46:18 +0300 |
commit | 05af3e0e2872063a22bb816465e259194e46caab (patch) | |
tree | 7430d6762126f72cc48e90e72ed61e3dadcc07bb /test | |
parent | 3b3e4a4772e98bac7ee43a5a02adc7596dff557a (diff) | |
download | qtlocation-mapboxgl-05af3e0e2872063a22bb816465e259194e46caab.tar.gz |
[core] Add unit test for grid index
Diffstat (limited to 'test')
-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})); +} |