TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator) { allocator = new TestMemoryAllocator("malloc_allocator"); setCurrentMallocAllocator(allocator); POINTERS_EQUAL(allocator, getCurrentMallocAllocator()); setCurrentMallocAllocatorToDefault(); POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator()); }
TestMemoryAllocator* getCurrentMallocAllocator() { if (currentMallocAllocator == 0) setCurrentMallocAllocatorToDefault(); return currentMallocAllocator; }
void teardown() { failableMallocAllocator.checkAllFailedAllocsWereDone(); setCurrentMallocAllocatorToDefault(); delete fixture; }
void cpputest_malloc_set_not_out_of_memory() { malloc_out_of_memory_counter = NO_COUNTDOWN; setCurrentMallocAllocatorToDefault(); }
MemoryLeakAllocator* MemoryLeakAllocator::getCurrentMallocAllocator() { if (currentMallocAllocator == 0) setCurrentMallocAllocatorToDefault(); return currentMallocAllocator; }