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

Class CodeMemoryReportFormatter

include/CppUTestExt/CodeMemoryReportFormatter.h:34–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33struct CodeReportingAllocationNode;
34class CodeMemoryReportFormatter : public MemoryReportFormatter
35{
36private:
37 CodeReportingAllocationNode* codeReportingList_;
38 TestMemoryAllocator* internalAllocator_;
39
40public:
41 CodeMemoryReportFormatter(TestMemoryAllocator* internalAllocator);
42 virtual ~CodeMemoryReportFormatter() _destructor_override;
43
44 virtual void report_testgroup_start(TestResult* result, UtestShell& test) _override;
45 virtual void report_testgroup_end(TestResult* /*result*/, UtestShell& /*test*/) _override {} // LCOV_EXCL_LINE
46
47 virtual void report_test_start(TestResult* result, UtestShell& test) _override;
48 virtual void report_test_end(TestResult* result, UtestShell& test) _override;
49
50 virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line) _override;
51 virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line) _override;
52
53private:
54
55 void addNodeToList(const char* variableName, void* memory, CodeReportingAllocationNode* next);
56 CodeReportingAllocationNode* findNode(void* memory);
57 bool variableExists(const SimpleString& variableName);
58 void clearReporting();
59
60 bool isNewAllocator(TestMemoryAllocator* allocator);
61 SimpleString createVariableNameFromFileLineInfo(const char *file, size_t line);
62
63 SimpleString getAllocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, size_t size);
64 SimpleString getDeallocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, const char* file, size_t line);
65};
66
67#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected