libcruft-util/test/alloc/forwarding.cpp
Danny Robson f6056153e3 rename root namespace from util to cruft
This places, at long last, the core library code into the same namespace
as the extended library code.
2018-08-05 14:42:02 +10:00

20 lines
475 B
C++

#include "alloc/forwarding.hpp"
#include "alloc/raw/linear.hpp"
#include "tap.hpp"
int
main ()
{
std::byte buffer[64];
cruft::alloc::raw::linear linear (buffer);
cruft::alloc::forwarding forwarding (linear);
cruft::TAP::logger tap;
tap.expect_eq (linear.used (), 0u, "construction does not allocate");
forwarding.allocate<uint8_t> (16u);
tap.expect_eq (linear.used (), 16u, "allocation size is exactly committed");
return tap.status ();
}