mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix testRepeatedlyChangeConfig_bug375226 so its failure won't break all subsequent indexer tests
This commit is contained in:
parent
9b764dddbd
commit
8f8ad163a5
1 changed files with 9 additions and 6 deletions
|
@ -104,14 +104,17 @@ public class ChangeConfigurationTests extends PDOMTestBase {
|
||||||
Pattern testFunc2 = Pattern.compile("testFunc2");
|
Pattern testFunc2 = Pattern.compile("testFunc2");
|
||||||
int i = 0, noTrials = 50;
|
int i = 0, noTrials = 50;
|
||||||
do {
|
do {
|
||||||
|
boolean isFirstConfig = i % 2 == 0;
|
||||||
IIndex index = CCorePlugin.getIndexManager().getIndex(cProject);
|
IIndex index = CCorePlugin.getIndexManager().getIndex(cProject);
|
||||||
index.acquireReadLock();
|
index.acquireReadLock();
|
||||||
boolean isFirstConfig = i % 2 == 0;
|
try {
|
||||||
IBinding[] bindings = index.findBindings(isFirstConfig ? testFunc1 : testFunc2, true, IndexFilter.ALL, new NullProgressMonitor());
|
IBinding[] bindings = index.findBindings(isFirstConfig ? testFunc1 : testFunc2, true, IndexFilter.ALL, new NullProgressMonitor());
|
||||||
IBinding[] noBindings = index.findBindings(isFirstConfig ? testFunc2 : testFunc1, true, IndexFilter.ALL, new NullProgressMonitor());
|
IBinding[] noBindings = index.findBindings(isFirstConfig ? testFunc2 : testFunc1, true, IndexFilter.ALL, new NullProgressMonitor());
|
||||||
assertEquals(1, bindings.length);
|
assertEquals(1, bindings.length);
|
||||||
assertEquals(0, noBindings.length);
|
assertEquals(0, noBindings.length);
|
||||||
|
} finally {
|
||||||
index.releaseReadLock();
|
index.releaseReadLock();
|
||||||
|
}
|
||||||
|
|
||||||
String nextConfig = isFirstConfig ? secondConfigName : firstConfigName;
|
String nextConfig = isFirstConfig ? secondConfigName : firstConfigName;
|
||||||
changeProjectConfiguration(project, nextConfig);
|
changeProjectConfiguration(project, nextConfig);
|
||||||
|
|
Loading…
Add table
Reference in a new issue