Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-03-03 13:51:04 +0000
committerMarkus Schorn2008-03-03 13:51:04 +0000
commit7484954d7f9f41129241cb4910b0e929455f58e6 (patch)
tree5dd6612bebfacd4207a56f60900f371edc0a4e50 /core/org.eclipse.cdt.ui.tests
parent51ad68a3b508297e6e413d6efa707ad8157bbb9b (diff)
downloadorg.eclipse.cdt-7484954d7f9f41129241cb4910b0e929455f58e6.tar.gz
org.eclipse.cdt-7484954d7f9f41129241cb4910b0e929455f58e6.tar.xz
org.eclipse.cdt-7484954d7f9f41129241cb4910b0e929455f58e6.zip
Testcase for navigation on empty macro, bug 198649.
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
index 54614ad3eb5..21e216af613 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsNoIndexer.java
@@ -1012,4 +1012,21 @@ public class CPPSelectionTestsNoIndexer extends BaseUITestCase {
assertEquals(((ASTNode)decl).getOffset(), code.length() + od2);
}
}
+
+ // #define EMPTY
+ // EMPTY void foo() {}
+ public void testEmptyMacro_Bug198649() throws Exception {
+ String code= getContentsForTest(1)[0].toString();
+ String[] filenames= {"testBug198649.c", "testBug198649.cpp"};
+ for (int i=0; i<2; i++) {
+ IFile file = importFile(filenames[i], code);
+ int od1 = code.indexOf("EMPTY");
+ int or1 = code.indexOf("EMPTY", od1+1);
+
+ IASTNode decl = testF3(file, or1);
+ assertTrue(decl instanceof IASTName);
+ assertEquals(((IASTName)decl).toString(), "EMPTY"); //$NON-NLS-1$
+ assertEquals(((ASTNode)decl).getOffset(), od1);
+ }
+ }
}

Back to the top