diff options
| author | Robin Hübner <profan@prfn.se> | 2019-08-25 21:30:52 +0200 |
|---|---|---|
| committer | Robin Hübner <profan@prfn.se> | 2019-08-27 00:38:35 +0200 |
| commit | 1031833fb04784908b7a28579af055f7264a2ce1 (patch) | |
| tree | a25902f0987810b66d47c4510140d7675f789bb1 /main | |
| parent | 6d6d4371467a94c01418e9d475e994fe61b7b4d0 (diff) | |
| download | redot-engine-1031833fb04784908b7a28579af055f7264a2ce1.tar.gz | |
allow to reserve space in OAHashMap explicitly and also in AStar.
* also handle overflow occurring in _get_probe_length
Diffstat (limited to 'main')
| -rw-r--r-- | main/tests/test_oa_hash_map.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/main/tests/test_oa_hash_map.cpp b/main/tests/test_oa_hash_map.cpp index 070420e432..bf5b4588ea 100644 --- a/main/tests/test_oa_hash_map.cpp +++ b/main/tests/test_oa_hash_map.cpp @@ -121,6 +121,25 @@ MainLoop *test() { delete[] keys; } + // regression test / test for issue related to #31402 + { + + OS::get_singleton()->print("test for issue #31402 started...\n"); + + const int num_test_values = 12; + int test_values[num_test_values] = { 0, 24, 48, 72, 96, 120, 144, 168, 192, 216, 240, 264 }; + + int dummy = 0; + OAHashMap<int, int> map; + map.clear(); + + for (int i = 0; i < num_test_values; ++i) { + map.set(test_values[i], dummy); + } + + OS::get_singleton()->print("test for issue #31402 passed.\n"); + } + return NULL; } } // namespace TestOAHashMap |
