Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorAlena Laskavaia2011-04-24 21:05:50 -0400
committerAlena Laskavaia2011-04-24 21:05:50 -0400
commit42958023adc2fa6620f61dcebb071269cba797c8 (patch)
tree4cc543403500ce8d146b83c796f6025105b722fd /codan
parentd3ddf272ed027fac573f264a98a57ff592555bff (diff)
downloadorg.eclipse.cdt-42958023adc2fa6620f61dcebb071269cba797c8.tar.gz
org.eclipse.cdt-42958023adc2fa6620f61dcebb071269cba797c8.tar.xz
org.eclipse.cdt-42958023adc2fa6620f61dcebb071269cba797c8.zip
Bug 338046 - Bogus warning in macro that resolves to 'case' statement
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java23
1 files changed, 23 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 22b25c826f..0c82b2e0ff 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
@@ -536,4 +536,27 @@ public class CaseBreakCheckerTest extends CheckerTestCase {
checkNoErrors();
}
+
+// #define MY_MACRO(i) \
+// case i: \
+// { \
+// break; \
+// }
+//
+// void f()
+// {
+// int x;
+// switch (x)
+// {
+// MY_MACRO(1) // WARNING HERE
+// }
+// }
+
+ public void testInMacro() {
+ String code = getAboveComment();
+ loadCodeAndRun(code);
+ checkNoErrors();
+ }
+
+
}

Back to the top