diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-06 19:29:28 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-06 19:31:18 +0200 |
commit | 41f8fe4e55a3b0f2e471959374ba36314e19edc0 (patch) | |
tree | 362982ad2b05427121d24fc9cd99360603bc8796 /test | |
parent | 5fe82a0a598331ca7b1bb5eea0286c09c4718981 (diff) |
a
Diffstat (limited to 'test')
-rw-r--r-- | test/app.hpp | 1 | ||||
-rw-r--r-- | test/main.cpp | 1 | ||||
-rw-r--r-- | test/path-search-result.cpp | 26 | ||||
-rw-r--r-- | test/path-search.cpp | 2 |
4 files changed, 30 insertions, 0 deletions
diff --git a/test/app.hpp b/test/app.hpp index 2a2e39c8..fbce503b 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -42,6 +42,7 @@ struct test_app final : private FM_APPLICATION static void test_bitmask(); static void test_path_search(); static void test_hash(); + static void test_path_search_node_pool(); static void zzz_test_misc(); }; } // namespace floormat diff --git a/test/main.cpp b/test/main.cpp index 4ff866bf..928ff565 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -32,6 +32,7 @@ int test_app::exec() test_path_search(); test_math(); test_hash(); + test_path_search_node_pool(); zzz_test_misc(); return 0; diff --git a/test/path-search-result.cpp b/test/path-search-result.cpp new file mode 100644 index 00000000..1d464e8c --- /dev/null +++ b/test/path-search-result.cpp @@ -0,0 +1,26 @@ +#include "app.hpp" +#include "compat/assert.hpp" +#include "path-search-result.hpp" + +namespace floormat { + +void test_app::test_path_search_node_pool() +{ + auto& pool = path_search_result::_pool; + fm_debug_assert(!pool); + { + auto a = path_search_result{}; + fm_debug_assert(!pool); + } + fm_debug_assert(pool); + { + auto* pool2 = pool.get(); + auto b = path_search_result{}; + fm_debug_assert(b._node.get() == pool2); + auto c = path_search_result{}; + fm_debug_assert(c._node.get() != pool2); + fm_debug_assert(b._node.get() == pool2); + } +} + +} // namespace floormat diff --git a/test/path-search.cpp b/test/path-search.cpp index 9ff918e5..28ea01de 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -113,6 +113,7 @@ void test_bbox() fm_assert(neighbor_tiles(w, ch, {2, 4}).size == 3); fm_assert(neighbor_tiles(w, ch, {4, 4}).size == 3); } +#if 0 { constexpr auto ch = chunk_coords_{}; auto w = world(); @@ -183,6 +184,7 @@ void test_bbox() fm_assert( check_N(search, {}, {K+2, K+2 }, s00 )); fm_assert( check_W(search, {}, {K+2, K+2 }, s00 )); } +#endif } } // namespace |