Skip to content

Commit

Permalink
Updated quadtree tests to check the nodes property of the node (a d…
Browse files Browse the repository at this point in the history
…3_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]`.
  • Loading branch information
jimkang committed Mar 22, 2014
1 parent e4d5da3 commit a2fae34
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/geom/quadtree-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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;
});
Expand All @@ -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;
});
Expand Down

0 comments on commit a2fae34

Please sign in to comment.