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

Method checkAllFailedAllocsWereDone

src/CppUTest/TestMemoryAllocator.cpp:372–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372void FailableMemoryAllocator::checkAllFailedAllocsWereDone()
373{
374 if (head_) {
375 UtestShell* currentTest = UtestShell::getCurrent();
376 SimpleString failText;
377 if (head_->file_)
378 failText = StringFromFormat("Expected failing alloc at %s:%d was never done", head_->file_, (int) head_->line_);
379 else
380 failText = StringFromFormat("Expected allocation number %d was never done", (int) head_->allocNumberToFail_);
381
382 currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(), currentTest->getLineNumber(), failText));
383 }
384}
385
386void FailableMemoryAllocator::clearFailedAllocs()
387{

Callers 3

teardownFunction · 0.80
_failingAllocIsNeverDoneFunction · 0.80

Calls 6

StringFromFormatFunction · 0.85
FailFailureClass · 0.85
failWithMethod · 0.80
asCharStringMethod · 0.80
getLineNumberMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected