From 2b1d82d1bbe705d703357fb3ae3e31dacab586c9 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Thu, 19 Jul 2018 18:17:59 +0200 Subject: [PATCH] Expand missing super test --- .../ibm/wala/core/tests/cha/MissingSuperTest.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/MissingSuperTest.java b/com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/MissingSuperTest.java index 20f13d182..1266f9496 100644 --- a/com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/MissingSuperTest.java +++ b/com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/cha/MissingSuperTest.java @@ -12,6 +12,7 @@ package com.ibm.wala.core.tests.cha; import com.ibm.wala.classLoader.IClass; import com.ibm.wala.classLoader.IMethod; +import com.ibm.wala.classLoader.PhantomClass; import com.ibm.wala.core.tests.util.TestConstants; import com.ibm.wala.core.tests.util.WalaTestCase; import com.ibm.wala.ipa.callgraph.AnalysisCacheImpl; @@ -61,6 +62,15 @@ public class MissingSuperTest extends WalaTestCase { // should succeed cache.getIR(m); } - + // there should be one PhantomClass in the Application class loader + boolean found = false; + for (IClass klass2: cha) { + if (klass2 instanceof PhantomClass && klass2.getReference().getClassLoader().equals + (ClassLoaderReference.Application)) { + Assert.assertEquals("Lmissingsuper/Super", klass2.getReference().getName().toString()); + found = true; + } + } + Assert.assertTrue(found); } }