2016-02-10 14:05:09 +11:00
|
|
|
#include "tap.hpp"
|
2017-08-29 16:53:11 +10:00
|
|
|
#include "alloc/raw/dynamic.hpp"
|
|
|
|
#include "alloc/raw/null.hpp"
|
|
|
|
|
2016-02-10 14:05:09 +11:00
|
|
|
|
2017-08-29 16:53:11 +10:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2016-02-10 14:05:09 +11:00
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::TAP::logger tap;
|
2016-02-10 14:05:09 +11:00
|
|
|
|
2018-08-05 14:42:02 +10:00
|
|
|
auto obj = cruft::alloc::raw::dynamic::make<cruft::alloc::raw::null> ();
|
2016-02-10 14:05:09 +11:00
|
|
|
|
|
|
|
tap.expect_throw<std::bad_alloc> (
|
|
|
|
[&] (void) {
|
|
|
|
obj.allocate (sizeof (char));
|
|
|
|
},
|
|
|
|
"trivial dispatch to null allocator"
|
|
|
|
);
|
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|