Skip to content

Commit

Permalink
Merge pull request #858 from alexkoltz/master
Browse files Browse the repository at this point in the history
Fixed tests not failing when maxSurviving=0
  • Loading branch information
hcoles authored Jan 25, 2021
2 parents eee3165 + 734a8f4 commit 6410c68
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(final String[] args) {
data.getTestStrengthThreshold());
throwErrorIfScoreBelowMutationThreshold(stats.getMutationStatistics(),
data.getMutationThreshold());
throwErrorIfMoreThanMaxSuvivingMutants(stats.getMutationStatistics(), data.getMaximumAllowedSurvivors());
throwErrorIfMoreThanMaxSurvivingMutants(stats.getMutationStatistics(), data.getMaximumAllowedSurvivors());
}

}
Expand Down Expand Up @@ -81,9 +81,9 @@ private static void throwErrorIfScoreBelowTestStrengthThreshold(
}
}

private static void throwErrorIfMoreThanMaxSuvivingMutants(
private static void throwErrorIfMoreThanMaxSurvivingMutants(
final MutationStatistics stats, final long threshold) {
if ((threshold > 0)
if ((threshold >= 0)
&& (stats.getTotalSurvivingMutations() > threshold)) {
throw new RuntimeException("Had "
+ stats.getTotalSurvivingMutations() + " surviving mutants, but only "
Expand Down

0 comments on commit 6410c68

Please sign in to comment.