Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-04-24 21:02:56 -0400
committerAlena Laskavaia2011-04-24 21:02:56 -0400
commitd3ddf272ed027fac573f264a98a57ff592555bff (patch)
tree6a68816d4d191d80de086923bbf8cf3b828fa516 /codan/org.eclipse.cdt.codan.core.test
parent4f80f47e85712e723304cb14aacda9cc7f8ec340 (diff)
downloadorg.eclipse.cdt-d3ddf272ed027fac573f264a98a57ff592555bff.tar.gz
org.eclipse.cdt-d3ddf272ed027fac573f264a98a57ff592555bff.tar.xz
org.eclipse.cdt-d3ddf272ed027fac573f264a98a57ff592555bff.zip
Bug 339802 - [fp] No break at the end of case if "break" is defined in braces and in a macro
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.java16
1 files changed, 16 insertions, 0 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 8ada941e0e..22b25c826f 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
@@ -520,4 +520,20 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
loadCodeAndRun(code);
checkErrorLine(3);
}
+
+// #define DEFINE_BREAK {break;}
+// void foo ( int a )
+// {
+// switch ( a )
+// {
+// case 1:
+// DEFINE_BREAK // <-- Warning: No break at the end of this case
+// }
+// }
+ public void testBreakInBraces() {
+ String code = getAboveComment();
+ loadCodeAndRun(code);
+ checkNoErrors();
+ }
+
}

Back to the top