Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-08-19 20:16:10 -0400
committerSergey Prigogin2012-08-22 19:57:12 -0400
commitffe717ed933c65a595aa422edc85d013925c6b9c (patch)
tree6a8e65e5c342aeef41a452b6ef951f94efda7ed6
parent379cc8e8e1ac51720b9ef2852d5f2db6e4205cfc (diff)
downloadorg.eclipse.cdt-ffe717ed933c65a595aa422edc85d013925c6b9c.tar.gz
org.eclipse.cdt-ffe717ed933c65a595aa422edc85d013925c6b9c.tar.xz
org.eclipse.cdt-ffe717ed933c65a595aa422edc85d013925c6b9c.zip
Simpler and more robust implementation of PDOMManager.joinIndexer
method.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java60
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java68
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java2
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java9
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java70
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java33
7 files changed, 124 insertions, 130 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
index a0f0001426..e4d0bdfdb6 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
@@ -108,7 +108,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
public class IndexBugsTests extends BaseTestCase {
- private static final int INDEX_WAIT_TIME = 800000; //XXX
+ private static final int INDEXER_TIMEOUT_SEC = 20;
private ICProject fCProject;
protected IIndex fIndex;
@@ -305,13 +305,13 @@ public class IndexBugsTests extends BaseTestCase {
private void waitForIndexer() throws InterruptedException {
final IIndexManager indexManager = CCorePlugin.getIndexManager();
- assertTrue(indexManager.joinIndexer(INDEX_WAIT_TIME, npm()));
+ assertTrue(indexManager.joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm()));
long waitms= 1;
while (waitms < 2000 && indexManager.isIndexerSetupPostponed(fCProject)) {
Thread.sleep(waitms);
waitms *= 2;
}
- assertTrue(indexManager.joinIndexer(INDEX_WAIT_TIME, npm()));
+ assertTrue(indexManager.joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm()));
}
protected Pattern[] getPattern(String qname) {
@@ -385,7 +385,7 @@ public class IndexBugsTests extends BaseTestCase {
String[] content= getContentsForTest(2);
IFile file= createFile(getProject(), "header.h", content[0]);
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
IIndex index= CCorePlugin.getIndexManager().getIndex(fCProject);
index.acquireReadLock();
@@ -399,7 +399,7 @@ public class IndexBugsTests extends BaseTestCase {
}
file= createFile(getProject(), "header.h", content[1]);
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
index= CCorePlugin.getIndexManager().getIndex(fCProject);
index.acquireReadLock();
@@ -425,10 +425,10 @@ public class IndexBugsTests extends BaseTestCase {
content.append("unsigned int arrayDataSize = sizeof(arrayData);\n");
int indexOfDecl = content.indexOf(varName);
- assertTrue(CCorePlugin.getIndexManager().joinIndexer(INDEX_WAIT_TIME, npm()));
+ assertTrue(CCorePlugin.getIndexManager().joinIndexer(INDEXER_TIMEOUT_SEC * 1000, npm()));
IFile file= createFile(getProject(), fileName, content.toString());
// must be done in a reasonable amount of time
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
IIndexBinding[] bindings= fIndex.findBindings(getPattern("arrayDataSize"), true, IndexFilter.ALL, npm());
@@ -451,7 +451,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test156671.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -469,7 +469,7 @@ public class IndexBugsTests extends BaseTestCase {
TestScannerProvider.sIncludes= new String[]{include.getLocation().removeLastSegments(1).toString()};
TestScannerProvider.sIncludeFiles= new String[]{include.getName()};
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test160281_1.cpp", "");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -493,7 +493,7 @@ public class IndexBugsTests extends BaseTestCase {
TestScannerProvider.sIncludes= new String[]{include.getLocation().removeLastSegments(1).toString()};
TestScannerProvider.sMacroFiles= new String[]{include.getName()};
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test160281_2.cpp", "int X;");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -528,7 +528,7 @@ public class IndexBugsTests extends BaseTestCase {
int indexOfDecl = content.indexOf(funcName);
int indexOfDef = content.indexOf(funcName, indexOfDecl+1);
IFile file= createFile(getProject(), fileName, content);
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
// make sure the ast is correct
ITranslationUnit tu= (ITranslationUnit) fCProject.findElement(new Path(fileName));
@@ -569,7 +569,7 @@ public class IndexBugsTests extends BaseTestCase {
IFile include= TestSourceReader.createFile(fCProject.getProject(), "test164360.h", "");
TestScannerProvider.sIncludeFiles= new String[] { include.getLocation().toOSString() };
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test164360.cpp", "");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -592,7 +592,7 @@ public class IndexBugsTests extends BaseTestCase {
IFile include= TestSourceReader.createFile(fCProject.getProject(), "test164360.h", "");
TestScannerProvider.sMacroFiles= new String[]{include.getLocation().toOSString()};
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test164360.cpp", "");
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -618,7 +618,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test164500.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -655,7 +655,7 @@ public class IndexBugsTests extends BaseTestCase {
String[] testData = getContentsForTest(3);
IFile header= TestSourceReader.createFile(cproject.getProject(), "header.h", testData[0]);
IFile referer= TestSourceReader.createFile(cproject.getProject(), "content.cpp", testData[1]);
- TestSourceReader.waitUntilFileIsIndexed(index, referer, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, referer, INDEXER_TIMEOUT_SEC * 1000);
index.acquireReadLock();
try {
@@ -670,7 +670,7 @@ public class IndexBugsTests extends BaseTestCase {
InputStream in = new ByteArrayInputStream(testData[2].getBytes());
header.setContents(in, IResource.FORCE, null);
- TestSourceReader.waitUntilFileIsIndexed(index, header, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, header, INDEXER_TIMEOUT_SEC * 1000);
index.acquireReadLock();
try {
@@ -695,7 +695,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test172454.c", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -728,7 +728,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test172454.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -762,7 +762,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "test173997.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -781,7 +781,7 @@ public class IndexBugsTests extends BaseTestCase {
long timestamp= file.getLocalTimeStamp();
content= "int UPDATED20070213;\n" + content.replaceFirst("int", "float");
file= TestSourceReader.createFile(fCProject.getProject(), "test173997.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -814,7 +814,7 @@ public class IndexBugsTests extends BaseTestCase {
String[] content= getContentsForTest(2);
IFile file= createFile(getProject(), "header.h", content[0]);
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
IIndex index= CCorePlugin.getIndexManager().getIndex(fCProject);
index.acquireReadLock();
@@ -829,7 +829,7 @@ public class IndexBugsTests extends BaseTestCase {
}
file= createFile(getProject(), "header.h", content[1]);
- waitUntilFileIsIndexed(file, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(file, INDEXER_TIMEOUT_SEC * 1000);
index= CCorePlugin.getIndexManager().getIndex(fCProject);
index.acquireReadLock();
@@ -971,7 +971,7 @@ public class IndexBugsTests extends BaseTestCase {
IIndex index = CCorePlugin.getIndexManager().getIndex(cproject);
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(cproject.getProject(), "content.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(index, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
CProjectHelper.delete(cproject);
cproject = CProjectHelper.createCCProject(pname, "bin", IPDOMManager.ID_FAST_INDEXER);
@@ -997,7 +997,7 @@ public class IndexBugsTests extends BaseTestCase {
IIndex index = CCorePlugin.getIndexManager().getIndex(cproject);
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(cproject.getProject(), "content.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(index, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
// move the project to a random new location
File newLocation = CProjectHelper.freshDir();
@@ -1030,7 +1030,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "testFBWP.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -1063,7 +1063,7 @@ public class IndexBugsTests extends BaseTestCase {
String content= getContentsForTest(1)[0];
IFile file= TestSourceReader.createFile(fCProject.getProject(), "testFilterFindBindingsFQCharArray.cpp", content);
- TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(fIndex, file, INDEXER_TIMEOUT_SEC * 1000);
fIndex.acquireReadLock();
try {
@@ -1186,7 +1186,7 @@ public class IndexBugsTests extends BaseTestCase {
String[] contents= getContentsForTest(2);
final IIndexManager indexManager = CCorePlugin.getIndexManager();
IFile f1= TestSourceReader.createFile(fCProject.getProject(), "header.h", contents[0]);
- waitUntilFileIsIndexed(f1, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(f1, INDEXER_TIMEOUT_SEC * 1000);
IFile f2= TestSourceReader.createFile(fCProject.getProject(), "src.cpp", contents[1]);
waitForIndexer();
@@ -1212,7 +1212,7 @@ public class IndexBugsTests extends BaseTestCase {
String[] contents= getContentsForTest(2);
final IIndexManager indexManager = CCorePlugin.getIndexManager();
IFile f1= TestSourceReader.createFile(fCProject.getProject(), "header.h", contents[0]);
- waitUntilFileIsIndexed(f1, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(f1, INDEXER_TIMEOUT_SEC * 1000);
IFile f2= TestSourceReader.createFile(fCProject.getProject(), "src.cpp", contents[1]);
waitForIndexer();
@@ -2303,7 +2303,7 @@ public class IndexBugsTests extends BaseTestCase {
}
s= TestSourceReader.createFile(src, "source.cpp", "#include \"../h/a.h\"");
- waitUntilFileIsIndexed(s, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(s, INDEXER_TIMEOUT_SEC * 1000);
index.acquireReadLock();
try {
r = index.findBindings("version2".toCharArray(), IndexFilter.ALL_DECLARED, null);
@@ -2313,7 +2313,7 @@ public class IndexBugsTests extends BaseTestCase {
}
s= TestSourceReader.createFile(h, "a.h", "int version3;");
- waitUntilFileIsIndexed(s, INDEX_WAIT_TIME);
+ waitUntilFileIsIndexed(s, INDEXER_TIMEOUT_SEC * 1000);
index.acquireReadLock();
try {
r = index.findBindings("version2".toCharArray(), IndexFilter.ALL_DECLARED, null);
diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java
index b9767eed4f..26debd1fd6 100644
--- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java
+++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java
@@ -29,6 +29,7 @@ import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexFile;
+import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IndexLocationFactory;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
@@ -315,18 +316,21 @@ public class TestSourceReader {
* @since 4.0
*/
public static void waitUntilFileIsIndexed(IIndex index, IFile file, int maxmillis) throws Exception {
+ long fileTimestamp = file.getLocalTimeStamp();
+ IIndexFileLocation indexFileLocation = IndexLocationFactory.getWorkspaceIFL(file);
+
long endTime= System.currentTimeMillis() + maxmillis;
int timeLeft= maxmillis;
while (timeLeft >= 0) {
Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
index.acquireReadLock();
try {
- IIndexFile[] files= index.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
- if (files.length > 0 && areAllFilesNotOlderThan(files, file.getLocalTimeStamp())) {
+ IIndexFile[] files= index.getFiles(ILinkage.CPP_LINKAGE_ID, indexFileLocation);
+ if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
return;
}
- files= index.getFiles(ILinkage.C_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
- if (files.length > 0 && areAllFilesNotOlderThan(files, file.getLocalTimeStamp())) {
+ files= index.getFiles(ILinkage.C_LINKAGE_ID, indexFileLocation);
+ if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
return;
}
} finally {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
index 88867c6a35..1aca996655 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
@@ -100,7 +100,9 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.core.runtime.preferences.IPreferencesService;
@@ -1088,52 +1090,42 @@ public class PDOMManager implements IWritableIndexManager, IListener {
@Override
public boolean joinIndexer(final int waitMaxMillis, final IProgressMonitor monitor) {
assert monitor != null;
- long startMillis = System.currentTimeMillis();
-
- // Unfortunately, IJobManager.join() doesn't take a timeout. So, we create a watchdog thread to
- // interrupt the call if the indexer job doesn't complete in the alloted time
- Thread th= null;
- if (waitMaxMillis != FOREVER) {
- final Thread callingThread= Thread.currentThread();
- th= new Thread() {
- @Override
- public void run() {
- try {
- Thread.sleep(waitMaxMillis);
- monitor.setCanceled(true);
- callingThread.interrupt();
- } catch (InterruptedException e) {
+ long deadline = waitMaxMillis == FOREVER ? Long.MAX_VALUE : System.currentTimeMillis() + waitMaxMillis;
+
+ final boolean[] idleCondition = { false };
+ JobChangeAdapter listener = new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ synchronized (idleCondition) {
+ Job[] jobs = Job.getJobManager().find(PDOMManager.this);
+ if (jobs.length == 0 || jobs.length == 1 && event.getJob() == jobs[0]) {
+ idleCondition[0] = true;
+ idleCondition.notifyAll();
}
}
- };
- th.setDaemon(true);
- th.start();
- }
+ }
+ };
+ Job.getJobManager().addJobChangeListener(listener);
try {
- try {
- Job.getJobManager().join(this, monitor);
+ if (Job.getJobManager().find(this).length == 0) {
return true;
- } catch (OperationCanceledException e) {
- } catch (InterruptedException e) {
}
-
- // When the indexer job is interrupted, the join() above will throw an exception and that can
- // happen slightly before the JobManager updates its job collection. Wait for it.
- while (Job.getJobManager().find(this).length != 0) {
- if (System.currentTimeMillis() - startMillis > waitMaxMillis) {
- return false;
- }
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
+ synchronized (idleCondition) {
+ while (!idleCondition[0]) {
+ try {
+ if (monitor.isCanceled())
+ return false;
+ long t = System.currentTimeMillis();
+ if (t >= deadline)
+ return false;
+ idleCondition.wait(Math.min(100, deadline - t));
+ } catch (InterruptedException e) {
+ }
}
+ return true;
}
- return true;
} finally {
- // Make sure we don't leave the watchdog thread running
- if (th != null) {
- th.interrupt();
- }
+ Job.getJobManager().removeJobChangeListener(listener);
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
index 160d01cd05..f3af003451 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestBase.java
@@ -56,7 +56,7 @@ import org.eclipse.cdt.internal.ui.refactoring.CRefactoringContext;
* Common base for refactoring tests.
*/
public abstract class RefactoringTestBase extends BaseTestCase {
- private static final int INDEXER_TIMEOUT_SEC = 360;
+ private static final int INDEXER_TIMEOUT_SEC = 300;
protected static final NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
/** Allows empty files to be created during test setup. */
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
index 07005b227c..a61d122a55 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/BaseSelectionTestsIndexer.java
@@ -47,10 +47,12 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.testplugin.FileManager;
+import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
import org.eclipse.cdt.ui.testplugin.EditorTestHelper;
import org.eclipse.cdt.ui.tests.BaseUITestCase;
@@ -68,6 +70,7 @@ import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
* @author dsteffle
*/
public class BaseSelectionTestsIndexer extends BaseUITestCase {
+ protected static final int INDEXER_TIMEOUT_SEC = 20;
protected ICProject fCProject;
static FileManager fileManager = new FileManager();
IProgressMonitor monitor = new NullProgressMonitor();
@@ -90,7 +93,11 @@ public class BaseSelectionTestsIndexer extends BaseUITestCase {
public void waitForIndex(int maxSec) throws Exception {
assertTrue(CCorePlugin.getIndexManager().joinIndexer(maxSec * 1000, new NullProgressMonitor()));
}
-
+
+ protected void waitUntilFileIsIndexed(IIndex index, IFile file) throws Exception {
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
+ }
+
protected String getMessage(IStatus status) {
StringBuffer message = new StringBuffer("["); //$NON-NLS-1$
message.append(status.getMessage());
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java
index 9e307564bd..436afbe29c 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java
@@ -37,8 +37,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
* Test Ctrl-F3/F3 with the DOM Indexer for a C++ project.
*/
public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsIndexer {
- private static final int MAX_WAIT_TIME = 8000;
-
protected String sourceIndexerID;
protected IIndex index;
@@ -87,10 +85,6 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
assertEquals(loc.getNodeLength(), name.length());
}
- protected void waitUntilFileIsIndexed(IIndex index, IFile file, int maxmillis) throws Exception {
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
- }
-
// // header
// class Point{
// public:
@@ -124,7 +118,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("test93281.h", hcode);
IFile file = importFile("test93281.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset = scode.indexOf("p2->operator") + 6;
IASTNode node = testF3(file, offset);
@@ -166,7 +160,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("test.h", hcode);
IFile file = importFile("test.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("testTemplate");
int soffset = scode.indexOf("testTemplate");
@@ -192,7 +186,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("test.h", hcode);
IFile file = importFile("test.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("assign");
int soffset = scode.indexOf("assign");
@@ -223,7 +217,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("basicDefinition.h", hcode);
IFile file = importFile("testBasicDefinition.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("MyInt");
int soffset = scode.indexOf("MyInt");
@@ -304,7 +298,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBasicTemplateInstance.h", hcode);
IFile file = importFile("testBasicTemplateInstance.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("AAA");
int soffset = scode.indexOf("AAA<int>");
@@ -338,7 +332,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug86829A.h", hcode);
IFile file = importFile("testBug86829A.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset = scode.indexOf("X(2)");
int doffset= hcode.indexOf("X(int)");
@@ -370,7 +364,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug86829B.h", hcode);
IFile file = importFile("testBug86829B.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset = scode.indexOf("X(a)");
int doffset = hcode.indexOf("X()");
@@ -413,7 +407,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testCPPSpecDeclsDefs.h", hcode);
IFile file = importFile("testCPPSpecDeclsDefs.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset0= hcode.indexOf("a;");
int offset1= scode.indexOf("a;");
@@ -564,7 +558,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug168533.h", hcode);
IFile file = importFile("testBug168533.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset0= hcode.indexOf("d;");
int offset1= scode.indexOf("d;");
@@ -600,7 +594,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug95225.h", hcode);
IFile file = importFile("testBug95225.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -642,7 +636,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug95202.h", hcode);
IFile file = importFile("testBug95202.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -666,7 +660,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug101287.h", hcode);
IFile file = importFile("testBug101287.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -692,7 +686,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug102258.h", hcode);
IFile file = importFile("testBug102258.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -720,7 +714,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug103323.h", hcode);
IFile file = importFile("testBug103323.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -750,7 +744,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug78354.h", hcode);
IFile file = importFile("testBug78354.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -781,7 +775,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFileWithLink("testBug103697.h", hcode);
IFile file = importFileWithLink("testBug103697.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -808,7 +802,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug108202.h", hcode);
IFile file = importFile("testBug108202.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -840,7 +834,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
IFile hcppfile = importFile("cpp.h", hcppcode);
IFile cppfile = importFile("cpp.cpp", cppcode);
CCorePlugin.getIndexManager().reindex(fCProject);
- waitForIndex(MAX_WAIT_TIME);
+ waitForIndex(INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -875,7 +869,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug190730.h", hcode);
IFile file = importFile("testBug190730.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -901,7 +895,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testBug190730_2.h", hcode);
IFile file = importFile("testBug190730_2.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -929,7 +923,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("macrodef.h", hcode);
IFile file = importFile("macronavi.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -964,7 +958,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("macrodef.h", hcode);
IFile file = importFile("macronavi.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -993,7 +987,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testUndef_312399.h", hcode);
IFile file = importFile("testUndef_312399.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode target = testF3(file, scode.indexOf("MYMACRO"));
assertTrue(target instanceof IASTName);
@@ -1011,7 +1005,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("aheader.h", hcode);
IFile file = importFile("includenavi.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset0, offset1;
@@ -1037,7 +1031,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile cfile = importFile("s.c", ccode);
IFile cppfile = importFile("s.cpp", scode);
- waitUntilFileIsIndexed(index, cppfile, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, cppfile);
IASTNode decl;
int offset1, offset2;
@@ -1075,7 +1069,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile cfile = importFile("s.c", ccode);
IFile cppfile = importFile("s.cpp", scode);
- waitUntilFileIsIndexed(index, cppfile, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, cppfile);
IASTNode decl;
int offset1, offset2;
@@ -1108,7 +1102,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
StringBuilder[] buffers= getContents(1);
String code= buffers[0].toString();
IFile file = importFile("s.cpp", code);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode decl;
int offset1, offset2;
@@ -1139,7 +1133,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
StringBuilder[] buffers= getContents(1);
String code= buffers[0].toString();
IFile file = importFile("in.cpp", code);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset1 = code.indexOf("operator +");
int offset2 = code.indexOf("+ x;");
@@ -1180,7 +1174,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("test.h", hcode);
IFile file = importFile("test.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("operator+");
int soffset = scode.indexOf("+");
@@ -1199,7 +1193,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
public void testBug305487() throws Exception {
String code = getAboveComment();
IFile file = importFile("testBug305487.cpp", code);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int offset= code.indexOf("test(0)");
IASTNode def = testF3(file, offset + 1);
@@ -1226,7 +1220,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("testImplicitConstructorCall_248855.h", hcode);
IFile file = importFile("testImplicitConstructorCall_248855.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
IASTNode target = testF3(file, scode.indexOf("a1"));
assertTrue(target instanceof IASTName);
@@ -1264,7 +1258,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde
String scode= buffers[1].toString();
IFile hfile = importFile("test.h", hcode);
IFile file = importFile("test.cpp", scode);
- waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ waitUntilFileIsIndexed(index, file);
int hoffset= hcode.indexOf("func");
int offset = scode.indexOf("func()");
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
index 258264e862..42ebecbc22 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text.selection;
@@ -33,9 +33,6 @@ import org.eclipse.cdt.ui.testplugin.CTestPlugin;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexer {
-
- private static final int MAX_WAIT_TIME = 8000;
-
private String sourceIndexerID;
private IIndex index;
@@ -99,7 +96,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("basicDefinition.h", hcode);
IFile file = importFile("testBasicDefinition.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
int hoffset= hcode.indexOf("MyInt");
int soffset = scode.indexOf("MyInt");
@@ -181,7 +178,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("testCPPSpecDeclsDefs.h", hcode);
IFile file = importFile("testCPPSpecDeclsDefs.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
int offset0= hcode.indexOf("a;");
int offset1= scode.indexOf("a;");
@@ -293,7 +290,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("testBug101287.h", hcode);
IFile file = importFile("testBug101287.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -317,7 +314,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFileWithLink("testBug103697.h", hcode);
IFile file = importFileWithLink("testBug103697.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -345,7 +342,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("testBug78354.h", hcode);
IFile file = importFile("testBug78354.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -378,7 +375,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("testBug190730.h", hcode);
IFile file = importFile("testBug190730.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -404,7 +401,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("testBug190730_2.h", hcode);
IFile file = importFile("testBug190730_2.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -432,7 +429,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("macrodef.h", hcode);
IFile file = importFile("macronavi.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -465,7 +462,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("macrodef.h", hcode);
IFile file = importFile("macronavi.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -489,7 +486,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("aheader.h", hcode);
IFile file = importFile("includenavi.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -509,7 +506,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
String scode= buffers[1].toString();
IFile hfile = importFile("aheader.h", hcode);
IFile file = importFile("source.c", scode);
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl;
int offset0, offset1;
@@ -539,7 +536,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
IFile hfile = importFile("aheader.h", hcode);
IFile file = importFile("source.c", code);
int offset= code.indexOf("myFunc(0)");
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
IASTNode decl= testF3(file, offset);
assertTrue(decl instanceof IASTName);
@@ -555,8 +552,8 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe
IFile file = importFile("source.c", code);
int offset= code.indexOf("__LINE__");
- TestSourceReader.waitUntilFileIsIndexed(index, file, MAX_WAIT_TIME);
- // just make sure that no NPE is thrown.
+ TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000);
+ // Just make sure that no NPE is thrown.
testF3(file, offset);
}
}

Back to the top