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

Removed a redundant test.

This commit is contained in:
Sergey Prigogin 2011-10-04 10:11:06 -07:00
parent 24864f8821
commit 6593f1f8cf

View file

@ -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);