From 6593f1f8cf9e1b02aae0fe9509ccb30b149c19ff Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 4 Oct 2011 10:11:06 -0700 Subject: [PATCH] Removed a redundant test. --- .../index/tests/IndexIncludeTest.java | 61 +------------------ 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java index eb87b4b1215..2569088d8c9 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java @@ -64,6 +64,7 @@ public class IndexIncludeTest extends IndexTestBase { CoreModel.newIncludeEntry(fProject.getPath(), null, fProject.getResource().getLocation()) }; fProject.setRawPathEntries(entries, npm()); + IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false"); } fIndex= CCorePlugin.getIndexManager().getIndex(fProject); } @@ -471,8 +472,7 @@ public class IndexIncludeTest extends IndexTestBase { // #include "h1.h" // #include "h2.h" - public void testMultiVariantHeaderUpdate_1() throws Exception { - IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false"); + public void testMultiVariantHeaderUpdate() throws Exception { waitForIndexer(); TestScannerProvider.sIncludes= new String[] { fProject.getProject().getLocation().toOSString() }; StringBuilder[] contents= getContentsForTest(4); @@ -519,62 +519,6 @@ public class IndexIncludeTest extends IndexTestBase { } } - // static const int X = 0; - - // #define X a - // #include "h1.h" - // #undef X - // #define X b - // #include "h1.h" - - // #define X c - // #include "h1.h" - - // #include "h2.h" - public void testMultiVariantHeaderUpdate_2() throws Exception { - IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false"); - waitForIndexer(); - TestScannerProvider.sIncludes= new String[] { fProject.getProject().getLocation().toOSString() }; - StringBuilder[] contents= getContentsForTest(4); - final StringBuilder h1Contents = contents[0]; - final IFile h1= TestSourceReader.createFile(fProject.getProject(), "h1.h", h1Contents.toString()); - IFile h2= TestSourceReader.createFile(fProject.getProject(), "h2.h", contents[1].toString()); - IFile s1= TestSourceReader.createFile(fProject.getProject(), "s1.cpp", contents[2].toString()); - IFile s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", contents[3].toString()); - TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME); - TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_WAIT_TIME); - - fIndex.acquireReadLock(); - try { - IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1)); - assertEquals(3, indexFiles.length); - } finally { - fIndex.releaseReadLock(); - } - - final long timestamp= System.currentTimeMillis(); - int pos = h1Contents.indexOf("int"); - h1Contents.replace(pos, pos + "int".length(), "float"); - ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - h1.setContents(new ByteArrayInputStream(h1Contents.toString().getBytes()), false, false, npm()); - h1.setLocalTimeStamp(timestamp + 1000); - } - }, npm()); - waitForIndexer(); - - fIndex.acquireReadLock(); - try { - IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1)); - assertEquals(3, indexFiles.length); - for (IIndexFile indexFile : indexFiles) { - assertTrue("Timestamp not ok", indexFile.getTimestamp() >= timestamp); - } - } finally { - fIndex.releaseReadLock(); - } - } - // #ifdef A // static const int a = 0; // #endif @@ -610,7 +554,6 @@ public class IndexIncludeTest extends IndexTestBase { // #endif // #endif // H1_H_ public void testPragmaOnceChange() throws Exception { - IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false"); waitForIndexer(); TestScannerProvider.sIncludes= new String[] { fProject.getProject().getLocation().toOSString() }; CharSequence[] contents= getContentsForTest(5);