| 32 | |
| 33 | struct CodeReportingAllocationNode; |
| 34 | class CodeMemoryReportFormatter : public MemoryReportFormatter |
| 35 | { |
| 36 | private: |
| 37 | CodeReportingAllocationNode* codeReportingList_; |
| 38 | TestMemoryAllocator* internalAllocator_; |
| 39 | |
| 40 | public: |
| 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 | |
| 53 | private: |
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected