From ff5b0cfb8aa478b5888858bed9587b4235052c8f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 6 Aug 2025 09:32:09 -0500 Subject: [PATCH] xo-alloc xo-object; + utests --- utest/IAlloc.test.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 utest/IAlloc.test.cpp diff --git a/utest/IAlloc.test.cpp b/utest/IAlloc.test.cpp new file mode 100644 index 00000000..b0214749 --- /dev/null +++ b/utest/IAlloc.test.cpp @@ -0,0 +1,29 @@ +/* @file IAlloc.test.cpp + * + * author: Roland Conybeare, Aug 2025 + */ + +#include "xo/alloc/IAlloc.hpp" +#include + +namespace xo { + using xo::gc::IAlloc; + + namespace ut { + TEST_CASE("ialloc", "[alloc]") + { + REQUIRE(IAlloc::alloc_padding(0) == 0); + REQUIRE(IAlloc::alloc_padding(1) == 7); + REQUIRE(IAlloc::alloc_padding(2) == 6); + REQUIRE(IAlloc::alloc_padding(3) == 5); + REQUIRE(IAlloc::alloc_padding(4) == 4); + REQUIRE(IAlloc::alloc_padding(5) == 3); + REQUIRE(IAlloc::alloc_padding(6) == 2); + REQUIRE(IAlloc::alloc_padding(7) == 1); + REQUIRE(IAlloc::alloc_padding(8) == 0); + REQUIRE(IAlloc::alloc_padding(9) == 7); + } + } /*namespace ut*/ +} /*namespace xo*/ + +/* end IAlloc.test.cpp */