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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-10-02 16:52:20 -07:00
parent bd624aeb0c
commit 419eca0c3f
3 changed files with 29 additions and 36 deletions

View file

@ -48,8 +48,8 @@ public class IndexIncludeTest extends IndexTestBase {
return suite; return suite;
} }
private ICProject fProject= null; private ICProject fProject;
private IIndex fIndex= null; private IIndex fIndex;
public IndexIncludeTest(String name) { public IndexIncludeTest(String name) {
super(name); super(name);
@ -61,8 +61,8 @@ public class IndexIncludeTest extends IndexTestBase {
if (fProject == null) { if (fProject == null) {
fProject= createProject(true, "resources/indexTests/includes"); fProject= createProject(true, "resources/indexTests/includes");
IPathEntry[] entries= new IPathEntry[] { IPathEntry[] entries= new IPathEntry[] {
CoreModel.newIncludeEntry(fProject.getPath(), CoreModel.newIncludeEntry(fProject.getPath(), null,
null, fProject.getResource().getLocation())}; fProject.getResource().getLocation()) };
fProject.setRawPathEntries(entries, npm()); fProject.setRawPathEntries(entries, npm());
} }
fIndex= CCorePlugin.getIndexManager().getIndex(fProject); fIndex= CCorePlugin.getIndexManager().getIndex(fProject);
@ -446,7 +446,6 @@ public class IndexIncludeTest extends IndexTestBase {
source[0].toString() + "\nint h20070427;"); source[0].toString() + "\nint h20070427;");
TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME); TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
standardCheckUpdateIncludes(header, s1, "h20070427"); standardCheckUpdateIncludes(header, s1, "h20070427");
} }
private void standardCheckUpdateIncludes(IFile header, IFile s1, String tag) throws Exception { private void standardCheckUpdateIncludes(IFile header, IFile s1, String tag) throws Exception {

View file

@ -8,7 +8,6 @@
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.index.tests; package org.eclipse.cdt.internal.index.tests;
import java.io.IOException; import java.io.IOException;
@ -129,8 +128,7 @@ public class IndexNamesTests extends BaseTestCase {
enclosing= enclosed[1].getEnclosingDefinition(); enclosing= enclosed[1].getEnclosingDefinition();
assertNotNull(enclosing); assertNotNull(enclosing);
assertName("main", enclosing); assertName("main", enclosing);
} } finally {
finally {
fIndex.releaseReadLock(); fIndex.releaseReadLock();
} }
} }
@ -223,8 +221,7 @@ public class IndexNamesTests extends BaseTestCase {
enclosing= enclosed[2].getEnclosingDefinition(); enclosing= enclosed[2].getEnclosingDefinition();
assertNotNull(enclosing); assertNotNull(enclosing);
assertName("func", enclosing); assertName("func", enclosing);
} } finally {
finally {
fIndex.releaseReadLock(); fIndex.releaseReadLock();
} }
} }
@ -274,8 +271,7 @@ public class IndexNamesTests extends BaseTestCase {
assertEquals(couldbepolymorphic[j], indexName.couldBePolymorphicMethodCall()); assertEquals(couldbepolymorphic[j], indexName.couldBePolymorphicMethodCall());
assertEquals(container[j], CPPVisitor.getQualifiedName(fIndex.findBinding(indexName))[0]); assertEquals(container[j], CPPVisitor.getQualifiedName(fIndex.findBinding(indexName))[0]);
j++; j++;
} } else {
else {
assertEquals(false, indexName.couldBePolymorphicMethodCall()); assertEquals(false, indexName.couldBePolymorphicMethodCall());
} }
} }
@ -285,7 +281,6 @@ public class IndexNamesTests extends BaseTestCase {
} }
} }
// int _i, ri, wi, rwi; // int _i, ri, wi, rwi;
// int* rp; int* wp; int* rwp; // int* rp; int* wp; int* rwp;
// const int* cip= &ri; // const int* cip= &ri;
@ -339,14 +334,12 @@ public class IndexNamesTests extends BaseTestCase {
assertEquals("Read access for " + msg, isRead, indexName.isReadAccess()); assertEquals("Read access for " + msg, isRead, indexName.isReadAccess());
assertEquals("Write access for " + msg, isWrite, indexName.isWriteAccess()); assertEquals("Write access for " + msg, isWrite, indexName.isWriteAccess());
j++; j++;
} } else {
else {
assertEquals(false, indexName.couldBePolymorphicMethodCall()); assertEquals(false, indexName.couldBePolymorphicMethodCall());
} }
} }
assertEquals(count, j); assertEquals(count, j);
} } finally {
finally {
fIndex.releaseReadLock(); fIndex.releaseReadLock();
} }
} }

View file

@ -155,7 +155,8 @@ public class BaseUITestCase extends BaseTestCase {
protected void runEventQueue(int time) { protected void runEventQueue(int time) {
final long endTime= System.currentTimeMillis() + time; final long endTime= System.currentTimeMillis() + time;
while (true) { while (true) {
while (Display.getCurrent().readAndDispatch()); while (Display.getCurrent().readAndDispatch())
;
long diff= endTime - System.currentTimeMillis(); long diff= endTime - System.currentTimeMillis();
if (diff <= 0) { if (diff <= 0) {
break; break;