fix test to properly check reachability

This commit is contained in:
Manu Sridharan 2012-12-17 20:38:17 -08:00
parent 1bf2c64ba7
commit dd98150ed8
2 changed files with 18 additions and 14 deletions

View File

@ -1,12 +1,16 @@
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] = function reachable1() { print("reachable"); };
a["0"]();
a[1.0]();
a[o]();
a[3]();
var b = [];
b[1] = function reachable2() { print("also reachable"); };
b[1.0]();
var c = [];
c[2] = function reachable3() { print("reachable, too"); };
var o = { toString: function() { return 2; } };
c[o]();
var d = [];
d["3"] = function reachable4() { print("reachable4"); };
d[3]();

View File

@ -581,10 +581,10 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
private static final Object[][] assertionsForArrayIndexConv = new Object[][] {
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:reachable3" } }
new Object[] { "tests/array_index_conv.js", new String[] { "suffix:reachable1",
"suffix:reachable2",
"suffix:reachable3",
"suffix:reachable4" } }
};
@Test