pgbackrest.git / summary / log / commit / refs

commit    acb579c4698f856e4c1ceedca751aaeadc9d2d3f
Author:   David Steele <david@pgmasters.net>
Date:     Tue Nov 13 15:37:58 2018 +0000

    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.


test/lib/pgBackRestTest/Common/CoverageTest.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/pgBackRestTest/Common/CoverageTest.pm b/test/lib/pgBackRestTest/Common/CoverageTest.pm index 925831051..c31e06171 100644 --- a/test/lib/pgBackRestTest/Common/CoverageTest.pm +++ b/test/lib/pgBackRestTest/Common/CoverageTest.pm @@ -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)})) { [parent: 086bc35ddc71]