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

Fixes a test-failure.

This commit is contained in:
Markus Schorn 2009-01-13 13:13:41 +00:00
parent ea9f24215d
commit 98d291ebd4

View file

@ -16,6 +16,7 @@ import junit.framework.Test;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.cdt.core.CCorePlugin;
@ -179,9 +180,9 @@ public class CompletionTests_PlainC extends AbstractContentAssistTest {
sourceContent.delete(fCursorOffset, fCursorOffset+CURSOR_LOCATION_TAG.length());
assertNotNull(createFile(project, HEADER_FILE_NAME, headerContent));
IFile sourceFile= createFile(project, SOURCE_FILE_NAME, sourceContent.toString());
// for some unknown reason re-indexing is necessary,
// otherwise tests fail at random
// re-indexing is necessary to parse the header in context of the source.
CCorePlugin.getIndexManager().reindex(fCProject);
CCorePlugin.getIndexManager().joinIndexer(4000, new NullProgressMonitor());
return sourceFile;
}