47 mallocMess (
size_t siz)
85 string probeString = isnil(args)?
randStr(123) : args[0];
86 auto hotPotato = place_into_malloced_buffer (probeString);
88 CHECK (!isnil (hotPotato));
89 verify_and_consume (std::move(hotPotato), probeString);
90 CHECK (isnil (hotPotato));
95 place_into_malloced_buffer (
string probeString)
97 CharOwner hotPotato(mallocMess (1 + probeString.length()));
98 std::strcpy(hotPotato.get(), probeString.c_str());
104 verify_and_consume (
CharOwner hotPotato,
string refString)
106 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
Simple 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.