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 63b6b68
Show file tree
Hide file tree
Showing 3 changed files with 30 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,21 @@
/*
UnusedLocalVariable
severity = warning
*/

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

public class InputUnusedLocalVariableTestWarningSeverity {

void m() {
@Test.A Outer p1 = new @Test.A Outer(); // ok
@Test.A Outer.@Test.B Inner p2 = p1.new @Test.B Inner();
// violation above but severity is set to warning
}

}



0 comments on commit 63b6b68

Please sign in to comment.