michael@0: if (!getBuildConfiguration().parallelJS) michael@0: quit(0); michael@0: michael@0: function testReduce() { michael@0: function sum(a, b) { michael@0: var r = a + b; michael@0: } michael@0: var array = build(8 * 0X0aaec , function() { return 1; }); michael@0: var parResult = array.reducePar(sum); michael@0: } michael@0: for (var ix = 0; ix < 3; ++ix) { michael@0: testReduce(); michael@0: } michael@0: function build(n, f) { michael@0: var result = []; michael@0: for (var i = 0; i < n; i++) michael@0: result.push(f(i)); michael@0: return result; michael@0: } michael@0: function seq_scan(array, f) { michael@0: for (var i = 1; i < array.length; i++) { michael@0: } michael@0: } michael@0: function assertAlmostEq(v1, v2) { michael@0: if (e1 instanceof Array && e2 instanceof Array) { michael@0: for (prop in e1) { michael@0: if (e1.hasOwnProperty(prop)) { } michael@0: } michael@0: } michael@0: } michael@0: function assertEqArray(a, b) { michael@0: for (var i = 0, l = a.length; i < l; i++) { michael@0: try { } catch (e) { } michael@0: } michael@0: } michael@0: function assertParallelExecWillRecover(opFunction) { michael@0: assertParallelExecSucceeds( michael@0: function(m) {}, michael@0: function(r) {} michael@0: ); michael@0: }