libcruft-util/test/alloc/dynamic.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

23 lines
483 B
C++

#include "tap.hpp"
#include "alloc/raw/dynamic.hpp"
#include "alloc/raw/null.hpp"
///////////////////////////////////////////////////////////////////////////////
int
main (void)
{
cruft::TAP::logger tap;
auto obj = cruft::alloc::raw::dynamic::make<cruft::alloc::raw::null> ();
tap.expect_throw<std::bad_alloc> (
[&] (void) {
obj.allocate (sizeof (char));
},
"trivial dispatch to null allocator"
);
return tap.status ();
}