From 6a71040c0b28a5b9520d59b6c1d5fa51956e2b5f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 24 Mar 2024 11:01:58 +0100 Subject: c --- test/path-search-result.cpp | 36 ------------------------------------ test/search-result.cpp | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 test/path-search-result.cpp create mode 100644 test/search-result.cpp (limited to 'test') diff --git a/test/path-search-result.cpp b/test/path-search-result.cpp deleted file mode 100644 index 1ff90ad8..00000000 --- a/test/path-search-result.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "app.hpp" -#include "compat/assert.hpp" -#include "src/search-result.hpp" -#include "src/search-node.hpp" - -namespace floormat { - -void test_app::test_astar_pool() -{ - auto& pool = path_search_result::_pool; - fm_assert(!pool); - { - auto a = path_search_result{}; - fm_assert(!pool); - } - fm_assert(pool); - auto* pool2 = pool.get(); - { - auto b = path_search_result{}; - fm_assert(b._node.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); - } - { - auto count = 0uz; - for (const auto* ptr = pool.get(); ptr; ptr = ptr->_next.get()) - count++; - fm_assert(count == 2); - } -} - -} // namespace floormat diff --git a/test/search-result.cpp b/test/search-result.cpp new file mode 100644 index 00000000..1ff90ad8 --- /dev/null +++ b/test/search-result.cpp @@ -0,0 +1,36 @@ +#include "app.hpp" +#include "compat/assert.hpp" +#include "src/search-result.hpp" +#include "src/search-node.hpp" + +namespace floormat { + +void test_app::test_astar_pool() +{ + auto& pool = path_search_result::_pool; + fm_assert(!pool); + { + auto a = path_search_result{}; + fm_assert(!pool); + } + fm_assert(pool); + auto* pool2 = pool.get(); + { + auto b = path_search_result{}; + fm_assert(b._node.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); + } + { + auto count = 0uz; + for (const auto* ptr = pool.get(); ptr; ptr = ptr->_next.get()) + count++; + fm_assert(count == 2); + } +} + +} // namespace floormat -- cgit v1.2.3