mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Testcase for updating file-local types.
This commit is contained in:
parent
aad1b851fb
commit
f5785de8fe
1 changed files with 26 additions and 0 deletions
|
@ -49,6 +49,7 @@ import org.eclipse.cdt.core.index.IndexFilter;
|
|||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
||||
import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMFile;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -1264,4 +1265,29 @@ public class IndexUpdateTests extends IndexTestBase {
|
|||
fIndex.releaseReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
// class X {};
|
||||
|
||||
// class X {};
|
||||
public void testFileLocalBinding() throws Exception {
|
||||
setupFile(2, true);
|
||||
long id1, id2;
|
||||
fIndex.acquireReadLock();
|
||||
try {
|
||||
final IIndexBinding binding = findBinding("X");
|
||||
id1= ((PDOMFile) binding.getLocalToFile()).getRecord();
|
||||
} finally {
|
||||
fIndex.releaseReadLock();
|
||||
}
|
||||
|
||||
updateFile();
|
||||
fIndex.acquireReadLock();
|
||||
try {
|
||||
final IIndexBinding binding = findBinding("X");
|
||||
id2= ((PDOMFile) binding.getLocalToFile()).getRecord();
|
||||
} finally {
|
||||
fIndex.releaseReadLock();
|
||||
}
|
||||
assertEquals(id1, id2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue