1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Fixed an undefined variable when a module had no uncoverable code exceptions.

This commit is contained in:
David Steele 2017-04-13 20:10:28 -04:00
parent 77ef4fde20
commit 979610a07d
3 changed files with 12 additions and 6 deletions

View File

@ -155,6 +155,12 @@
<release-list>
<release date="XXXX-XX-XX" version="1.19dev" title="UNDER DEVELOPMENT">
<release-test-list>
<release-bug-list>
<release-item>
<p>Fixed an undefined variable when a module had no uncoverable code exceptions.</p>
</release-item>
</release-bug-list>
<release-refactor-list>
<release-item>
<p>Set <setting>--vm-max=2</setting> for CI.</p>

View File

@ -213,7 +213,6 @@ my $oTestDef =
[
{
&TESTDEF_NAME => 'ini-unit',
&TESTDEF_CONTAINER => true,
&TESTDEF_TOTAL => 10,
&TESTDEF_COVERAGE =>

View File

@ -773,10 +773,13 @@ eval
}
# Check that all code has been covered
my $iCoverageTotal = $hCoverageResultAll->{total};
my $iCoverageUncoverable = coalesce($hCoverageResultAll->{uncoverable}, 0);
my $iCoverageCovered = $hCoverageResultAll->{covered};
if ($hCoverageActual->{$strCodeModule} == TESTDEF_COVERAGE_FULL)
{
my $iUncoveredLines =
$hCoverageResultAll->{total} - $hCoverageResultAll->{covered} - $hCoverageResultAll->{uncoverable};
my $iUncoveredLines = $iCoverageTotal - $iCoverageCovered - $iCoverageUncoverable;
if ($iUncoveredLines != 0)
{
@ -787,9 +790,7 @@ eval
# Else test how much partial coverage where was
else
{
my $iCoveragePercent = int(
($hCoverageResultAll->{covered} + $hCoverageResultAll->{uncoverable}) * 100 /
$hCoverageResultAll->{total});
my $iCoveragePercent = int(($iCoverageCovered + $iCoverageUncoverable) * 100 / $iCoverageTotal);
if ($iCoveragePercent == 100)
{