From 19abcac32009d58450d80add39c5b1d5e7d8a993 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Jul 2024 22:14:44 +0200 Subject: w --- test/handle.cpp | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/handle.cpp b/test/handle.cpp index 79416c2c..2198281c 100644 --- a/test/handle.cpp +++ b/test/handle.cpp @@ -1,23 +1,47 @@ #include "app.hpp" -#include "src/handle.inl" +//#include "src/handle.inl" +#include "src/handle.hpp" #include "src/handle-page.inl" //#include "src/handle-pool.inl" +namespace floormat { +namespace { + +constexpr uint32_t start_index = 1024, page_size = 128; +struct Foo { int value; }; +using Page = impl_handle::Page; +using Handle = impl_handle::Handle; + +} // namespace +} // namespace floormat + +namespace floormat::impl_handle { + +template struct Handle; +template struct Item; // NOLINT(*-pro-type-member-init) +template class Page; +//template class Pool; + +} // namespace floormat::impl_handle + + namespace floormat::Test { namespace { -void test1() +void test_page1() { - + Page page{start_index}; + auto& item = page.allocate(); + fm_assert(item.handle == Handle{start_index}); + page.deallocate(item.handle); } - } // namespace void test_handle() { - test1(); + test_page1(); } } // namespace floormat::Test -- cgit v1.2.3