38 mallocMess (
size_t siz)
76 string probeString = isnil(args)?
randStr(123) : args[0];
77 auto hotPotato = place_into_malloced_buffer (probeString);
79 CHECK (!isnil (hotPotato));
80 verify_and_consume (std::move(hotPotato), probeString);
81 CHECK (isnil (hotPotato));
86 place_into_malloced_buffer (
string probeString)
88 CharOwner hotPotato(mallocMess (1 + probeString.length()));
89 std::strcpy(hotPotato.get(), probeString.c_str());
95 verify_and_consume (
CharOwner hotPotato,
string refString)
97 CHECK (refString == hotPotato.get());
Helper to deal with C-MALLOCed memory automatically.
Implementation namespace for support and library code.
string randStr(size_t len)
create garbage string of given length
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
Ownership token for a piece of heap memory allocated in plain-C style.