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

@ -157,9 +157,6 @@ namespace xo {
{
const bool c_debug_flag = false;
up<ArenaAlloc> arena = ArenaAlloc::make("testarena",
#ifdef REDLINE_MEMORY
0,
#endif
16*1024, c_debug_flag);
Object::mm = arena.get();
@ -174,8 +171,22 @@ namespace xo {
REQUIRE(s3.ptr());
REQUIRE(s3->length() == s1->length() + s2->length());
REQUIRE(::strcmp(s1->c_str(), "the quick"));
{
std::stringstream ss1;
ss1 << s1;
REQUIRE(ss1.str() == "\"the\"");
}
/* on printing, escape embedded " chars */
{
std::stringstream ss4;
ss4 << String::share("\"Allo!\", he said");
REQUIRE(ss4.str() == "\"\\\"Allo!\\\", he said\"");
}
}
} /*namespace ut*/
} /*namespace xo*/