First public contribution.
14 typedef allocator<BigStruct> BigStructAllocType;
15 BigStructAllocType bigStructAlloc;
18 //Lets try to allocate almost 4096 Go (on most of the platforms) of memory:
19 BigStructAllocType::pointer pbigStruct = bigStructAlloc.allocate(1024 * 1024 * 1024);
21 // CPPUNIT_ASSERT( pbigStruct != 0 && "Allocation failed but no exception thrown" );
23 catch (bad_alloc const&) {
27 //We shouldn't be there:
28 // CPPUNIT_ASSERT( false && "Not bad_alloc exception thrown." );
32 void bad_alloc_test1()
35 allocator<BigStruct> all;
36 BigStruct *bs = all.allocate(1024*1024*1024);
40 catch ( bad_alloc const & ) {
41 printf( "I am here\n" );
54 catch ( bad_alloc& ) {