slightly more informative message regarding unreached methods
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@922 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
bea163df41
commit
016957c461
|
@ -261,6 +261,7 @@ public abstract class IRTests extends WalaTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void dumpIR(CallGraph cg, boolean assertReachable) throws IOException {
|
private static void dumpIR(CallGraph cg, boolean assertReachable) throws IOException {
|
||||||
|
Set unreachable = new HashSet();
|
||||||
WarningSet warnings = new WarningSet();
|
WarningSet warnings = new WarningSet();
|
||||||
ClassHierarchy cha = cg.getClassHierarchy();
|
ClassHierarchy cha = cg.getClassHierarchy();
|
||||||
IClassLoader sourceLoader = cha.getLoader(JavaSourceAnalysisScope.SOURCE_REF);
|
IClassLoader sourceLoader = cha.getLoader(JavaSourceAnalysisScope.SOURCE_REF);
|
||||||
|
@ -279,9 +280,7 @@ public abstract class IRTests extends WalaTestCase {
|
||||||
Iterator nodeIter = cg.getNodes(m.getReference()).iterator();
|
Iterator nodeIter = cg.getNodes(m.getReference()).iterator();
|
||||||
if (!nodeIter.hasNext()) {
|
if (!nodeIter.hasNext()) {
|
||||||
Trace.println("Method " + m.getReference() + " not reachable?");
|
Trace.println("Method " + m.getReference() + " not reachable?");
|
||||||
if (assertReachable) {
|
unreachable.add( m );
|
||||||
Assert.assertTrue(m.toString(), nodeIter.hasNext());
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CGNode node = (CGNode) nodeIter.next();
|
CGNode node = (CGNode) nodeIter.next();
|
||||||
|
@ -289,6 +288,10 @@ public abstract class IRTests extends WalaTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (assertReachable) {
|
||||||
|
Assert.assertTrue(unreachable.toString(), unreachable.isEmpty());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkCallGraphShape(CallGraph callGraph, GraphAssertions ga) throws IOException {
|
private static void checkCallGraphShape(CallGraph callGraph, GraphAssertions ga) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue