From 4fcc0ddee26a07f8a042e3302190070880feda08 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Mon, 13 Dec 2021 01:52:27 +0100 Subject: [PATCH] add test for AlignedAllocator --- tests/bloballocators.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/bloballocators.cpp b/tests/bloballocators.cpp index 7fd9cf8478..f176abcf34 100644 --- a/tests/bloballocators.cpp +++ b/tests/bloballocators.cpp @@ -26,3 +26,15 @@ TEST_CASE("bloballocators.SharedPtr") iotaCheckView(view); } #endif + +TEST_CASE("bloballocators.AlignedAllocator") +{ + constexpr auto size = 50; + + auto aa = llama::bloballoc::AlignedAllocator{}; + auto* p = aa.allocate(size); + CHECK((reinterpret_cast(p) & std::uintptr_t{0x3FF}) == 0); + aa.deallocate(p, size); + CHECK(aa == llama::bloballoc::AlignedAllocator{}); + CHECK(!(aa != llama::bloballoc::AlignedAllocator{})); +} \ No newline at end of file