1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +02:00

Added _testTemplateClassMethod_207320

This commit is contained in:
Sergey Prigogin 2007-12-24 23:13:23 +00:00
parent 9fcb8e7bb0
commit 0993798b3b

View file

@ -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