xo-object2 xo-gc xo-facet: codegen updates + IGCObject_DString
This commit is contained in:
parent
343b3828ab
commit
ecfd3e4e6f
19 changed files with 280 additions and 68 deletions
|
|
@ -243,6 +243,23 @@ namespace xo {
|
|||
|
||||
REQUIRE(std::strcmp(s->chars(), "HELLO") == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("DString-clone", "[object2][DString]")
|
||||
{
|
||||
ArenaConfig cfg { .name_ = "testarena",
|
||||
.size_ = 4*1024 };
|
||||
DArena arena = DArena::map(cfg);
|
||||
auto alloc = with_facet<AAllocator>::mkobj(&arena);
|
||||
|
||||
DString * src = DString::from_cstr(alloc, "hello world");
|
||||
DString * copy = DString::clone(alloc, src);
|
||||
|
||||
REQUIRE(copy != nullptr);
|
||||
REQUIRE(copy != src);
|
||||
REQUIRE(copy->size() == src->size());
|
||||
REQUIRE(copy->capacity() == src->capacity());
|
||||
REQUIRE(std::strcmp(copy->chars(), src->chars()) == 0);
|
||||
}
|
||||
} /*namespace ut*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue