Skip to content

Commit

Permalink
Add root node tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 15, 2020
1 parent da016d8 commit 6ed1803
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Octree/test/Octree/test_octree_bbox.cpp
Expand Up @@ -17,14 +17,39 @@ typedef CGAL::Octree::Octree

void test_1_node() {

// Define the dataset
Point_set points;
points.insert({-1, -1, -1});
auto point_map = points.point_map();

// Create the octree
Octree octree(points, point_map);
octree.refine(10, 1);

// Compare the top (only) node
assert(octree.bbox(octree.root()) == CGAL::Bbox_3(-1, -1, -1, -1, -1, -1));
}

void test_9_nodes() {

// Define the dataset
Point_set points;
points.insert({-1, -1, -1});
points.insert({1, 1, 1});
auto point_map = points.point_map();

// Create the octree
Octree octree(points, point_map, 1.1);
octree.refine(10, 1);

// Compare the top node
assert(octree.bbox(octree.root()) == CGAL::Bbox_3(-1.1, -1.1, -1.1, 1.1, 1.1, 1.1));
}

int main(void) {

test_1_node();
test_9_nodes();

return EXIT_SUCCESS;
}

0 comments on commit 6ed1803

Please sign in to comment.