xo-gc stack: fix mutation setup + xo-reader2 utest
This commit is contained in:
parent
b1d2ae6f19
commit
f56b01e7b6
11 changed files with 234 additions and 23 deletions
42
utest/Generation.test.cpp
Normal file
42
utest/Generation.test.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/** @file Generation.test.cpp
|
||||
*
|
||||
* @author Roland Conybeare, May 2026
|
||||
**/
|
||||
|
||||
#include "Generation.hpp"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::mm::Generation;
|
||||
using xo::mm::c_max_generation;
|
||||
|
||||
namespace ut {
|
||||
|
||||
TEST_CASE("Generation-1", "[Generation]")
|
||||
{
|
||||
REQUIRE(Generation::nursery() == 0);
|
||||
REQUIRE(Generation::g0() == 0);
|
||||
REQUIRE(Generation::g1() == 1);
|
||||
REQUIRE(Generation::sentinel() == c_max_generation);
|
||||
|
||||
REQUIRE(Generation::g0().is_sentinel() == false);
|
||||
REQUIRE(Generation::g1().is_sentinel() == false);
|
||||
REQUIRE(Generation::sentinel().is_sentinel());
|
||||
|
||||
REQUIRE(Generation::g0() != Generation::sentinel());
|
||||
REQUIRE(Generation::g1() != Generation::sentinel());
|
||||
|
||||
REQUIRE(!(Generation::g0() > Generation::g1()));
|
||||
REQUIRE(Generation::g1() > Generation::g0());
|
||||
|
||||
auto g = Generation::g0();
|
||||
++g;
|
||||
REQUIRE(g == Generation::g1());
|
||||
++g;
|
||||
REQUIRE(g > Generation::g1());
|
||||
}
|
||||
|
||||
} /*namespace ut*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end Generation.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue