1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 515814 - codan: add missing JUnit Test

Change-Id: I626811b33ed09bb07c947c1c491b2c04e282232b
Signed-off-by: romibi <romibi@bluewin.ch>
This commit is contained in:
romibi 2017-04-26 11:47:01 +02:00 committed by Gerrit Code Review @ Eclipse.org
parent 6473183440
commit 525d8a23fb
2 changed files with 46 additions and 0 deletions

View file

@ -34,6 +34,7 @@ import org.eclipse.cdt.codan.core.internal.checkers.SuspiciousSemicolonCheckerTe
import org.eclipse.cdt.codan.core.internal.checkers.UnusedSymbolInFileScopeCheckerTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.AssignmentInConditionQuickFixTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CaseBreakQuickFixTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CaseBreakQuickFixCommentTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CatchByReferenceQuickFixTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.CreateLocalVariableQuickFixTest;
import org.eclipse.cdt.codan.internal.checkers.ui.quickfix.SuggestedParenthesisQuickFixTest;
@ -81,6 +82,7 @@ public class AutomatedIntegrationSuite extends TestSuite {
suite.addTestSuite(SuggestedParenthesisQuickFixTest.class);
suite.addTestSuite(CatchByReferenceQuickFixTest.class);
suite.addTestSuite(CaseBreakQuickFixTest.class);
suite.addTestSuite(CaseBreakQuickFixCommentTest.class);
suite.addTestSuite(AssignmentInConditionQuickFixTest.class);
return suite;
}

View file

@ -0,0 +1,44 @@
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
public class CaseBreakQuickFixCommentTest extends QuickFixTestCase {
@SuppressWarnings("restriction")
@Override
protected AbstractCodanCMarkerResolution createQuickFix() {
return new CaseBreakQuickFixComment();
}
//void hello() {}
//void func() {
// int a;
// switch(a) {
// case 1:
// hello();
// case 2:
// break;
// }
//}
public void testSimpleCase_515814() throws Exception {
loadcode(getAboveComment(), true);
String result = runQuickFixOneFile();
assertContainedIn("/* no break */\tcase 2:", result);
}
//void hello() {}
//void func() {
// int a;
// switch(a) {
// case 1: {
// hello();
// }
// case 2:
// break;
// }
//}
public void testCompositeCase_515814() throws Exception {
loadcode(getAboveComment(), true);
String result = runQuickFixOneFile();
assertContainedIn("/* no break */\tcase 2:", result);
}
}