Skip to content

Commit

Permalink
Issue checkstyle#12876: Resolve pitest suppression for AbstractViolat…
Browse files Browse the repository at this point in the history
…ionReporter
  • Loading branch information
ThatSneakyCoder committed Apr 12, 2023
1 parent d2648e4 commit c634202
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
9 changes: 0 additions & 9 deletions config/pitest-suppressions/pitest-api-suppressions.xml
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressedMutations>
<mutation unstable="false">
<sourceFile>AbstractViolationReporter.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter</mutatedClass>
<mutatedMethod>setSeverity</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable severityLevel</description>
<lineContent>severityLevel = SeverityLevel.getInstance(severity);</lineContent>
</mutation>

<mutation unstable="false">
<sourceFile>FileContents.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.api.FileContents</mutatedClass>
Expand Down
Expand Up @@ -241,6 +241,15 @@ public void testUnusedLocalVarNestedClasses3() throws Exception {
expected);
}

@Test
public void testUnusedLocalVarTestWarningSeverity() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;

verifyWithInlineConfigParser(
getPath("InputUnusedLocalVariableTestWarningSeverity.java"),
expected);
}

@Test
public void testUnusedLocalVarEnum() throws Exception {
final String[] expected = {
Expand Down
@@ -0,0 +1,23 @@
/*
UnusedLocalVariable
severity = warning
*/

package com.puppycrawl.tools.checkstyle.checks.coding.unusedlocalvariable;

public class InputUnusedLocalVariableTestWarningSeverity {
/*
To kill the mutation in AbstractViolationReporter in the api package,
we only had to change the severity level in the input file to warning
*/

/*
some code
*/

}



0 comments on commit c634202

Please sign in to comment.