MCPcopy Create free account
hub / github.com/cpputest/cpputest / postTestAction

Method postTestAction

src/CppUTest/MemoryLeakWarningPlugin.cpp:620–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620void MemoryLeakWarningPlugin::postTestAction(UtestShell& test, TestResult& result)
621{
622 memLeakDetector_->stopChecking();
623 size_t leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_checking);
624
625 if (!ignoreAllWarnings_ && expectedLeaks_ != leaks && failureCount_ == result.getFailureCount()) {
626 if(MemoryLeakWarningPlugin::areNewDeleteOverloaded()) {
627 TestFailure f(&test, memLeakDetector_->report(mem_leak_period_checking));
628 result.addFailure(f);
629 } else if(expectedLeaks_ > 0) {
630 result.print(StringFromFormat("Warning: Expected %d leak(s), but leak detection was disabled", (int) expectedLeaks_).asCharString());
631 }
632 }
633 memLeakDetector_->markCheckingPeriodLeaksAsNonCheckingPeriod();
634 ignoreAllWarnings_ = false;
635 expectedLeaks_ = 0;
636}
637
638const char* MemoryLeakWarningPlugin::FinalReport(size_t toBeDeletedLeaks)
639{

Callers

nothing calls this directly

Calls 9

StringFromFormatFunction · 0.85
stopCheckingMethod · 0.80
totalMemoryLeaksMethod · 0.80
addFailureMethod · 0.80
asCharStringMethod · 0.80
getFailureCountMethod · 0.45
reportMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected