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

Function addMarkerToString

src/CppUTest/TestFailure.cpp:49–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static SimpleString addMarkerToString(const SimpleString& str, int markerPos)
50{
51 size_t bufferSize = str.size()+1;
52 char* buffer = (char*) PlatformSpecificMalloc(bufferSize);
53 str.copyToBuffer(buffer, bufferSize);
54
55 buffer[markerPos] = '^';
56
57 SimpleString result(buffer);
58 PlatformSpecificFree(buffer);
59 return result;
60
61}
62
63TestFailure::TestFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& theMessage) :
64 testName_(test->getFormattedName()), testNameOnly_(test->getName()), fileName_(fileName), lineNumber_(lineNumber), testFileName_(test->getFile()), testLineNumber_(test->getLineNumber()), message_(theMessage)

Callers 1

Calls 4

PlatformSpecificMallocFunction · 0.85
PlatformSpecificFreeFunction · 0.85
copyToBufferMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected