diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-06 03:22:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-06 03:22:03 +0200 |
commit | 518e8cd4cc14bf04dd08f2f8db793430fea175fd (patch) | |
tree | 3e3f57b5c18bbb335b4840f0512eb57d8bc21222 /test/search-result.cpp | |
parent | de33d8773c3357653414143b8a76b08b8aa8d149 (diff) |
a?
Diffstat (limited to 'test/search-result.cpp')
-rw-r--r-- | test/search-result.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/test/search-result.cpp b/test/search-result.cpp index 1ff90ad8..600eec69 100644 --- a/test/search-result.cpp +++ b/test/search-result.cpp @@ -5,9 +5,21 @@ namespace floormat { +namespace { struct Test_PathPool {}; } + +using psrpa = path_search_result_pool_access<Test_PathPool>; +using node = path_search_result::node; + +template<> +struct path_search_result_pool_access<Test_PathPool> final +{ + static const Pointer<node>& get_node(const path_search_result& p) { return p._node; } + static const auto& get_pool() { return path_search_result::_pool; } +}; + void test_app::test_astar_pool() { - auto& pool = path_search_result::_pool; + auto& pool = psrpa::get_pool(); fm_assert(!pool); { auto a = path_search_result{}; @@ -17,13 +29,13 @@ void test_app::test_astar_pool() auto* pool2 = pool.get(); { auto b = path_search_result{}; - fm_assert(b._node.get() == pool2); + fm_assert(psrpa::get_node(b).get() == pool2); auto c = path_search_result{}; fm_assert(!pool); - fm_assert(c._node.get() != pool2); - fm_assert(b._node.get() == pool2); - fm_assert(!b._node->_next); - fm_assert(!c._node->_next); + fm_assert(psrpa::get_node(c).get() != pool2); + fm_assert(psrpa::get_node(b).get() == pool2); + fm_assert(!psrpa::get_node(b)->_next); + fm_assert(!psrpa::get_node(c)->_next); } { auto count = 0uz; |