void AllocateDeallocate() { StaticPool<10, TestClass> pool; for (int times = 0; times < pool.getSize(); times++) { TestClass* cls = pool.allocate(); CFIXCC_ASSERT (cls != NULL); CFIXCC_ASSERT (pool.getAllocated() == times + 1); } // Full, no more allocations CFIXCC_ASSERT (pool.getAllocated() == pool.getSize()); CFIXCC_ASSERT (pool.allocate() == NULL); }
void Throw() { CFIXCC_ASSERT( setupCalled ); CFIXCC_ASSERT_EQUALS( counter, 1 ); counter++; throw TestException(); }