Commit a2fae346 authored by Jim Kang's avatar Jim Kang
Browse files

Updated quadtree tests to check the `nodes` property of the node (a...

Updated quadtree tests to check the `nodes` property of the node (a d3_geom_quadtreeNode) instead of treating the node as an array (which it is not) and trying to check indexes within it. e.g. `node[2]`.
parent e4d5da3d
......@@ -29,10 +29,10 @@ suite.addBatch({
n = 0;
q.visit(function(node, x1, y1, x2, y2) {
assert.deepEqual(node.point, point);
assert.isUndefined(node[0]);
assert.isUndefined(node[1]);
assert.isUndefined(node[2]);
assert.isUndefined(node[3]);
assert.isUndefined(node.nodes[0]);
assert.isUndefined(node.nodes[1]);
assert.isUndefined(node.nodes[2]);
assert.isUndefined(node.nodes[3]);
assert.isTrue(node.leaf);
++n;
});
......@@ -46,10 +46,10 @@ suite.addBatch({
n = 0;
q.visit(function(node, x1, y1, x2, y2) {
assert.deepEqual(node.point, point);
assert.isUndefined(node[0]);
assert.isUndefined(node[1]);
assert.isUndefined(node[2]);
assert.isUndefined(node[3]);
assert.isUndefined(node.nodes[0]);
assert.isUndefined(node.nodes[1]);
assert.isUndefined(node.nodes[2]);
assert.isUndefined(node.nodes[3]);
assert.isTrue(node.leaf);
++n;
});
......@@ -60,10 +60,10 @@ suite.addBatch({
n = 0;
q.visit(function(node, x1, y1, x2, y2) {
assert.isNull(node.point);
assert.isUndefined(node[0]);
assert.isUndefined(node[1]);
assert.isUndefined(node[2]);
assert.isUndefined(node[3]);
assert.isUndefined(node.nodes[0]);
assert.isUndefined(node.nodes[1]);
assert.isUndefined(node.nodes[2]);
assert.isUndefined(node.nodes[3]);
assert.isTrue(node.leaf);
++n;
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment