Reviewers: Kevin Millikin, Description: Speed up two unit tests to avoid timeouts and make tests finish faster.
Please review this at https://chromiumcodereview.appspot.com/9309118/ SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M test/mjsunit/array-join.js M test/mjsunit/string-replace-one-char.js Index: test/mjsunit/array-join.js =================================================================== --- test/mjsunit/array-join.js (revision 10596) +++ test/mjsunit/array-join.js (working copy) @@ -75,10 +75,10 @@ Array.prototype.toString = oldToString; } -var a = new Array(123123123); -assertEquals(123123122, String(a).length); -assertEquals(123123122, a.join(",").length); -assertEquals(246246244, a.join("oo").length); +var a = new Array(123123); +assertEquals(123122, String(a).length); +assertEquals(123122, a.join(",").length); +assertEquals(246244, a.join("oo").length); a = new Array(Math.pow(2,32) - 1); // Max length. assertEquals("", a.join("")); @@ -90,4 +90,4 @@ for (var i = 0; i < a.length; i++) a[i] = undefined; a[5] = "ab"; a[90000] = "cd"; -assertEquals("abcd", a.join("")); // Must not throw. \ No newline at end of file +assertEquals("abcd", a.join("")); // Must not throw. Index: test/mjsunit/string-replace-one-char.js =================================================================== --- test/mjsunit/string-replace-one-char.js (revision 10596) +++ test/mjsunit/string-replace-one-char.js (working copy) @@ -71,13 +71,13 @@ // Deep cons tree. var nested_1 = ""; -for (var i = 0; i < 1000000; i++) nested_1 += "y"; +for (var i = 0; i < 100000; i++) nested_1 += "y"; var nested_1_result = prefix1024 + nested_1 + "aa"; nested_1 = prefix1024 + nested_1 + "z"; test_replace(nested_1, nested_1_result, "z", "aa"); var nested_2 = "\u2244"; -for (var i = 0; i < 1000000; i++) nested_2 += "y"; +for (var i = 0; i < 100000; i++) nested_2 += "y"; var nested_2_result = prefix1024 + nested_2 + "aa"; nested_2 = prefix1024 + nested_2 + "\u2012"; test_replace(nested_2, nested_2_result, "\u2012", "aa"); -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
