summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-12 22:14:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-14 13:04:41 +0200
commit19abcac32009d58450d80add39c5b1d5e7d8a993 (patch)
treeeca43054b1614778fd9468f087b134f54f5e18dd /test
parenteb469ff58365517515d73827e70a9519436b5858 (diff)
w
Diffstat (limited to 'test')
-rw-r--r--test/handle.cpp34
1 files changed, 29 insertions, 5 deletions
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<Foo, page_size>;
+using Handle = impl_handle::Handle<Foo, page_size>;
+
+} // namespace
+} // namespace floormat
+
+namespace floormat::impl_handle {
+
+template struct Handle<Foo, page_size>;
+template struct Item<Foo, page_size>; // NOLINT(*-pro-type-member-init)
+template class Page<Foo, page_size>;
+//template class Pool<Foo, page_size>;
+
+} // 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