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

Function removeAllPrintableCharactersFrom

src/CppUTest/TestFailure.cpp:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include "CppUTest/PlatformSpecificFunctions.h"
33
34static SimpleString removeAllPrintableCharactersFrom(const SimpleString& str)
35{
36 size_t bufferSize = str.size()+1;
37 char* buffer = (char*) PlatformSpecificMalloc(bufferSize);
38 str.copyToBuffer(buffer, bufferSize);
39
40 for (size_t i = 0; i < bufferSize-1; i++)
41 if (buffer[i] != '\t' && buffer[i] != '\n')
42 buffer[i] = ' ';
43
44 SimpleString result(buffer);
45 PlatformSpecificFree(buffer);
46 return result;
47}
48
49static SimpleString addMarkerToString(const SimpleString& str, int markerPos)
50{

Callers 1

Calls 4

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

Tested by

no test coverage detected