xo-gc stack: many small utest improvements.
This commit is contained in:
parent
42e09dd21e
commit
9cf74ea149
4 changed files with 28 additions and 28 deletions
|
|
@ -10,32 +10,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
|
||||
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<ACollector> & gc,
|
||||
void * parent,
|
||||
obj<AGCObject> * p_lhs,
|
||||
obj<AGCObject> & 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 <xo/facet/FacetRegistry.hpp>
|
||||
|
||||
/* end RCollector_aux.hpp */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
25
utest/ResourceVisitor.test.cpp
Normal file
25
utest/ResourceVisitor.test.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/** @file ResourceVisitor.test.cpp
|
||||
*
|
||||
* @author Roland Conybeare, May 2026
|
||||
**/
|
||||
|
||||
#include <xo/alloc2/ResourceVisitor.hpp>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::mm::AResourceVisitor;
|
||||
|
||||
namespace ut {
|
||||
|
||||
TEST_CASE("ResourceVisitor-1", "[resourcevisitor]")
|
||||
{
|
||||
obj<AResourceVisitor> v;
|
||||
|
||||
REQUIRE(v.iface());
|
||||
REQUIRE(!v.iface()->_has_null_vptr());
|
||||
}
|
||||
|
||||
}
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ResourceVisitor.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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue