mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Second test case for bug 257818.
This commit is contained in:
parent
39dc95b0e6
commit
bc98cae747
1 changed files with 43 additions and 1 deletions
|
@ -43,6 +43,7 @@ import org.eclipse.cdt.core.dom.ast.ITypedef;
|
|||
import org.eclipse.cdt.core.dom.ast.IVariable;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
|
@ -721,7 +722,7 @@ public class IndexBugsTests extends BaseTestCase {
|
|||
// void test(B<int>::value_type x) {
|
||||
// f(x); // problem on f
|
||||
// }
|
||||
public void _test257818() throws Exception {
|
||||
public void _test257818_1() throws Exception {
|
||||
waitForIndexer();
|
||||
|
||||
String[] testData = getContentsForTest(4);
|
||||
|
@ -742,6 +743,47 @@ public class IndexBugsTests extends BaseTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
// // test1.h
|
||||
// template<class U> struct A {
|
||||
// typedef U value_type;
|
||||
// };
|
||||
|
||||
// // test2.h
|
||||
// #include "test1.h"
|
||||
// template<class T> struct B {
|
||||
// typedef A<T> container_type;
|
||||
// typedef typename container_type::value_type value_type;
|
||||
// void m(value_type* p);
|
||||
// };
|
||||
|
||||
// #include "test1.h"
|
||||
|
||||
// #include "test2.h"
|
||||
// class C {};
|
||||
// void test(B<C> x, C y) {
|
||||
// x.m(&y);
|
||||
// }
|
||||
public void _test257818_2() throws Exception {
|
||||
waitForIndexer();
|
||||
|
||||
String[] testData = getContentsForTest(4);
|
||||
TestSourceReader.createFile(fCProject.getProject(), "test1.h", testData[0]);
|
||||
TestSourceReader.createFile(fCProject.getProject(), "test2.h", testData[1]);
|
||||
TestSourceReader.createFile(fCProject.getProject(), "test1.cpp", testData[2]);
|
||||
IFile test2= TestSourceReader.createFile(fCProject.getProject(), "test2.cpp", testData[3]);
|
||||
final IIndexManager indexManager = CCorePlugin.getIndexManager();
|
||||
indexManager.reindex(fCProject);
|
||||
waitForIndexer();
|
||||
IIndex index= indexManager.getIndex(fCProject);
|
||||
index.acquireReadLock();
|
||||
try {
|
||||
IASTTranslationUnit ast = TestSourceReader.createIndexBasedAST(index, fCProject, test2);
|
||||
getBindingFromASTName(ast, testData[3], "m(&y)", 1, ICPPMethod.class);
|
||||
} finally {
|
||||
index.releaseReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
// class A {}; class B {}; class C {};
|
||||
public void testIndexContentOverProjectDelete() throws Exception {
|
||||
waitForIndexer();
|
||||
|
|
Loading…
Add table
Reference in a new issue