Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-04-24 15:00:34 -0400
committerAlena Laskavaia2011-04-24 15:00:34 -0400
commita27af205a91ff09d9e0dcc4d7b2d24892433107f (patch)
tree86e934b156c8246c8f2ef00cb33c436df546d59a /codan/org.eclipse.cdt.codan.core.test
parent72353369b36ed14bb04126d0000940d55042b240 (diff)
downloadorg.eclipse.cdt-a27af205a91ff09d9e0dcc4d7b2d24892433107f.tar.gz
org.eclipse.cdt-a27af205a91ff09d9e0dcc4d7b2d24892433107f.tar.xz
org.eclipse.cdt-a27af205a91ff09d9e0dcc4d7b2d24892433107f.zip
Bug 343676: rewrote case checker to support complex structures
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java37
1 files changed, 35 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
index ee4ef45e50..8ada941e0e 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java
@@ -20,7 +20,7 @@ import org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker;
public class CaseBreakCheckerTest extends CheckerTestCase {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.test.CodanTestCase#setUp()
*/
@Override
@@ -375,7 +375,7 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
// }
public void testNestedSwitches() {
loadCodeAndRun(getAboveComment());
- checkErrorLines(4, 6, 9, 20, 27);
+ checkErrorLines(4, 20, 6, 9, 27);
}
// void foo(void) {
@@ -487,4 +487,37 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
loadCodeAndRun(code);
checkNoErrors();
}
+
+ // void foo(int a) {
+ // switch( a ) {
+ // case 2:
+ // if (a*2<10)
+ // return;
+ // else
+ // break;
+ // case 1:
+ // break;
+ // }
+ // }
+ public void testIf() {
+ String code = getAboveComment();
+ loadCodeAndRun(code);
+ checkNoErrors();
+ }
+ // void foo(int a) {
+ // switch( a ) {
+ // case 2:
+ // if (a*2<10)
+ // return;
+ // else
+ // a++;
+ // case 1:
+ // break;
+ // }
+ // }
+ public void testIfErr() {
+ String code = getAboveComment();
+ loadCodeAndRun(code);
+ checkErrorLine(3);
+ }
}

Back to the top