diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-13 19:02:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-14 13:04:42 +0200 |
commit | b4f04c64f29f056eecff52b85d47ed609ed45114 (patch) | |
tree | c5eb0348f3f361f0d735c8d6d3a9e01869821ac5 | |
parent | 3e4a66786b4cd1b4c691d91f27cb6fdf920fe586 (diff) |
w
-rw-r--r-- | test/handle.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/handle.cpp b/test/handle.cpp index c062d251..ef0e4893 100644 --- a/test/handle.cpp +++ b/test/handle.cpp @@ -39,13 +39,17 @@ void test_page1() { Page page{start_index}; auto& item0 = page.allocate(1); + fm_assert(page.use_count() == 1); auto handle0 = item0.handle; fm_assert(item0.handle == Handle{start_index, 0}); fm_assert(item0.object.value == 1); page.deallocate(item0.handle); + fm_assert(page.use_count() == 0); auto& item1 = page.allocate(2); + fm_assert(page.use_count() == 1); auto& item2 = page.allocate(3); + fm_assert(page.use_count() == 2); fm_assert(item1.object.value == 2); fm_assert(item2.object.value == 3); fm_assert(item1.handle.index == item0.handle.index || item2.handle.index == item0.handle.index); @@ -57,6 +61,7 @@ void test_page1() fm_assert(item0.object.value == 0); fm_assert(item1.object.value == 0); fm_assert(item2.object.value == 0); + fm_assert(page.use_count() == 0); } } // namespace |