From 23188750272c89ce88e6944b43683f29be04affc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 6 Oct 2023 19:37:12 +0200 Subject: a --- test/path-search-result.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/path-search-result.cpp b/test/path-search-result.cpp index 1d464e8c..427de52a 100644 --- a/test/path-search-result.cpp +++ b/test/path-search-result.cpp @@ -7,19 +7,28 @@ namespace floormat { void test_app::test_path_search_node_pool() { auto& pool = path_search_result::_pool; - fm_debug_assert(!pool); + fm_assert(!pool); { auto a = path_search_result{}; - fm_debug_assert(!pool); + fm_assert(!pool); } - fm_debug_assert(pool); + fm_assert(pool); + auto* pool2 = pool.get(); { - auto* pool2 = pool.get(); auto b = path_search_result{}; - fm_debug_assert(b._node.get() == pool2); + fm_assert(b._node.get() == pool2); auto c = path_search_result{}; - fm_debug_assert(c._node.get() != pool2); - fm_debug_assert(b._node.get() == pool2); + 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); + } + { + auto count = 0uz; + for (const auto* ptr = pool.get(); ptr; ptr = ptr->_next.get()) + count++; + fm_assert(count == 2); } } -- cgit v1.2.3