fix leak tests

This commit is contained in:
peter
2015-11-11 21:57:05 +01:00
parent a9dc93b41c
commit 6ce71b11e2
3 changed files with 6 additions and 5 deletions
@@ -60,7 +60,8 @@ class AstLeaksTest extends LightCodeInsightFixtureTestCase {
def sup = myFixture.addFileToProject('sup.java', 'class Super { Super() {} }')
assert sup.findElementAt(0) // load AST
assert !((PsiFileImpl)sup).stub
LeakHunter.checkLeak(sup, MethodElement)
LeakHunter.checkLeak(sup, MethodElement, { it.psi.containingFile == sup } as Processor)
def foo = myFixture.addFileToProject('a.java', 'class Foo extends Super { void bar() { bar(); } }')
myFixture.configureFromExistingVirtualFile(foo.virtualFile)
@@ -69,8 +70,8 @@ class AstLeaksTest extends LightCodeInsightFixtureTestCase {
assert !((PsiFileImpl)foo).stub
assert ((PsiFileImpl)foo).treeElement
LeakHunter.checkLeak(foo, MethodElement)
LeakHunter.checkLeak(sup, MethodElement)
LeakHunter.checkLeak(foo, MethodElement, { it.psi.containingFile == foo } as Processor)
LeakHunter.checkLeak(sup, MethodElement, { it.psi.containingFile == sup } as Processor)
}
public void "test no hard refs to Default File Template inspection internal AST"() {
@@ -344,7 +344,7 @@ public class FileStatusMap implements Disposable {
@Override
public <T> T getUserData(@NotNull Key<T> key) {
throw new UnsupportedOperationException();
return null;
}
@Override
@@ -50,7 +50,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase {
FileDocumentManager.getInstance().saveAllDocuments();
UIUtil.dispatchAllInvocationEvents();
LeakHunter.checkLeak(usageView, PsiFileImpl.class);
LeakHunter.checkLeak(usageView, PsiFileImpl.class, PsiFileImpl::isPhysical);
LeakHunter.checkLeak(usageView, Document.class);
}