diff options
author | Sergey Prigogin | 2007-12-24 23:13:23 +0000 |
---|---|---|
committer | Sergey Prigogin | 2007-12-24 23:13:23 +0000 |
commit | 0993798b3bf1987aacb42e7e616be2171da5af23 (patch) | |
tree | e35c0cb0143682b7d56ac63a72e3b80c934f49da | |
parent | 9fcb8e7bb0a2e80294cf8587daeea380fcc2c52c (diff) | |
download | org.eclipse.cdt-0993798b3bf1987aacb42e7e616be2171da5af23.tar.gz org.eclipse.cdt-0993798b3bf1987aacb42e7e616be2171da5af23.tar.xz org.eclipse.cdt-0993798b3bf1987aacb42e7e616be2171da5af23.zip |
Added _testTemplateClassMethod_207320
-rw-r--r-- | core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java index 25c2e42b72b..e46cdb80b95 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java @@ -169,8 +169,34 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde assertEquals(((ASTNode)def).getOffset(), hoffset); assertEquals(((ASTNode)def).getLength(), 12); } - - // // the header + + // template<typename T> + // class C { + // public: void assign(const T* s) {} + // }; + + // void main() { + // C<char> a; + // a.assign("aaa"); + // } + public void _testTemplateClassMethod_207320() throws Exception { + StringBuffer[] buffers= getContents(2); + String hcode= buffers[0].toString(); + String scode= buffers[1].toString(); + IFile hfile = importFile("test.h", hcode); //$NON-NLS-1$ + IFile file = importFile("test.cpp", scode); //$NON-NLS-1$ + TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME); + + int hoffset= hcode.indexOf("assign"); //$NON-NLS-1$ + int soffset = scode.indexOf("assign"); //$NON-NLS-1$ + IASTNode def = testF3(file, soffset + 2); + assertTrue(def instanceof IASTName); + assertEquals(((IASTName) def).toString(), "assign"); //$NON-NLS-1$ + assertEquals(((ASTNode) def).getOffset(), hoffset); + assertEquals(((ASTNode) def).getLength(), 6); + } + + // // the header // extern int MyInt; // MyInt is in another file // extern const int MyConst; // MyConst is in another file // void MyFunc(int); // often used in header files |