예제 #1
0
TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator)
{
    allocator = new TestMemoryAllocator("malloc_allocator");
    setCurrentMallocAllocator(allocator);
    POINTERS_EQUAL(allocator, getCurrentMallocAllocator());
    setCurrentMallocAllocatorToDefault();
    POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator());
}
예제 #2
0
TestMemoryAllocator* getCurrentMallocAllocator()
{
    if (currentMallocAllocator == 0) setCurrentMallocAllocatorToDefault();
    return currentMallocAllocator;
}
 void teardown()
 {
     failableMallocAllocator.checkAllFailedAllocsWereDone();
     setCurrentMallocAllocatorToDefault();
     delete fixture;
 }
예제 #4
0
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;
}