xo-alloc xo-object; + utests

This commit is contained in:
Roland Conybeare 2025-08-06 09:32:09 -05:00
commit ff5b0cfb8a

29
utest/IAlloc.test.cpp Normal file
View file

@ -0,0 +1,29 @@
/* @file IAlloc.test.cpp
*
* author: Roland Conybeare, Aug 2025
*/
#include "xo/alloc/IAlloc.hpp"
#include <catch2/catch.hpp>
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 */