MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / AddFileCoverageTo

Function AddFileCoverageTo

CppCoverage/CoverageDataMerger.cpp:73–90  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

71
72 //---------------------------------------------------------------------
73 void AddFileCoverageTo(
74 const Plugin::FileCoverage* sourceFile,
75 Plugin::FileCoverage* destinationFile)
76 {
77 if (sourceFile && destinationFile)
78 {
79 for (const auto& line : sourceFile->GetLines())
80 {
81 auto lineNumber = line.GetLineNumber();
82 auto hasBeenExecuted = line.HasBeenExecuted();
83
84 if (!(*destinationFile)[lineNumber])
85 destinationFile->AddLine(lineNumber, hasBeenExecuted);
86 else if (hasBeenExecuted)
87 destinationFile->UpdateLine(lineNumber, true);
88 }
89 }
90 }
91
92 //---------------------------------------------------------------------
93 void FillFiles(

Callers 2

FillFilesFunction · 0.85
MergeFileCoveragesFunction · 0.85

Calls 5

GetLineNumberMethod · 0.80
HasBeenExecutedMethod · 0.80
AddLineMethod · 0.80
UpdateLineMethod · 0.80
GetLinesMethod · 0.45

Tested by

no test coverage detected