Skip to content

Commit

Permalink
[test/Convex] Update copy constructor test
Browse files Browse the repository at this point in the history
  • Loading branch information
lmontaut committed Oct 5, 2023
1 parent c171d74 commit a18481e
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions test/convex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,28 @@ BOOST_AUTO_TEST_CASE(convex_hull_box_like) {
}

BOOST_AUTO_TEST_CASE(convex_copy_constructor) {
std::shared_ptr<std::vector<Vec3f>> points(new std::vector<Vec3f>({
Vec3f(1, 1, 1),
Vec3f(1, 1, -1),
Vec3f(1, -1, 1),
Vec3f(1, -1, -1),
Vec3f(-1, 1, 1),
Vec3f(-1, 1, -1),
Vec3f(-1, -1, 1),
Vec3f(-1, -1, -1),
Vec3f(0, 0, 0),
}));

Convex<Triangle>* convexHullTri = dynamic_cast<Convex<Triangle>*>(
ConvexBase::convexHull(points, 9, true, NULL));
Convex<Triangle>* convexHullTriCopy = new Convex<Triangle>(*convexHullTri);
BOOST_CHECK(*convexHullTri == *convexHullTriCopy);
Convex<Triangle>* convexHullTriCopy;
{
std::shared_ptr<std::vector<Vec3f>> points(new std::vector<Vec3f>({
Vec3f(1, 1, 1),
Vec3f(1, 1, -1),
Vec3f(1, -1, 1),
Vec3f(1, -1, -1),
Vec3f(-1, 1, 1),
Vec3f(-1, 1, -1),
Vec3f(-1, -1, 1),
Vec3f(-1, -1, -1),
Vec3f(0, 0, 0),
}));

Convex<Triangle>* convexHullTri = dynamic_cast<Convex<Triangle>*>(
ConvexBase::convexHull(points, 9, true, NULL));
convexHullTriCopy = new Convex<Triangle>(*convexHullTri);
BOOST_CHECK(*convexHullTri == *convexHullTriCopy);
}
Convex<Triangle>* convexHullTriCopyOfCopy =
new Convex<Triangle>(*convexHullTriCopy);
BOOST_CHECK(*convexHullTriCopyOfCopy == *convexHullTriCopy);
}

BOOST_AUTO_TEST_CASE(convex_clone) {
Expand Down

0 comments on commit a18481e

Please sign in to comment.