summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2013-08-22 19:20:30 (GMT)
committerBrad King <brad.king@kitware.com>2013-08-29 14:43:40 (GMT)
commit782eba3a0c74009e24708d28fd520b1ba919d326 (patch)
tree88e56783784eb8850bf31275a73f84523cc6cab5
parent549b95f115d1f98a68ed390816d5ac9e1eb38806 (diff)
downloadCMake-782eba3a0c74009e24708d28fd520b1ba919d326.zip
CMake-782eba3a0c74009e24708d28fd520b1ba919d326.tar.gz
CMake-782eba3a0c74009e24708d28fd520b1ba919d326.tar.bz2
CTest: Fix GTM coverage parsing line offset bug
In cmParseGTMCoverage::ReadMCovFile, initialize the lineoffset variable. Also set lastoffset only if the function is found (thanks to Bill Hoffman).
-rw-r--r--Source/CTest/cmParseGTMCoverage.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx
index 5dfcfe5..6b4adb4 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -98,7 +98,7 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file)
bool found = this->FindMumpsFile(routine, filepath);
if(found)
{
- int lineoffset;
+ int lineoffset = 0;
if(this->FindFunctionInMumpsFile(filepath,
function,
lineoffset))
@@ -106,8 +106,8 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file)
cmCTestCoverageHandlerContainer::SingleFileCoverageVector&
coverageVector = this->Coverage.TotalCoverage[filepath];
coverageVector[lineoffset + linenumber] += count;
+ lastoffset = lineoffset;
}
- lastoffset = lineoffset;
}
else
{