Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-03-06 08:23:15 +0000
committerMarkus Schorn2008-03-06 08:23:15 +0000
commit16d620eaa5b3a4f4bfd5954e3391190a9760a516 (patch)
tree093fd3b30c53ba159f7303772ce37b9c77804279 /core/org.eclipse.cdt.ui.tests
parent116aa49ea714f3d4be645f72b064c4e343577165 (diff)
downloadorg.eclipse.cdt-16d620eaa5b3a4f4bfd5954e3391190a9760a516.tar.gz
org.eclipse.cdt-16d620eaa5b3a4f4bfd5954e3391190a9760a516.tar.xz
org.eclipse.cdt-16d620eaa5b3a4f4bfd5954e3391190a9760a516.zip
Navigation from macro definition body, bug 102643.
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/CSelectionTestsAnyIndexer.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
index b5bfaa23dc1..8fef004739a 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
@@ -451,14 +451,14 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
assertNode("MY_PAR", offset0, decl);
}
- // #define MY_MACRO 0xDEADBEEF
- // #define MY_PAR( aRef );
+ // #define MY_MACRO 0xDEADBEEF
+ // #define MY_PAR( aRef ) aRef
// #include "macrodef.h"
// int basictest(void){
// int tester = MY_PAR(MY_MACRO);
// }
- public void _testMacroNavigation_Bug208300() throws Exception {
+ public void testMacroNavigation_Bug208300() throws Exception {
StringBuffer[] buffers= getContents(2);
String hcode= buffers[0].toString();
String scode= buffers[1].toString();
@@ -498,4 +498,24 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
IEditorInput input = part.getEditorInput();
assertEquals("aheader.h", ((FileEditorInput)input).getFile().getName());
}
+
+ // #define DR_NUM_DIMENSIONS(DR) VEC_length (tree, DR_ACCESS_FNS (DR))
+
+ // #define DR_ACCESS_FNS(DR)
+ public void testNavigationInMacroDefinition_Bug102643() throws Exception {
+ StringBuffer[] buffers= getContents(2);
+ String hcode= buffers[0].toString();
+ String scode= buffers[1].toString();
+ IFile hfile = importFile("aheader.h", hcode);
+ IFile file = importFile("source.cpp", scode);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ IASTNode decl;
+ int offset0, offset1;
+
+ offset1 = hcode.indexOf("DR_ACC");
+ testF3(hfile, offset1);
+ IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ IEditorInput input = part.getEditorInput();
+ assertEquals("source.cpp", ((FileEditorInput)input).getFile().getName());
+ }
}

Back to the top