1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixes for occasional JUnit failures

This commit is contained in:
Markus Schorn 2010-05-05 13:33:51 +00:00
parent 10519ecf5f
commit c1c856a38e
2 changed files with 19 additions and 3 deletions

View file

@ -21,13 +21,13 @@ import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IBasicType; import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunctionType; import org.eclipse.cdt.core.dom.ast.IFunctionType;
import org.eclipse.cdt.core.dom.ast.IParameter; import org.eclipse.cdt.core.dom.ast.IParameter;
import org.eclipse.cdt.core.dom.ast.IScope; import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef; import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope; import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
@ -76,6 +76,19 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
public static class ProjectWithDepProj extends IndexCPPTemplateResolutionTest { public static class ProjectWithDepProj extends IndexCPPTemplateResolutionTest {
public ProjectWithDepProj() {setStrategy(new ReferencedProject(true));} public ProjectWithDepProj() {setStrategy(new ReferencedProject(true));}
public static TestSuite suite() {return suite(ProjectWithDepProj.class);} public static TestSuite suite() {return suite(ProjectWithDepProj.class);}
// template <typename T= int> class XT;
// #include "header.h"
// template <typename T> class XT {};
// void test() {
// XT<> x;
// };
@Override
public void testDefaultTemplateArgInHeader_264988() throws Exception {
// Not supported across projects (the composite index does not merge
// default values of template parameters).
}
} }
public static void addTests(TestSuite suite) { public static void addTests(TestSuite suite) {

View file

@ -186,17 +186,20 @@ public class IndexLocationTest extends BaseTestCase {
IFolder content= cproject.getProject().getFolder("content"); IFolder content= cproject.getProject().getFolder("content");
content.createLink(new Path(location.getParentFile().getAbsolutePath()), IResource.NONE, null); content.createLink(new Path(location.getParentFile().getAbsolutePath()), IResource.NONE, null);
final IFile file = content.getFile("external2.h");
assertTrue(file.exists());
ICProject cproject2= CProjectHelper.createCProject("LocationTests2"+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER); ICProject cproject2= CProjectHelper.createCProject("LocationTests2"+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
deleteOnTearDown(cproject2); deleteOnTearDown(cproject2);
IFolder content2= cproject2.getProject().getFolder("content"); IFolder content2= cproject2.getProject().getFolder("content");
content2.createLink(new Path(location.getParentFile().getAbsolutePath()), IResource.NONE, null); content2.createLink(new Path(location.getParentFile().getAbsolutePath()), IResource.NONE, null);
assertTrue(content2.getFile("external2.h").exists());
waitForIndexer(cproject2); IIndex index = CCorePlugin.getIndexManager().getIndex(cproject);
TestSourceReader.waitUntilFileIsIndexed(index, file, 10000);
CCorePlugin.getIndexManager().reindex(cproject); CCorePlugin.getIndexManager().reindex(cproject);
waitForIndexer(cproject); waitForIndexer(cproject);
IIndex index = CCorePlugin.getIndexManager().getIndex(cproject);
index.acquireReadLock(); index.acquireReadLock();
try { try {
IBinding[] bs= index.findBindings("External".toCharArray(), IndexFilter.ALL, NPM); IBinding[] bs= index.findBindings("External".toCharArray(), IndexFilter.ALL, NPM);