CTest: Fix Python coverage.py off-by-one error in results

The cobertura format uses line numbers indexed starting at 1, and CTest
uses a vector indexed starting at 0 to store them.
This commit is contained in:
Zach Mullen 2014-05-27 15:44:46 -04:00 committed by Brad King
parent 88b3dcb125
commit deee7c42a2
1 changed files with 2 additions and 2 deletions

View File

@ -79,11 +79,11 @@ protected:
curNumber = atoi(atts[tagCount+1]);
}
if(curHits > -1 && curNumber > -1)
if(curHits > -1 && curNumber > 0)
{
FileLinesType& curFileLines =
this->Coverage.TotalCoverage[this->CurFileName];
curFileLines[curNumber] = curHits;
curFileLines[curNumber-1] = curHits;
break;
}
++tagCount;