summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-09-26 08:03:46 +0200
committerGitHub <noreply@github.com>2019-09-26 08:03:46 +0200
commit084481b79da1515e2acd9be68e13aec67e35e80b (patch)
tree2185ad5b7138bf5d52c25b49b901fe4a1d0b6326 /main
parent7ce5233d24ac30c937bbf06acb8d0be1d990ed37 (diff)
parent78bee16e053f9703d4e04910eb7ab99c715d30e9 (diff)
Merge pull request #32230 from kawa-yoiko/oa-backward-shift
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