summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorShiqing <shiqing-thu18@yandex.com>2019-09-21 14:32:40 +0800
committerShiqing <shiqing-thu18@yandex.com>2019-09-21 14:32:40 +0800
commit78bee16e053f9703d4e04910eb7ab99c715d30e9 (patch)
tree416e9a374b4142424936350a3d7a217d97074c8e /main
parent2e065d8ad07bb20fede0d0c0b2d33d6628033024 (diff)
downloadredot-engine-78bee16e053f9703d4e04910eb7ab99c715d30e9.tar.gz
Implement backward shift deletion for OAHashMap
Diffstat (limited to 'main')
-rw-r--r--main/tests/test_oa_hash_map.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/tests/test_oa_hash_map.cpp b/main/tests/test_oa_hash_map.cpp
index bf5b4588ea..beee52d1de 100644
--- a/main/tests/test_oa_hash_map.cpp
+++ b/main/tests/test_oa_hash_map.cpp
@@ -140,6 +140,19 @@ MainLoop *test() {
OS::get_singleton()->print("test for issue #31402 passed.\n");
}
+ // test collision resolution, should not crash or run indefinitely
+ {
+ OAHashMap<int, int> map(4);
+ map.set(1, 1);
+ map.set(5, 1);
+ map.set(9, 1);
+ map.set(13, 1);
+ map.remove(5);
+ map.remove(9);
+ map.remove(13);
+ map.set(5, 1);
+ }
+
return NULL;
}
} // namespace TestOAHashMap