From 9cf74ea149532fef897dd67d26f6142b98e452c8 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 17 May 2026 12:30:09 -0400 Subject: [PATCH] xo-gc stack: many small utest improvements. --- include/xo/alloc2/gc/RCollector_aux.hpp | 28 +------------------------ utest/CMakeLists.txt | 1 + utest/ResourceVisitor.test.cpp | 25 ++++++++++++++++++++++ utest/VisitReason.test.cpp | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 utest/ResourceVisitor.test.cpp diff --git a/include/xo/alloc2/gc/RCollector_aux.hpp b/include/xo/alloc2/gc/RCollector_aux.hpp index 8198f64..e115e9b 100644 --- a/include/xo/alloc2/gc/RCollector_aux.hpp +++ b/include/xo/alloc2/gc/RCollector_aux.hpp @@ -10,32 +10,6 @@ #pragma once -#include - -namespace xo { - namespace mm { - class ACollector; - class AGCObject; - - // ----- mm_do_assign ----- - - /** gc-aware assignment; engage special book-keeping for cross-gen pointers **/ - inline void mm_do_assign(obj & gc, - void * parent, - obj * p_lhs, - obj & rhs) - { - if (gc.data()) { - gc.assign_member(parent, p_lhs, rhs); - } else { - // assume null collector downstream from allocator that does not provide collection. - // In that no additional assignment work. - - *p_lhs = rhs; - } - }; - - } /*namespace mm*/ -} /*namespace xo*/ +//#include /* end RCollector_aux.hpp */ diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index c885daa..a19d1f4 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -13,6 +13,7 @@ set(UTEST_SRCS Generation.test.cpp Role.test.cpp VisitReason.test.cpp + ResourceVisitor.test.cpp dp.test.cpp random_allocs.cpp ) diff --git a/utest/ResourceVisitor.test.cpp b/utest/ResourceVisitor.test.cpp new file mode 100644 index 0000000..0869d38 --- /dev/null +++ b/utest/ResourceVisitor.test.cpp @@ -0,0 +1,25 @@ +/** @file ResourceVisitor.test.cpp + * + * @author Roland Conybeare, May 2026 + **/ + +#include +#include + +namespace xo { + using xo::mm::AResourceVisitor; + + namespace ut { + + TEST_CASE("ResourceVisitor-1", "[resourcevisitor]") + { + obj v; + + REQUIRE(v.iface()); + REQUIRE(!v.iface()->_has_null_vptr()); + } + + } +} /*namespace xo*/ + +/* end ResourceVisitor.test.cpp */ diff --git a/utest/VisitReason.test.cpp b/utest/VisitReason.test.cpp index ceef9a0..44bfcc3 100644 --- a/utest/VisitReason.test.cpp +++ b/utest/VisitReason.test.cpp @@ -11,7 +11,7 @@ namespace xo { namespace ut { - TEST_CASE("visitreason-1", "[visitreason]") + TEST_CASE("VisitReason-1", "[visitreason]") { REQUIRE(VisitReason::unspecified() == VisitReason::unspecified());