restructure to allow CGNodes to dwell in more than one CallGraph. lift some functions up from CGNode to CallGraph

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1419 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-07-11 16:24:39 +00:00
parent fa0c9d98b4
commit 67d3540b59
2 changed files with 20 additions and 17 deletions

View File

@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.ibm.wala.cast.test"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.test"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.wala.cast.test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.ibm.wala.cast.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.test"/>
</launchConfiguration>

View File

@ -71,10 +71,8 @@ public abstract class TestCallGraphShape extends WalaTestCase {
for (int i = 0; i < assertionData.length; i++) {
check_target: for (int j = 0; j < ((String[]) assertionData[i][1]).length; j++) {
Iterator srcs =
(assertionData[i][0] instanceof String) ?
getNodes(CG, (String) assertionData[i][0]).iterator():
new NonNullSingletonIterator<CGNode>(CG.getFakeRootNode());
Iterator srcs = (assertionData[i][0] instanceof String) ? getNodes(CG, (String) assertionData[i][0]).iterator()
: new NonNullSingletonIterator<CGNode>(CG.getFakeRootNode());
Assert.assertTrue("cannot find " + assertionData[i][0], srcs.hasNext());
@ -83,13 +81,12 @@ public abstract class TestCallGraphShape extends WalaTestCase {
for (Iterator sites = src.iterateSites(); sites.hasNext();) {
CallSiteReference sr = (CallSiteReference) sites.next();
Iterator dsts =
getNodes(CG, ((String[]) assertionData[i][1])[j]).iterator();
Iterator dsts = getNodes(CG, ((String[]) assertionData[i][1])[j]).iterator();
Assert.assertTrue("cannot find " + ((String[]) assertionData[i][1])[j], dsts.hasNext());
while (dsts.hasNext()) {
CGNode dst = (CGNode) dsts.next();
for (Iterator tos = src.getPossibleTargets(sr).iterator(); tos.hasNext();) {
for (Iterator tos = CG.getPossibleTargets(src, sr).iterator(); tos.hasNext();) {
if (tos.next().equals(dst)) {
Trace.println("found expected " + src + " --> " + dst + " at " + sr);
continue check_target;