From 1bf2c64ba707868fa0f05241ffea1bd8289a581f Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Mon, 17 Dec 2012 16:52:31 -0800 Subject: [PATCH] add an array test that doesn't quite work --- .../examples-src/tests/array_index_conv.js | 4 +++- .../com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/com.ibm.wala.cast.js.test.data/examples-src/tests/array_index_conv.js b/com.ibm.wala.cast.js.test.data/examples-src/tests/array_index_conv.js index 898f50ce8..69ddbf3a0 100644 --- a/com.ibm.wala.cast.js.test.data/examples-src/tests/array_index_conv.js +++ b/com.ibm.wala.cast.js.test.data/examples-src/tests/array_index_conv.js @@ -2,9 +2,11 @@ var a = []; a[0] = function reachable() { print("reachable"); }; a[1] = function also_reachable() { print("also reachable"); }; a[2] = function reachable_too() { print("reachable, too"); }; +a["3"] = function reachable3() { print("reachable3"); }; var o = { toString: function() { return 2; } }; a["0"](); a[1.0](); -a[o](); \ No newline at end of file +a[o](); +a[3](); \ No newline at end of file diff --git a/com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java b/com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java index b2df1de5c..0562b8256 100755 --- a/com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java +++ b/com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java @@ -19,6 +19,7 @@ import junit.framework.Assert; import org.junit.Test; +import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil; import com.ibm.wala.cast.js.ipa.callgraph.ForInContextSelector; import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder; import com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil; @@ -582,7 +583,8 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape { new Object[] { ROOT, new String[] { "tests/array_index_conv.js" } }, new Object[] { "tests/array_index_conv.js", new String[] { "suffix:reachable", "suffix:also_reachable", - "suffix:reachable_too" } } + "suffix:reachable_too", + "suffix:reachable3" } } }; @Test @@ -608,6 +610,7 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape { verifyGraphAssertions(cg, assertionsForArrayIndexConv2); } + protected IVector>> computeIkIdToVns(PointerAnalysis pa) { // Created by reversing the points to mapping for local pointer keys.