Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-05-18 22:37:55 -0400
committerSergey Prigogin2011-05-18 22:37:55 -0400
commit51401d68f69e7d9d68587511d7db7ca8ebd1a125 (patch)
tree36cd90c66bc262557bb56ffd77b30a09a5bfe9b4 /codan/org.eclipse.cdt.codan.core.test
parent5af284cece004a79d644b720ee44dae1a6b4dbfb (diff)
downloadorg.eclipse.cdt-51401d68f69e7d9d68587511d7db7ca8ebd1a125.tar.gz
org.eclipse.cdt-51401d68f69e7d9d68587511d7db7ca8ebd1a125.tar.xz
org.eclipse.cdt-51401d68f69e7d9d68587511d7db7ca8ebd1a125.zip
Do not report suspicious semicolons produced by macro expansion.
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/SuspiciousSemicolonCheckerTest.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
index 2b4d1d39e9..cf4f4f1530 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/SuspiciousSemicolonCheckerTest.java
@@ -144,14 +144,23 @@ public class SuspiciousSemicolonCheckerTest extends CheckerTestCase {
// #define OP
// void foo() {
- // if(0)
- // OP;
+ // if(0)
+ // OP;
// }
public void testMacro() {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
+ // #define MACRO(cond) if (cond) ;
+ // void foo() {
+ // MACRO(true);
+ // }
+ public void testMacroExpansion() {
+ loadCodeAndRun(getAboveComment());
+ checkNoErrors();
+ }
+
// main() {
// if (false)
// ; // only this one is reported

Back to the top