Remove parallelarray tests.

This commit is contained in:
David Anderson 2012-08-10 15:49:43 -07:00
parent a86553e6e6
commit 64aae39e91
20 changed files with 0 additions and 181 deletions

View File

@ -1,10 +0,0 @@
function combineArray() {
var p = new ParallelArray([0,1,2,3,4]);
var a = [1,2,3,4,5];
var r = p.combine(function (idx) { return this[idx] + a[idx];});
assertEq(r.toString(), [1,3,5,7,9].join(","));
}
combineArray();

View File

@ -1,10 +0,0 @@
function combineParallelArray() {
var p = new ParallelArray([0,1,2,3,4]);
var a = new ParallelArray([1,2,3,4,5]);
var r = p.combine(function (idx) { return this[idx] + a[idx];});
assertEq(r.toString(), [1,3,5,7,9].join(","));
}
combineParallelArray();

View File

@ -1,9 +0,0 @@
function buildComprehension() {
var p = new ParallelArray(10, function (idx) { return idx;});
var a = [0,1,2,3,4,5,6,7,8,9];
// correct result
assertEq(p.toString(),a.join(","));
}
buildComprehension();

View File

@ -1,13 +0,0 @@
function buildWithHoles() {
var a = new Array(5);
for (var cnt = 0; cnt < a.length; cnt+=2) {
a[cnt] = cnt;
}
var b = [0,1,2,3,4];
var p = new ParallelArray(a);
// check no holes
assertEq(Object.keys(p).join(","), Object.keys(b).join(","));
}
buildWithHoles();

View File

@ -1,13 +0,0 @@
function buildSimple() {
var a = [1,2,3,4,5];
var p = new ParallelArray(a);
var e = a.join(",");
// correct result
assertEq(p.toString(),e);
a[0] = 9;
// no sharing
assertEq(p.toString(),e);
}
buildSimple();

View File

@ -1,9 +0,0 @@
function testFilterAll() {
var even = function (i) { return (i%2 === 0); };
var p = new ParallelArray([0,1,2,3,4]);
var r = p.filter(even);
assertEq(r.toString(), [0,2,4].join(","));
}
testFilterAll();

View File

@ -1,9 +0,0 @@
function testFilterNone() {
var none = function () { return false; };
var p = new ParallelArray([0,1,2,3,4]);
var r = p.filter(none);
assertEq(r.toString(), "");
}
testFilterNone();

View File

@ -1,9 +0,0 @@
function testFilterSome() {
var evenBelowThree = function (i) { return ((i%2) === 0) && (i < 3); };
var p = new ParallelArray([0,1,2,3,4]);
var r = p.filter(evenBelowThree);
assertEq(r.toString(), [0,2].join(","));
}
testFilterSome();

View File

@ -1,8 +0,0 @@
function GetOwnProperyDescriptor() {
var p = new ParallelArray([9]);
assertEq(Object.getOwnPropertyDescriptor(p, "length").toSource(), {configurable:false, enumerable:false, value:1, writable:false}.toSource());
assertEq(Object.getOwnPropertyDescriptor(p, "0").toSource(), {configurable:false, enumerable:true, value:9, writable:false}.toSource());
}
GetOwnProperyDescriptor();

View File

@ -1,8 +0,0 @@
function testMapExtras() {
var p = new ParallelArray([0,1,2,3,4]);
var m = p.map(function (v, e) { return v+e; }, [1,2,3,4,5]);
assertEq(m.toString(), [1,3,5,7,9].join(","));
}
testMapExtras();

View File

@ -1,8 +0,0 @@
function testMap() {
var p = new ParallelArray([0,1,2,3,4]);
var m = p.map(function (v) { return v+1; });
assertEq(m.toString(), [1,2,3,4,5].join(","));
}
testMap();

View File

@ -1,8 +0,0 @@
function testReduceNone() {
var p = new ParallelArray([]);
var r = p.reduce(function (v, p) { return v*p; });
assertEq(r, undefined);
}
testReduceNone();

View File

@ -1,8 +0,0 @@
function testReduceOne() {
var p = new ParallelArray([1]);
var r = p.reduce(function (v, p) { return v*p; });
assertEq(r, 1);
}
testReduceOne();

View File

@ -1,8 +0,0 @@
function testReduce() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.reduce(function (v, p) { return v*p; });
assertEq(r, 120);
}
testReduce();

View File

@ -1,9 +0,0 @@
// |jit-test| error: Error;
function testScatterBounds() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,2,11]);
}
testScatterBounds();

View File

@ -1,8 +0,0 @@
function testScatterConflict() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,1,0,3,4], 9, function (a,b) { return a+b; });
assertEq(r.toString(),[4,2,9,4,5].join(","));
}
testScatterConflict();

View File

@ -1,8 +0,0 @@
// |jit-test| error: Error;
function testScatterConflictFail() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,1,0,3,4], 9); // should fail
}
testScatterConflictFail();

View File

@ -1,9 +0,0 @@
function testScatterDefault() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,2,4], 9);
assertEq(r.toString(),[1,9,2,9,3].join(","));
}
testScatterDefault();

View File

@ -1,9 +0,0 @@
function testScatterIdentity() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,1,2,3,4]);
assertEq(p.toString(),r.toString());
}
testScatterIdentity();

View File

@ -1,8 +0,0 @@
function testScatterLength() {
var p = new ParallelArray([1,2,3,4,5]);
var r = p.scatter([0,1,0,3,4], 9, function (a,b) { return a+b; }, 10);
assertEq(r.length,10);
}
testScatterLength();