| 130 | }; |
| 131 | |
| 132 | TEST(MemoryLeakDetectorTest, OneLeak) |
| 133 | { |
| 134 | char* mem = detector->allocMemory(testAllocator, 3); |
| 135 | detector->stopChecking(); |
| 136 | SimpleString output = detector->report(mem_leak_period_checking); |
| 137 | STRCMP_CONTAINS("Memory leak(s) found", output.asCharString()); |
| 138 | STRCMP_CONTAINS("size: 3", output.asCharString()); |
| 139 | STRCMP_CONTAINS("alloc", output.asCharString()); |
| 140 | STRCMP_CONTAINS(StringFromFormat("%p", (void*) mem).asCharString(), output.asCharString()); |
| 141 | STRCMP_CONTAINS("Total number of leaks", output.asCharString()); |
| 142 | PlatformSpecificFree(mem); |
| 143 | LONGS_EQUAL(1, testAllocator->alloc_called); |
| 144 | LONGS_EQUAL(0, testAllocator->free_called); |
| 145 | } |
| 146 | |
| 147 | TEST(MemoryLeakDetectorTest, sequenceNumbersOfMemoryLeaks) |
| 148 | { |
nothing calls this directly
no test coverage detected