1 /* ========================================== 2 * Unity Project - A Test Framework for C 3 * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 4 * [Released under MIT License. Please refer to license.txt for details] 5 * ========================================== */ 6 7 #include "unity.h" 8 #include "unity_memory.h" 9 10 extern void test_ForceMallocFail(void); 11 extern void test_ReallocSmallerIsUnchanged(void); 12 extern void test_ReallocSameIsUnchanged(void); 13 extern void test_ReallocLargerNeeded(void); 14 extern void test_ReallocNullPointerIsLikeMalloc(void); 15 extern void test_ReallocSizeZeroFreesMemAndReturnsNullPointer(void); 16 extern void test_CallocFillsWithZero(void); 17 extern void test_FreeNULLSafety(void); 18 extern void test_DetectsLeak(void); 19 extern void test_BufferOverrunFoundDuringFree(void); 20 extern void test_BufferOverrunFoundDuringRealloc(void); 21 extern void test_BufferGuardWriteFoundDuringFree(void); 22 extern void test_BufferGuardWriteFoundDuringRealloc(void); 23 extern void test_MallocPastBufferFails(void); 24 extern void test_CallocPastBufferFails(void); 25 extern void test_MallocThenReallocGrowsMemoryInPlace(void); 26 extern void test_ReallocFailDoesNotFreeMem(void); 27 main(void)28int main(void) 29 { 30 UnityBegin("unity_memory_Test.c"); 31 RUN_TEST(test_ForceMallocFail); 32 RUN_TEST(test_ReallocSmallerIsUnchanged); 33 RUN_TEST(test_ReallocSameIsUnchanged); 34 RUN_TEST(test_ReallocLargerNeeded); 35 RUN_TEST(test_ReallocNullPointerIsLikeMalloc); 36 RUN_TEST(test_ReallocSizeZeroFreesMemAndReturnsNullPointer); 37 RUN_TEST(test_CallocFillsWithZero); 38 RUN_TEST(test_FreeNULLSafety); 39 RUN_TEST(test_DetectsLeak); 40 RUN_TEST(test_BufferOverrunFoundDuringFree); 41 RUN_TEST(test_BufferOverrunFoundDuringRealloc); 42 RUN_TEST(test_BufferGuardWriteFoundDuringFree); 43 RUN_TEST(test_BufferGuardWriteFoundDuringRealloc); 44 RUN_TEST(test_MallocPastBufferFails); 45 RUN_TEST(test_CallocPastBufferFails); 46 RUN_TEST(test_MallocThenReallocGrowsMemoryInPlace); 47 RUN_TEST(test_ReallocFailDoesNotFreeMem); 48 return UnityEnd(); 49 } 50