summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-27 10:09:08 +0200
committerGitHub <noreply@github.com>2019-08-27 10:09:08 +0200
commit6b7117ce3f09c82cb7a3597a240b5b025a4c4862 (patch)
tree06394c3969758a63928c744880355f0b4981f1af /main
parent839590302f7ea80164c45428b53024e008092547 (diff)
parent1031833fb04784908b7a28579af055f7264a2ce1 (diff)
downloadredot-engine-6b7117ce3f09c82cb7a3597a240b5b025a4c4862.tar.gz
Merge pull request #31662 from profan/perf/astar-reserve
Allow to reserve space for nodes in A* and elements in OAHashMap explicitly.
Diffstat (limited to 'main')
-rw-r--r--main/tests/test_oa_hash_map.cpp19
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