Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.pitest.mutationtest.commandline.MutationCoverageReport.throwErrorIfMoreThanMaxSurvivingMutants only fails if threshold is set to >= 1 #632

Open
jeffreyfate opened this issue Aug 2, 2019 · 1 comment · May be fixed by #633

Comments

@jeffreyfate
Copy link

This methods should be fixed to work in the case where we want 0 surviving mutants.

  private static void throwErrorIfMoreThanMaxSuvivingMutants(
      final MutationStatistics stats, final long threshold) {
    if ((threshold > 0)
        && (stats.getTotalSurvivingMutations() > threshold)) {
      throw new RuntimeException("Had "
          + stats.getTotalSurvivingMutations() + " surviving mutants, but only "
          + threshold + " survivors allowed");
    }
  }

to

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

See #269

@jeffreyfate
Copy link
Author

I can fix, just need to get my development environment setup.

@jeffreyfate jeffreyfate changed the title org.pitest.mutationtest.commandline.MutationCoverageReport.throwErrorIfMoreThanMaxSurvivingMutants only fails if threshold is set to > 1 org.pitest.mutationtest.commandline.MutationCoverageReport.throwErrorIfMoreThanMaxSurvivingMutants only fails if threshold is set to >= 1 Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant