You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-01 00:25:06 +02:00
Tighten limits on code coverage context selection.
If the last } of a function was marked as uncovered then the context selection would overrun into the next function. Start checking context on the current line to prevent this. Make the same change for start context even though it doesn't seem to have an issue.
This commit is contained in:
@ -178,7 +178,7 @@ sub coverageGenerate
|
||||
foreach my $iLine (sort(keys(%{$rhCoverage->{$strFile}{line}})))
|
||||
{
|
||||
# Run back to the beginning of the function comment
|
||||
for (my $iLineIdx = $iLine - 1; $iLineIdx >= 0; $iLineIdx--)
|
||||
for (my $iLineIdx = $iLine; $iLineIdx >= 0; $iLineIdx--)
|
||||
{
|
||||
if (!defined($rhCoverage->{$strFile}{line}{sprintf("%09d", $iLineIdx)}))
|
||||
{
|
||||
@ -189,7 +189,7 @@ sub coverageGenerate
|
||||
}
|
||||
|
||||
# Run forward to the end of the function
|
||||
for (my $iLineIdx = $iLine + 1; $iLineIdx < @stryC; $iLineIdx++)
|
||||
for (my $iLineIdx = $iLine; $iLineIdx < @stryC; $iLineIdx++)
|
||||
{
|
||||
if (!defined($rhCoverage->{$strFile}{line}{sprintf("%09d", $iLineIdx)}))
|
||||
{
|
||||
|
Reference in New Issue
Block a user