mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
Fix for 104583, part I, indexer policy core implementation
This commit is contained in:
parent
c7553e11bf
commit
f7f9021075
8 changed files with 27 additions and 10 deletions
|
@ -5,7 +5,6 @@ Bundle-SymbolicName: org.eclipse.cdt.core.tests; singleton:=true
|
||||||
Bundle-Version: 4.0.0.qualifier
|
Bundle-Version: 4.0.0.qualifier
|
||||||
Bundle-ClassPath: cdtcoretests.jar
|
Bundle-ClassPath: cdtcoretests.jar
|
||||||
Bundle-Activator: org.eclipse.cdt.core.testplugin.CTestPlugin
|
Bundle-Activator: org.eclipse.cdt.core.testplugin.CTestPlugin
|
||||||
Bundle-Localization: plugin
|
|
||||||
Export-Package: org.eclipse.cdt.core.cdescriptor.tests,
|
Export-Package: org.eclipse.cdt.core.cdescriptor.tests,
|
||||||
org.eclipse.cdt.core.internal.errorparsers.tests,
|
org.eclipse.cdt.core.internal.errorparsers.tests,
|
||||||
org.eclipse.cdt.core.model.failedTests,
|
org.eclipse.cdt.core.model.failedTests,
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.language;
|
package org.eclipse.cdt.core.language;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.index.tests.IndexTests;
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
@ -20,7 +19,7 @@ import junit.framework.TestSuite;
|
||||||
*/
|
*/
|
||||||
public class AllLanguageTests extends TestSuite {
|
public class AllLanguageTests extends TestSuite {
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite = new IndexTests();
|
TestSuite suite = new AllLanguageTests();
|
||||||
|
|
||||||
suite.addTest(LanguageInheritanceTests.suite());
|
suite.addTest(LanguageInheritanceTests.suite());
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.core.language;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.IPDOMManager;
|
import org.eclipse.cdt.core.dom.IPDOMManager;
|
||||||
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
|
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
|
||||||
|
@ -24,7 +23,6 @@ import org.eclipse.cdt.core.model.LanguageManager;
|
||||||
import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
||||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||||
import org.eclipse.cdt.internal.core.CContentTypes;
|
import org.eclipse.cdt.internal.core.CContentTypes;
|
||||||
import org.eclipse.cdt.internal.index.tests.IndexCompositeTests;
|
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.content.IContentType;
|
import org.eclipse.core.runtime.content.IContentType;
|
||||||
|
|
|
@ -92,6 +92,11 @@ public class BaseUITestCase extends BaseTestCase {
|
||||||
long endTime= System.currentTimeMillis()+time;
|
long endTime= System.currentTimeMillis()+time;
|
||||||
do {
|
do {
|
||||||
while (Display.getCurrent().readAndDispatch());
|
while (Display.getCurrent().readAndDispatch());
|
||||||
|
try {
|
||||||
|
Thread.sleep(20);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while(System.currentTimeMillis() < endTime);
|
while(System.currentTimeMillis() < endTime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,6 +288,14 @@ public class CallHierarchyAcrossProjectsTest extends CallHierarchyBaseTest {
|
||||||
TreeItem item1= checkTreeNode(item, 1, "MyClass::method1()");
|
TreeItem item1= checkTreeNode(item, 1, "MyClass::method1()");
|
||||||
checkTreeNode(item, 2, null); item= null;
|
checkTreeNode(item, 2, null); item= null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
tv.setExpandedState(item0.getData(), true);
|
||||||
|
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
||||||
|
}
|
||||||
|
catch (Throwable e) {
|
||||||
|
TreeItem tmp= item0; item0= item1; item1= tmp;
|
||||||
|
}
|
||||||
|
|
||||||
// method 1
|
// method 1
|
||||||
tv.setExpandedState(item0.getData(), true);
|
tv.setExpandedState(item0.getData(), true);
|
||||||
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
||||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
|
|
||||||
public class CallHierarchyBaseTest extends BaseUITestCase {
|
public class CallHierarchyBaseTest extends BaseUITestCase {
|
||||||
protected static final int INDEXER_WAIT_TIME = 8000;
|
protected static final int INDEXER_WAIT_TIME = 8000;
|
||||||
|
private static int sProjectCounter= 0;
|
||||||
|
|
||||||
protected ICProject fCProject;
|
protected ICProject fCProject;
|
||||||
protected IIndex fIndex;
|
protected IIndex fIndex;
|
||||||
|
@ -47,8 +48,8 @@ public class CallHierarchyBaseTest extends BaseUITestCase {
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
fCProject= CProjectHelper.createCCProject("__chTest__", "bin", IPDOMManager.ID_NO_INDEXER);
|
String prjName= "chTest"+sProjectCounter++;
|
||||||
CCorePlugin.getIndexManager().setIndexerId(fCProject, IPDOMManager.ID_FAST_INDEXER);
|
fCProject= CProjectHelper.createCCProject(prjName, "bin", IPDOMManager.ID_FAST_INDEXER);
|
||||||
CCorePlugin.getIndexManager().joinIndexer(INDEXER_WAIT_TIME, NPM);
|
CCorePlugin.getIndexManager().joinIndexer(INDEXER_WAIT_TIME, NPM);
|
||||||
fIndex= CCorePlugin.getIndexManager().getIndex(fCProject);
|
fIndex= CCorePlugin.getIndexManager().getIndex(fCProject);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -263,6 +263,14 @@ public class CppCallHierarchyTest extends CallHierarchyBaseTest {
|
||||||
checkTreeNode(item, 2, null); item= null;
|
checkTreeNode(item, 2, null); item= null;
|
||||||
|
|
||||||
// method 1
|
// method 1
|
||||||
|
try {
|
||||||
|
tv.setExpandedState(item0.getData(), true);
|
||||||
|
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
||||||
|
}
|
||||||
|
catch (Throwable e) {
|
||||||
|
TreeItem tmp= item0; item0= item1; item1= tmp;
|
||||||
|
}
|
||||||
|
|
||||||
tv.setExpandedState(item0.getData(), true);
|
tv.setExpandedState(item0.getData(), true);
|
||||||
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
nextItem= checkTreeNode(item0, 0, "MyClass::method2()");
|
||||||
checkTreeNode(item0, 1, null); item0= nextItem;
|
checkTreeNode(item0, 1, null); item0= nextItem;
|
||||||
|
|
|
@ -55,8 +55,7 @@ public class TypeHierarchyBaseTest extends BaseUITestCase {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
fCProject= CProjectHelper.createCCProject("__thTest__", "bin", IPDOMManager.ID_FAST_INDEXER);
|
fCProject= CProjectHelper.createCCProject("__thTest__", "bin", IPDOMManager.ID_FAST_INDEXER);
|
||||||
CCorePlugin.getIndexManager().reindex(fCProject);
|
CCorePlugin.getIndexManager().joinIndexer(INDEXER_WAIT_TIME, NPM);
|
||||||
|
|
||||||
fIndex= CCorePlugin.getIndexManager().getIndex(fCProject);
|
fIndex= CCorePlugin.getIndexManager().getIndex(fCProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue