Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-10-04 17:11:06 +0000
committerSergey Prigogin2011-10-04 17:11:06 +0000
commit6593f1f8cf9e1b02aae0fe9509ccb30b149c19ff (patch)
tree4a7f6f4d68c05b27099da3d9bf360f85535baf33
parent24864f8821c7c1819708e5d141f091e9a52afa88 (diff)
downloadorg.eclipse.cdt-6593f1f8cf9e1b02aae0fe9509ccb30b149c19ff.tar.gz
org.eclipse.cdt-6593f1f8cf9e1b02aae0fe9509ccb30b149c19ff.tar.xz
org.eclipse.cdt-6593f1f8cf9e1b02aae0fe9509ccb30b149c19ff.zip
Removed a redundant test.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java61
1 files 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);

Back to the top