strengthen checking of argument specialization test

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4533 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
dolby-oss 2012-02-23 18:15:05 +00:00
parent 9b2b4c6f51
commit 99564d6e06
3 changed files with 10 additions and 4 deletions

View File

@ -20,5 +20,9 @@ function z() {
print("z");
}
function wrong() {
print("wrong");
}
a(x);
a(y, z);
a(y, z, wrong);

View File

@ -27,7 +27,7 @@ public abstract class TestArgumentSensitivity extends TestJSCallGraphShape {
"tests/args.js",
new String[] { "tests/args.js/a" } },
new Object[] { "tests/args.js/a", new String[] { "tests/args.js/x"} },
new Object[] { "tests/args.js/a", new String[] { "tests/args.js/y", "tests/args.js/z" } } };
new Object[] { "tests/args.js/a", new String[] { "tests/args.js/y", "tests/args.js/z", "!tests/args.js/wrong" } } };
@Test public void testArgs() throws IOException, IllegalArgumentException, CancelException, ClassHierarchyException {
JavaScriptLoaderFactory loaders = JSCallGraphBuilderUtil.makeLoaders();

View File

@ -135,8 +135,10 @@ public abstract class TestCallGraphShape extends WalaTestCase {
CallSiteReference sr = (CallSiteReference) sites.next();
Iterator dsts = getNodes(CG, targetName).iterator();
Assert.assertTrue("cannot find " + targetName, dsts.hasNext());
if (! checkAbsence) {
Assert.assertTrue("cannot find " + targetName, dsts.hasNext());
}
while (dsts.hasNext()) {
CGNode dst = (CGNode) dsts.next();
for (Iterator tos = CG.getPossibleTargets(src, sr).iterator(); tos.hasNext();) {