diff options
author | Sergey Prigogin | 2011-10-17 21:22:14 +0000 |
---|---|---|
committer | Sergey Prigogin | 2011-10-17 21:22:14 +0000 |
commit | 4e65505eba8f70fd8f114fbda81a1cae41223c53 (patch) | |
tree | 3f4682c2a07e1731a4ef362c0ee840a59534773b | |
parent | d335475bd0446a6ec295624e2ab6b83d826e1481 (diff) | |
download | org.eclipse.cdt-4e65505eba8f70fd8f114fbda81a1cae41223c53.tar.gz org.eclipse.cdt-4e65505eba8f70fd8f114fbda81a1cae41223c53.tar.xz org.eclipse.cdt-4e65505eba8f70fd8f114fbda81a1cae41223c53.zip |
Removed use of a deprecated method.
-rw-r--r-- | core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java index 1a6929db213..da46316999e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * QNX - Initial API and implementation - * Markus Schorn (Wind River Systems) + * QNX - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.pdom.tests; @@ -183,6 +183,11 @@ public class DefDeclTests extends PDOMTestBase { checkReference(binding, "ref" + testNum, ref); } + private IIndexFile getSingleFile(IIndexFileLocation ifl) throws CoreException { + IIndexFile[] files= pdom.getFiles(ILinkage.C_LINKAGE_ID, ifl); + assertEquals(1, files.length); + return files[0]; + } /* ------------------ Tests Started Here ------------------------ */ public void testInit() { // will fail if setUp fails, maybe timelimit is too small for warm-up @@ -237,7 +242,7 @@ public class DefDeclTests extends PDOMTestBase { String elName = "foo" + "08"; IIndexFileLocation ifl= IndexLocationFactory.getIFL((ITranslationUnit) cproject.findElement(new Path("func.c"))); - IIndexFile file= pdom.getFile(ILinkage.C_LINKAGE_ID, ifl); + IIndexFile file= getSingleFile(ifl); int offset= TestSourceReader.indexOfInFile("foo08();", new Path(ifl.getFullPath())); IIndexName[] names= file.findNames(offset, 5); assertEquals(1, names.length); @@ -249,7 +254,7 @@ public class DefDeclTests extends PDOMTestBase { // check the other file ifl= IndexLocationFactory.getIFL((ITranslationUnit) cproject.findElement(new Path("second.c"))); - file= pdom.getFile(ILinkage.C_LINKAGE_ID, ifl); + file= getSingleFile(ifl); offset= TestSourceReader.indexOfInFile("foo08();", new Path(ifl.getFullPath())); names= file.findNames(offset, 5); assertEquals(1, names.length); |