libcruft-util/test/alloc/forwarding.cpp

20 lines
472 B
C++

#include "alloc/forwarding.hpp"
#include "alloc/raw/linear.hpp"
#include "tap.hpp"
int
main ()
{
std::byte buffer[64];
util::alloc::raw::linear linear (buffer);
util::alloc::forwarding forwarding (linear);
util::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 ();
}