make IG test light

This commit is contained in:
Bas Leijdekkers
2017-09-26 19:49:34 +02:00
parent dd15c2a516
commit 036ef00488
3 changed files with 28 additions and 15 deletions
@@ -7,7 +7,7 @@ public class SwitchStatementWithConfusingDeclaration
switch(3)
{
case 2:
int x = 0;
int <warning descr="Local variable 'x' declared in one 'switch' branch and used in another">x</warning> = 0;
break;
case 3:
x = 3;
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>SwitchStatementWithConfusingDeclaration.java</file>
<line>10</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable used and declared in different 'switch' branches</problem_class>
<description>Local variable &lt;code&gt;x&lt;/code&gt; declared in one 'switch' branch and used in another #loc</description>
</problem>
</problems>
@@ -1,11 +1,33 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.siyeh.ig.controlflow;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class SwitchStatementWithConfusingDeclarationInspectionTest extends IGInspectionTestCase {
public class SwitchStatementWithConfusingDeclarationInspectionTest extends LightInspectionTestCase {
public void test() {
doTest("com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration",
new SwitchStatementWithConfusingDeclarationInspection());
public void testSwitchStatementWithConfusingDeclaration() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
return new SwitchStatementWithConfusingDeclarationInspection();
}
}