1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Removal of test cases specific to full indexer, bug 294864.

This commit is contained in:
Markus Schorn 2009-11-18 16:40:18 +00:00
parent 6205516e38
commit 30fe21353c
6 changed files with 3 additions and 132 deletions

View file

@ -1146,61 +1146,6 @@ public class IndexBugsTests extends BaseTestCase {
}
}
// int globalVar;
// #include "../__bugsTest__/common.h"
// void func() {
// globalVar++;
// }
public void testDependentProjectsWithFullIndexer_Bug197311() throws Exception {
String[] contents= getContentsForTest(2);
final IIndexManager indexManager = CCorePlugin.getIndexManager();
indexManager.setIndexerId(fCProject, IPDOMManager.ID_FULL_INDEXER);
ICProject p2 = CProjectHelper.createCCProject("bug197311", "bin", IPDOMManager.ID_FULL_INDEXER);
IProject[] refs = new IProject[] {fCProject.getProject()};
IProjectDescription pd = p2.getProject().getDescription();
pd.setReferencedProjects(refs);
p2.getProject().setDescription(pd, new NullProgressMonitor());
try {
IFile f1= TestSourceReader.createFile(fCProject.getProject(), "common.h", contents[0]);
IFile f2= TestSourceReader.createFile(fCProject.getProject(), "src.cpp", contents[1]);
IFile f3= TestSourceReader.createFile(p2.getProject(), "src.cpp", contents[1]);
waitForIndexer();
IIndex index= indexManager.getIndex(p2, IIndexManager.ADD_DEPENDENCIES);
index.acquireReadLock();
try {
IIndexBinding[] bindings= index.findBindings("globalVar".toCharArray(), IndexFilter.ALL, NPM);
assertEquals(1, bindings.length);
IIndexBinding binding= bindings[0];
IIndexName[] names= index.findReferences(binding);
assertEquals(2, names.length);
names= index.findDeclarations(binding);
assertEquals(1, names.length);
} finally {
index.releaseReadLock();
}
indexManager.reindex(p2);
waitForIndexer();
index= indexManager.getIndex(p2, IIndexManager.ADD_DEPENDENCIES);
index.acquireReadLock();
try {
IIndexBinding[] bindings= index.findBindings("globalVar".toCharArray(), IndexFilter.ALL, NPM);
assertEquals(1, bindings.length);
IIndexBinding binding= bindings[0];
IIndexName[] names= index.findReferences(binding);
assertEquals(2, names.length);
names= index.findDeclarations(binding);
assertEquals(1, names.length);
} finally {
index.releaseReadLock();
}
} finally {
CProjectHelper.delete(p2);
}
}
// #define MAC(...) Bug200239

View file

@ -96,19 +96,6 @@ public class IndexIncludeTest extends IndexTestBase {
assertTrue(CCorePlugin.getIndexManager().joinIndexer(10000, NPM));
}
public void testFullIndexer() throws Exception {
CCorePlugin.getIndexManager().setIndexerId(fProject, IPDOMManager.ID_FULL_INDEXER);
IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false");
waitForIndexer();
checkHeader(false);
IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "true");
waitForIndexer();
checkHeader(true);
checkContext();
}
private void checkHeader(boolean all) throws Exception {
fIndex.acquireReadLock();
try {

View file

@ -22,6 +22,9 @@ import org.eclipse.core.runtime.CoreException;
public interface IPDOMManager {
public static final String ID_NO_INDEXER= "org.eclipse.cdt.core.nullindexer"; //$NON-NLS-1$
public static final String ID_FAST_INDEXER= "org.eclipse.cdt.core.fastIndexer"; //$NON-NLS-1$
/**
* @deprecated, the full indexer has been removed.
*/
public static final String ID_FULL_INDEXER= "org.eclipse.cdt.core.domsourceindexer"; //$NON-NLS-1$
// Getting and setting indexer Ids

View file

@ -1,31 +0,0 @@
/*******************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text.selection;
import junit.framework.Test;
import org.eclipse.cdt.core.dom.IPDOMManager;
/**
* Test Ctrl_F3/F3 with the DOM Indexer for a C++ project.
*
* @author dsteffle
*/
public class CPPSelectionTestsDOMIndexer extends CPPSelectionTestsAnyIndexer {
public CPPSelectionTestsDOMIndexer(String name) {
super(name, IPDOMManager.ID_FULL_INDEXER);
}
public static Test suite() {
return suite(CPPSelectionTestsDOMIndexer.class);
}
}

View file

@ -1,31 +0,0 @@
/*******************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text.selection;
import junit.framework.Test;
import org.eclipse.cdt.core.dom.IPDOMManager;
/**
* Test Ctrl_F3/F3 with the DOM Indexer for a C project.
*
* @author dsteffle
*/
public class CSelectionTestsDOMIndexer extends CSelectionTestsAnyIndexer {
public CSelectionTestsDOMIndexer(String name) {
super(name, IPDOMManager.ID_FULL_INDEXER);
}
public static Test suite() {
return suite(CSelectionTestsDOMIndexer.class);
}
}

View file

@ -28,7 +28,5 @@ public class SelectionTestSuite extends TestSuite {
addTest( CSelectionTestsNoIndexer.suite() );
addTest( CPPSelectionTestsFastIndexer.suite() );
addTest( CSelectionTestsFastIndexer.suite() );
addTest( CPPSelectionTestsDOMIndexer.suite() );
addTest( CSelectionTestsDOMIndexer.suite() );
}
}