xo-alloc / xo-object: utest coverage + assorted bugfixes

This commit is contained in:
Roland Conybeare 2025-08-07 18:32:14 -05:00
commit bd00826448
34 changed files with 1069 additions and 326 deletions

View file

@ -0,0 +1,38 @@
/* generation.test.cpp
*
* author: Roland Conybeare, Aug 2025
*/
#include "xo/alloc/generation.hpp"
#include <catch2/catch.hpp>
#include <cstring>
namespace xo {
namespace gc {
TEST_CASE("generation", "[gc]") {
REQUIRE(::strcmp(gen2str(generation::nursery), "nursery") == 0);
REQUIRE(::strcmp(gen2str(generation::tenured), "tenured") == 0);
REQUIRE(::strcmp(gen2str(generation::N), "?generation") == 0);
{
std::stringstream ss;
ss << generation::nursery;
REQUIRE(ss.str() == "nursery");
}
{
std::stringstream ss;
ss << generation::tenured;
REQUIRE(ss.str() == "tenured");
}
{
std::stringstream ss;
ss << generation::N;
REQUIRE(ss.str() == "?generation");
}
}
} /*namespace gc*/
} /*namespace xo*/
/* generation.test.cpp */