From bdb8a739d8d7d6c69f0d4a78ab079fa04242c1d6 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 17:16:15 -0400 Subject: [PATCH 01/17] Update test_fcl_sphere_capsule.cpp to use gtest --- test/CMakeLists.txt | 3 +- test/test_fcl_sphere_capsule.cpp | 56 ++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 63a8ec5ef..9fd94e4db 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,6 +27,7 @@ add_library(test_fcl_utility test_fcl_utility.cpp) # test file list set(tests test_fcl_distance.cpp + test_fcl_sphere_capsule.cpp ) macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_test once we completely drop the dependency on Boost Test @@ -93,7 +94,7 @@ add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp) add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp) +#add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp) add_fcl_test(test_fcl_capsule_capsule test_fcl_capsule_capsule.cpp) add_fcl_test(test_fcl_simple test_fcl_simple.cpp) add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp) diff --git a/test/test_fcl_sphere_capsule.cpp b/test/test_fcl_sphere_capsule.cpp index 433ac5ef2..6c9bffe81 100644 --- a/test/test_fcl_sphere_capsule.cpp +++ b/test/test_fcl_sphere_capsule.cpp @@ -35,8 +35,7 @@ /** \author Martin Felis */ -#define BOOST_TEST_MODULE "FCL_SPHERE_CAPSULE" -#include +#include #include "fcl/math/constants.h" #include "fcl/collision.h" @@ -45,7 +44,7 @@ using namespace fcl; -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_z) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z) { GJKSolver_libccd solver; @@ -56,10 +55,10 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_z) Capsule capsule (50, 200.); Transform3f capsule_transform (Vec3f (0., 0., 200)); - BOOST_CHECK (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); + EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_z_negative) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z_negative) { GJKSolver_libccd solver; @@ -70,10 +69,10 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_z_negative) Capsule capsule (50, 200.); Transform3f capsule_transform (Vec3f (0., 0., -200)); - BOOST_CHECK (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); + EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_x) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_x) { GJKSolver_libccd solver; @@ -84,10 +83,10 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_x) Capsule capsule (50, 200.); Transform3f capsule_transform (Vec3f (150., 0., 0.)); - BOOST_CHECK (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); + EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_capsule_rotated) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_capsule_rotated) { GJKSolver_libccd solver; @@ -100,10 +99,10 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_separated_capsule_rotated) rotation.setEulerZYX (constants::pi * 0.5, 0., 0.); Transform3f capsule_transform (rotation, Vec3f (150., 0., 0.)); - BOOST_CHECK (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); + EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_penetration_z) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z) { GJKSolver_libccd solver; @@ -122,13 +121,13 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_penetration_z) Vec3f contact_point = contacts[0].pos; Vec3f normal = contacts[0].normal; - BOOST_CHECK (is_intersecting); - BOOST_CHECK (penetration == 25.); - BOOST_CHECK (Vec3f (0., 0., 1.).equal(normal)); - BOOST_CHECK (Vec3f (0., 0., 0.).equal(contact_point)); + EXPECT_TRUE (is_intersecting); + EXPECT_TRUE (penetration == 25.); + EXPECT_TRUE (Vec3f (0., 0., 1.).equal(normal)); + EXPECT_TRUE (Vec3f (0., 0., 0.).equal(contact_point)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_penetration_z_rotated) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z_rotated) { GJKSolver_libccd solver; @@ -149,13 +148,13 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Intersect_test_penetration_z_rotated) Vec3f contact_point = contacts[0].pos; Vec3f normal = contacts[0].normal; - BOOST_CHECK (is_intersecting); - BOOST_CHECK_CLOSE (25, penetration, solver.collision_tolerance); - BOOST_CHECK (Vec3f (0., 0., 1.).equal(normal)); - BOOST_CHECK (Vec3f (0., 0., 50.).equal(contact_point, solver.collision_tolerance)); + EXPECT_TRUE (is_intersecting); + EXPECT_NEAR (25, penetration, solver.collision_tolerance); + EXPECT_TRUE (Vec3f (0., 0., 1.).equal(normal)); + EXPECT_TRUE (Vec3f (0., 0., 50.).equal(contact_point, solver.collision_tolerance)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Distance_test_collision) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_collision) { GJKSolver_libccd solver; @@ -168,11 +167,11 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Distance_test_collision) FCL_REAL distance; - BOOST_CHECK (!solver.shapeDistance(sphere1, sphere1_transform, capsule, capsule_transform, &distance)); + EXPECT_TRUE (!solver.shapeDistance(sphere1, sphere1_transform, capsule, capsule_transform, &distance)); } -BOOST_AUTO_TEST_CASE(Sphere_Capsule_Distance_test_separated) +TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_separated) { GJKSolver_libccd solver; @@ -188,6 +187,13 @@ BOOST_AUTO_TEST_CASE(Sphere_Capsule_Distance_test_separated) Vec3f p2; bool is_separated = solver.shapeDistance(sphere1, sphere1_transform, capsule, capsule_transform, &distance); - BOOST_CHECK (is_separated); - BOOST_CHECK (distance == 25.); + EXPECT_TRUE (is_separated); + EXPECT_TRUE (distance == 25.); +} + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } From 5429724b02737ce767579211a631e2a35eee762f Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 17:20:44 -0400 Subject: [PATCH 02/17] Update more tests to use gtest --- test/CMakeLists.txt | 6 ++- test/test_fcl_broadphase.cpp | 72 ++++++++++++++++++------------------ test/test_fcl_bvh_models.cpp | 49 +++++++++++++----------- 3 files changed, 68 insertions(+), 59 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9fd94e4db..f4776a476 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,6 +26,8 @@ add_library(test_fcl_utility test_fcl_utility.cpp) # test file list set(tests + test_fcl_broadphase.cpp + test_fcl_bvh_models.cpp test_fcl_distance.cpp test_fcl_sphere_capsule.cpp ) @@ -89,7 +91,7 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}") add_fcl_test(test_fcl_collision test_fcl_collision.cpp test_fcl_utility.cpp) #add_fcl_test(test_fcl_distance test_fcl_distance.cpp test_fcl_utility.cpp) add_fcl_test(test_fcl_geometric_shapes test_fcl_geometric_shapes.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp) +#add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp) add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp test_fcl_utility.cpp) add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp) add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp) @@ -100,7 +102,7 @@ add_fcl_test(test_fcl_simple test_fcl_simple.cpp) add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp) add_fcl_test(test_fcl_capsule_box_2 test_fcl_capsule_box_2.cpp) #add_fcl_test(test_fcl_global_penetration test_fcl_global_penetration.cpp libsvm/svm.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_bvh_models test_fcl_bvh_models.cpp test_fcl_utility.cpp) +#add_fcl_test(test_fcl_bvh_models test_fcl_bvh_models.cpp test_fcl_utility.cpp) if (FCL_HAVE_OCTOMAP) add_fcl_test(test_fcl_octomap test_fcl_octomap.cpp test_fcl_utility.cpp) diff --git a/test/test_fcl_broadphase.cpp b/test/test_fcl_broadphase.cpp index 5878adddc..d4ac1c310 100644 --- a/test/test_fcl_broadphase.cpp +++ b/test/test_fcl_broadphase.cpp @@ -35,9 +35,7 @@ /** \author Jia Pan */ - -#define BOOST_TEST_MODULE "FCL_BROADPHASE" -#include +#include #include "fcl/config.h" #include "fcl/broadphase/broadphase.h" @@ -112,28 +110,28 @@ struct GoogleDenseHashTable : public google::dense_hash_map 0); for(size_t i = 1; i < self_res.size(); ++i) - BOOST_CHECK(self_res[0] == self_res[i]); + EXPECT_TRUE(self_res[0] == self_res[i]); for(size_t i = 1; i < managers.size(); ++i) - BOOST_CHECK(self_data[i].result.numContacts() == self_data[0].result.numContacts()); + EXPECT_TRUE(self_data[i].result.numContacts() == self_data[0].result.numContacts()); } @@ -637,7 +635,7 @@ void broad_phase_collision_test(double env_scale, std::size_t env_size, std::siz if(exhaustive) { for(size_t j = 1; j < managers.size(); ++j) - BOOST_CHECK(query_data[j].result.numContacts() == query_data[0].result.numContacts()); + EXPECT_TRUE(query_data[j].result.numContacts() == query_data[0].result.numContacts()); } else { @@ -645,10 +643,10 @@ void broad_phase_collision_test(double env_scale, std::size_t env_size, std::siz for(size_t j = 0; j < query_res.size(); ++j) query_res[j] = (query_data[j].result.numContacts() > 0); for(size_t j = 1; j < query_res.size(); ++j) - BOOST_CHECK(query_res[0] == query_res[j]); + EXPECT_TRUE(query_res[0] == query_res[j]); for(size_t j = 1; j < managers.size(); ++j) - BOOST_CHECK(query_data[j].result.numContacts() == query_data[0].result.numContacts()); + EXPECT_TRUE(query_data[j].result.numContacts() == query_data[0].result.numContacts()); } } @@ -774,7 +772,7 @@ void broad_phase_self_distance_test(double env_scale, std::size_t env_size, bool // std::cout << std::endl; for(size_t i = 1; i < managers.size(); ++i) - BOOST_CHECK(fabs(self_data[0].result.min_distance - self_data[i].result.min_distance) < DELTA || + EXPECT_TRUE(fabs(self_data[0].result.min_distance - self_data[i].result.min_distance) < DELTA || fabs(self_data[0].result.min_distance - self_data[i].result.min_distance) / fabs(self_data[0].result.min_distance) < DELTA); for(size_t i = 0; i < env.size(); ++i) @@ -918,7 +916,7 @@ void broad_phase_distance_test(double env_scale, std::size_t env_size, std::size // std::cout << std::endl; for(size_t j = 1; j < managers.size(); ++j) - BOOST_CHECK(fabs(query_data[0].result.min_distance - query_data[j].result.min_distance) < DELTA || + EXPECT_TRUE(fabs(query_data[0].result.min_distance - query_data[j].result.min_distance) < DELTA || fabs(query_data[0].result.min_distance - query_data[j].result.min_distance) / fabs(query_data[0].result.min_distance) < DELTA); } @@ -1092,7 +1090,7 @@ void broad_phase_update_collision_test(double env_scale, std::size_t env_size, s if(exhaustive) { for(size_t i = 1; i < managers.size(); ++i) - BOOST_CHECK(self_data[i].result.numContacts() == self_data[0].result.numContacts()); + EXPECT_TRUE(self_data[i].result.numContacts() == self_data[0].result.numContacts()); } else { @@ -1101,10 +1099,10 @@ void broad_phase_update_collision_test(double env_scale, std::size_t env_size, s self_res[i] = (self_data[i].result.numContacts() > 0); for(size_t i = 1; i < self_res.size(); ++i) - BOOST_CHECK(self_res[0] == self_res[i]); + EXPECT_TRUE(self_res[0] == self_res[i]); for(size_t i = 1; i < managers.size(); ++i) - BOOST_CHECK(self_data[i].result.numContacts() == self_data[0].result.numContacts()); + EXPECT_TRUE(self_data[i].result.numContacts() == self_data[0].result.numContacts()); } @@ -1133,7 +1131,7 @@ void broad_phase_update_collision_test(double env_scale, std::size_t env_size, s if(exhaustive) { for(size_t j = 1; j < managers.size(); ++j) - BOOST_CHECK(query_data[j].result.numContacts() == query_data[0].result.numContacts()); + EXPECT_TRUE(query_data[j].result.numContacts() == query_data[0].result.numContacts()); } else { @@ -1141,10 +1139,10 @@ void broad_phase_update_collision_test(double env_scale, std::size_t env_size, s for(size_t j = 0; j < query_res.size(); ++j) query_res[j] = (query_data[j].result.numContacts() > 0); for(size_t j = 1; j < query_res.size(); ++j) - BOOST_CHECK(query_res[0] == query_res[j]); + EXPECT_TRUE(query_res[0] == query_res[j]); for(size_t j = 1; j < managers.size(); ++j) - BOOST_CHECK(query_data[j].result.numContacts() == query_data[0].result.numContacts()); + EXPECT_TRUE(query_data[j].result.numContacts() == query_data[0].result.numContacts()); } } @@ -1201,5 +1199,9 @@ void broad_phase_update_collision_test(double env_scale, std::size_t env_size, s std::cout << std::endl; } - - +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_bvh_models.cpp b/test/test_fcl_bvh_models.cpp index f61b98b0c..20653859e 100644 --- a/test/test_fcl_bvh_models.cpp +++ b/test/test_fcl_bvh_models.cpp @@ -34,9 +34,7 @@ /** \author Jeongseok Lee */ - -#define BOOST_TEST_MODULE "FCL_BVH_MODELS" -#include +#include #include "fcl/config.h" #include "fcl/BVH/BVH_model.h" @@ -80,22 +78,22 @@ void testBVHModelPointCloud() int result; result = model->beginModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); for (std::size_t i = 0; i < points.size(); ++i) { result = model->addVertex(points[i]); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); } result = model->endModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); model->computeLocalAABB(); - BOOST_CHECK_EQUAL(model->num_vertices, 8); - BOOST_CHECK_EQUAL(model->num_tris, 0); - BOOST_CHECK_EQUAL(model->build_state, BVH_BUILD_STATE_PROCESSED); + EXPECT_EQ(model->num_vertices, 8); + EXPECT_EQ(model->num_tris, 0); + EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED); } template @@ -134,22 +132,22 @@ void testBVHModelTriangles() int result; result = model->beginModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); for (std::size_t i = 0; i < tri_indices.size(); ++i) { result = model->addTriangle(points[tri_indices[i][0]], points[tri_indices[i][1]], points[tri_indices[i][2]]); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); } result = model->endModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); model->computeLocalAABB(); - BOOST_CHECK_EQUAL(model->num_vertices, 12 * 3); - BOOST_CHECK_EQUAL(model->num_tris, 12); - BOOST_CHECK_EQUAL(model->build_state, BVH_BUILD_STATE_PROCESSED); + EXPECT_EQ(model->num_vertices, 12 * 3); + EXPECT_EQ(model->num_tris, 12); + EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED); } template @@ -188,19 +186,19 @@ void testBVHModelSubModel() int result; result = model->beginModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); result = model->addSubModel(points, tri_indices); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); result = model->endModel(); - BOOST_CHECK_EQUAL(result, BVH_OK); + EXPECT_EQ(result, BVH_OK); model->computeLocalAABB(); - BOOST_CHECK_EQUAL(model->num_vertices, 8); - BOOST_CHECK_EQUAL(model->num_tris, 12); - BOOST_CHECK_EQUAL(model->build_state, BVH_BUILD_STATE_PROCESSED); + EXPECT_EQ(model->num_vertices, 8); + EXPECT_EQ(model->num_tris, 12); + EXPECT_EQ(model->build_state, BVH_BUILD_STATE_PROCESSED); } template @@ -211,7 +209,7 @@ void testBVHModel() testBVHModelSubModel(); } -BOOST_AUTO_TEST_CASE(building_bvh_models) +TEST(FCL_BVH_MODELS, building_bvh_models) { testBVHModel(); testBVHModel(); @@ -222,3 +220,10 @@ BOOST_AUTO_TEST_CASE(building_bvh_models) testBVHModel >(); testBVHModel >(); } + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From 349153cb82e65f05cc4df33fd7574484b9274fa9 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:00:42 -0400 Subject: [PATCH 03/17] Update rest of tests to use gtest --- test/CMakeLists.txt | 77 +- test/test_fcl_capsule_box_1.cpp | 50 +- test/test_fcl_capsule_box_2.cpp | 28 +- test/test_fcl_capsule_capsule.cpp | 34 +- test/test_fcl_collision.cpp | 440 ++++---- test/test_fcl_frontlist.cpp | 60 +- test/test_fcl_geometric_shapes.cpp | 702 ++++++------- test/test_fcl_math.cpp | 525 +++++----- test/test_fcl_octomap.cpp | 60 +- test/test_fcl_shape_mesh_consistency.cpp | 1162 +++++++++++----------- test/test_fcl_simple.cpp | 292 +++--- 11 files changed, 1718 insertions(+), 1712 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f4776a476..7046e1a9e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -28,10 +28,23 @@ add_library(test_fcl_utility test_fcl_utility.cpp) set(tests test_fcl_broadphase.cpp test_fcl_bvh_models.cpp + test_fcl_capsule_box_1.cpp + test_fcl_capsule_box_2.cpp + test_fcl_capsule_capsule.cpp + test_fcl_collision.cpp test_fcl_distance.cpp + test_fcl_frontlist.cpp + test_fcl_geometric_shapes.cpp + test_fcl_math.cpp + test_fcl_shape_mesh_consistency.cpp + test_fcl_simple.cpp test_fcl_sphere_capsule.cpp ) +if (FCL_HAVE_OCTOMAP) + list(APPEND tests test_fcl_octomap.cpp) +endif() + macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_test once we completely drop the dependency on Boost Test # Get the name (i.e. bla.cpp => bla) get_filename_component(test_name ${ARGV} NAME_WE) @@ -46,35 +59,6 @@ macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_te add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) endmacro(add_fcl_gtest) -# Build all the tests -foreach(test ${tests}) - add_fcl_gtest(${test}) -endforeach(test) - -#=============================================================================== -# Boost.Test settings -#=============================================================================== - -include_directories(${Boost_INCLUDE_DIR}) - -if(MSVC) - add_definitions(-DBOOST_ALL_NO_LIB) -endif() -add_definitions(-DBOOST_TEST_DYN_LINK) - - -macro(add_fcl_test test_name) - add_executable(${ARGV}) - target_link_libraries(${test_name} - fcl - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_DATE_TIME_LIBRARY} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) -endmacro(add_fcl_test) - # configure location of resources file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/fcl_resources" TEST_RESOURCES_SRC_DIR) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/fcl_resources" TEST_RESOURCES_BIN_DIR) @@ -88,34 +72,7 @@ configure_file("${TEST_RESOURCES_SRC_DIR}/config.h.in" "${TEST_RESOURCES_BIN_DIR include_directories(.) include_directories("${CMAKE_CURRENT_BINARY_DIR}") -add_fcl_test(test_fcl_collision test_fcl_collision.cpp test_fcl_utility.cpp) -#add_fcl_test(test_fcl_distance test_fcl_distance.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_geometric_shapes test_fcl_geometric_shapes.cpp test_fcl_utility.cpp) -#add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp) -add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp) - -#add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp) -add_fcl_test(test_fcl_capsule_capsule test_fcl_capsule_capsule.cpp) -add_fcl_test(test_fcl_simple test_fcl_simple.cpp) -add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp) -add_fcl_test(test_fcl_capsule_box_2 test_fcl_capsule_box_2.cpp) -#add_fcl_test(test_fcl_global_penetration test_fcl_global_penetration.cpp libsvm/svm.cpp test_fcl_utility.cpp) -#add_fcl_test(test_fcl_bvh_models test_fcl_bvh_models.cpp test_fcl_utility.cpp) - -if (FCL_HAVE_OCTOMAP) - add_fcl_test(test_fcl_octomap test_fcl_octomap.cpp test_fcl_utility.cpp) -endif() - -#if (FCL_HAVE_TINYXML) -# add_executable(test_fcl_xmldata test_fcl_xmldata.cpp test_fcl_utility.cpp libsvm/svm.cpp) -# target_link_libraries(test_fcl_xmldata -# fcl -# ${TINYXML_LIBRARY_DIRS} -# ${Boost_SYSTEM_LIBRARY} -# ${Boost_THREAD_LIBRARY} -# ${Boost_DATE_TIME_LIBRARY} -# ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -# add_test(test_fcl_xmldata ${EXECUTABLE_OUTPUT_PATH}/test_fcl_xmldata) -#endif() +# Build all the tests +foreach(test ${tests}) + add_fcl_gtest(${test}) +endforeach(test) diff --git a/test/test_fcl_capsule_box_1.cpp b/test/test_fcl_capsule_box_1.cpp index 79ca66241..6d1632437 100644 --- a/test/test_fcl_capsule_box_1.cpp +++ b/test/test_fcl_capsule_box_1.cpp @@ -34,10 +34,7 @@ /** \author Florent Lamiraux */ - -#define BOOST_TEST_MODULE "FCL_GEOMETRIC_SHAPES" -#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps)) -#include +#include #include #include @@ -46,7 +43,7 @@ #include #include -BOOST_AUTO_TEST_CASE(distance_capsule_box) +TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) { typedef std::shared_ptr CollisionGeometryPtr_t; // Capsule of radius 2 and of height 4 @@ -69,11 +66,11 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box) fcl::Vec3f o1 (distanceResult.nearest_points [0]); // Nearest point on box fcl::Vec3f o2 (distanceResult.nearest_points [1]); - BOOST_CHECK_CLOSE (distanceResult.min_distance, 0.5, 1e-4); - BOOST_CHECK_CLOSE (o1 [0], -2.0, 1e-4); - CHECK_CLOSE_TO_0 (o1 [1], 1e-4); - BOOST_CHECK_CLOSE (o2 [0], 0.5, 1e-4); - BOOST_CHECK_CLOSE (o1 [1], 0.0, 1e-4); + EXPECT_NEAR (distanceResult.min_distance, 0.5, 1e-4); + EXPECT_NEAR (o1 [0], -2.0, 1e-4); + EXPECT_NEAR (o1 [1], 0.0, 1e-4); + EXPECT_NEAR (o2 [0], 0.5, 1e-4); + EXPECT_NEAR (o1 [1], 0.0, 1e-4); // Move capsule above box tf1 = fcl::Transform3f (fcl::Vec3f (0., 0., 8.)); @@ -85,15 +82,15 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box) o1 = distanceResult.nearest_points [0]; o2 = distanceResult.nearest_points [1]; - BOOST_CHECK_CLOSE (distanceResult.min_distance, 2.0, 1e-4); - CHECK_CLOSE_TO_0 (o1 [0], 1e-4); - CHECK_CLOSE_TO_0 (o1 [1], 1e-4); - BOOST_CHECK_CLOSE (o1 [2], -4.0, 1e-4); + EXPECT_NEAR (distanceResult.min_distance, 2.0, 1e-4); + EXPECT_NEAR (o1 [0], 0.0, 1e-4); + EXPECT_NEAR (o1 [1], 0.0, 1e-4); + EXPECT_NEAR (o1 [2], -4.0, 1e-4); // Disabled broken test lines. Please see #25. // CHECK_CLOSE_TO_0 (o2 [0], 1e-4); - CHECK_CLOSE_TO_0 (o2 [1], 1e-4); - BOOST_CHECK_CLOSE (o2 [2], 2.0, 1e-4); + EXPECT_NEAR (o2 [1], 0.0, 1e-4); + EXPECT_NEAR (o2 [2], 2.0, 1e-4); // Rotate capsule around y axis by pi/2 and move it behind box tf1.setTranslation (fcl::Vec3f (-10., 0., 0.)); @@ -106,11 +103,18 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box) o1 = distanceResult.nearest_points [0]; o2 = distanceResult.nearest_points [1]; - BOOST_CHECK_CLOSE (distanceResult.min_distance, 5.5, 1e-4); - CHECK_CLOSE_TO_0 (o1 [0], 1e-4); - CHECK_CLOSE_TO_0 (o1 [1], 1e-4); - BOOST_CHECK_CLOSE (o1 [2], 4.0, 1e-4); - BOOST_CHECK_CLOSE (o2 [0], -0.5, 1e-4); - CHECK_CLOSE_TO_0 (o2 [1], 1e-4); - CHECK_CLOSE_TO_0 (o2 [2], 1e-4); + EXPECT_NEAR (distanceResult.min_distance, 5.5, 1e-4); + EXPECT_NEAR (o1 [0], 0.0, 1e-4); + EXPECT_NEAR (o1 [1], 0.0, 1e-4); + EXPECT_NEAR (o1 [2], 4.0, 1e-4); + EXPECT_NEAR (o2 [0], -0.5, 1e-4); + EXPECT_NEAR (o2 [1], 0.0, 1e-4); + EXPECT_NEAR (o2 [2], 0.0, 1e-4); +} + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } diff --git a/test/test_fcl_capsule_box_2.cpp b/test/test_fcl_capsule_box_2.cpp index 10fd780ad..e1e0ec622 100644 --- a/test/test_fcl_capsule_box_2.cpp +++ b/test/test_fcl_capsule_box_2.cpp @@ -34,10 +34,7 @@ /** \author Florent Lamiraux */ - -#define BOOST_TEST_MODULE "FCL_GEOMETRIC_SHAPES" -#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps)) -#include +#include #include #include @@ -46,7 +43,7 @@ #include #include -BOOST_AUTO_TEST_CASE(distance_capsule_box) +TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) { typedef std::shared_ptr CollisionGeometryPtr_t; // Capsule of radius 2 and of height 4 @@ -71,13 +68,20 @@ BOOST_AUTO_TEST_CASE(distance_capsule_box) fcl::Vec3f o1 = distanceResult.nearest_points [0]; fcl::Vec3f o2 = distanceResult.nearest_points [1]; - BOOST_CHECK_CLOSE (distanceResult.min_distance, 5.5, 1e-4); + EXPECT_NEAR (distanceResult.min_distance, 5.5, 1e-4); // Disabled broken test lines. Please see #25. - // CHECK_CLOSE_TO_0 (o1 [0], 1e-4); - // CHECK_CLOSE_TO_0 (o1 [1], 1e-4); - BOOST_CHECK_CLOSE (o1 [2], 4.0, 1e-4); - BOOST_CHECK_CLOSE (o2 [0], -0.5, 1e-4); + // EXPECT_NEAR (o1 [0], 0.0, 1e-4); + // EXPECT_NEAR (o1 [1], 0.0, 1e-4); + EXPECT_NEAR (o1 [2], 4.0, 1e-4); + EXPECT_NEAR (o2 [0], -0.5, 1e-4); // Disabled broken test lines. Please see #25. - // BOOST_CHECK_CLOSE (o2 [1], 0.8, 1e-4); - // BOOST_CHECK_CLOSE (o2 [2], 1.5, 1e-4); + // EXPECT_NEAR (o2 [1], 0.8, 1e-4); + // EXPECT_NEAR (o2 [2], 1.5, 1e-4); +} + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } diff --git a/test/test_fcl_capsule_capsule.cpp b/test/test_fcl_capsule_capsule.cpp index e7eb8ff0d..4fc29d24f 100644 --- a/test/test_fcl_capsule_capsule.cpp +++ b/test/test_fcl_capsule_capsule.cpp @@ -35,8 +35,7 @@ /** \author Karsten Knese */ -#define BOOST_TEST_MODULE "FCL_CAPSULE_CAPSULE" -#include +#include #include "fcl/math/constants.h" #include "fcl/collision.h" @@ -46,7 +45,7 @@ #include using namespace fcl; -BOOST_AUTO_TEST_CASE(distance_capsulecapsule_origin) +TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_origin) { GJKSolver_indep solver; @@ -66,13 +65,13 @@ BOOST_AUTO_TEST_CASE(distance_capsulecapsule_origin) std::cerr << "applied transformation of two caps: " << transform.getTranslation() << " & " << transform2.getTranslation() << std::endl; std::cerr << "computed points in caps to caps" << closest_p1 << " & " << closest_p2 << "with dist: " << dist << std::endl; - BOOST_CHECK(std::abs(dist - 10.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(std::abs(dist - 10.1) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformXY) +TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformXY) { GJKSolver_indep solver; @@ -93,12 +92,12 @@ BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformXY) std::cerr << "computed points in caps to caps" << closest_p1 << " & " << closest_p2 << "with dist: " << dist << std::endl; FCL_REAL expected = std::sqrt(FCL_REAL(800)) - 10; - BOOST_CHECK(std::abs(expected-dist) < 0.01); - BOOST_CHECK(res); + EXPECT_TRUE(std::abs(expected-dist) < 0.01); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ) +TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ) { GJKSolver_indep solver; @@ -118,13 +117,13 @@ BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ) std::cerr << "applied transformation of two caps: " << transform.getTranslation() << " & " << transform2.getTranslation() << std::endl; std::cerr << "computed points in caps to caps" << closest_p1 << " & " << closest_p2 << "with dist: " << dist << std::endl; - BOOST_CHECK(std::abs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(std::abs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ2) +TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ2) { const FCL_REAL Pi = constants::pi; @@ -150,7 +149,14 @@ BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ2) std::cerr << "applied transformation of two caps: " << transform.getRotation() << " & " << transform2.getRotation() << std::endl; std::cerr << "computed points in caps to caps" << closest_p1 << " & " << closest_p2 << "with dist: " << dist << std::endl; - BOOST_CHECK(std::abs(dist - 5.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(std::abs(dist - 5.1) < 0.001); + EXPECT_TRUE(res); } + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_collision.cpp b/test/test_fcl_collision.cpp index 58123e96d..76f231868 100644 --- a/test/test_fcl_collision.cpp +++ b/test/test_fcl_collision.cpp @@ -35,8 +35,7 @@ /** \author Jia Pan */ -#define BOOST_TEST_MODULE "FCL_COLLISION" -#include +#include #include "fcl/traversal/traversal_node_bvhs.h" #include "fcl/traversal/traversal_node_setup.h" @@ -78,7 +77,7 @@ bool enable_contact = true; std::vector global_pairs; std::vector global_pairs_now; -BOOST_AUTO_TEST_CASE(OBB_Box_test) +TEST(FCL_COLLISION, OBB_Box_test) { FCL_REAL r_extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::vector rotate_transform; @@ -118,11 +117,11 @@ BOOST_AUTO_TEST_CASE(OBB_Box_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_box = solver.shapeIntersect(box1, box1_tf, box2, box2_tf, NULL); - BOOST_CHECK(overlap_obb == overlap_box); + EXPECT_TRUE(overlap_obb == overlap_box); } } -BOOST_AUTO_TEST_CASE(OBB_shape_test) +TEST(FCL_COLLISION, OBB_shape_test) { FCL_REAL r_extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::vector rotate_transform; @@ -156,7 +155,7 @@ BOOST_AUTO_TEST_CASE(OBB_shape_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_sphere = solver.shapeIntersect(box1, box1_tf, sphere, transforms[i], NULL); - BOOST_CHECK(overlap_obb >= overlap_sphere); + EXPECT_TRUE(overlap_obb >= overlap_sphere); } { @@ -165,7 +164,7 @@ BOOST_AUTO_TEST_CASE(OBB_shape_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_ellipsoid = solver.shapeIntersect(box1, box1_tf, ellipsoid, transforms[i], NULL); - BOOST_CHECK(overlap_obb >= overlap_ellipsoid); + EXPECT_TRUE(overlap_obb >= overlap_ellipsoid); } { @@ -174,7 +173,7 @@ BOOST_AUTO_TEST_CASE(OBB_shape_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_capsule = solver.shapeIntersect(box1, box1_tf, capsule, transforms[i], NULL); - BOOST_CHECK(overlap_obb >= overlap_capsule); + EXPECT_TRUE(overlap_obb >= overlap_capsule); } { @@ -183,7 +182,7 @@ BOOST_AUTO_TEST_CASE(OBB_shape_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_cone = solver.shapeIntersect(box1, box1_tf, cone, transforms[i], NULL); - BOOST_CHECK(overlap_obb >= overlap_cone); + EXPECT_TRUE(overlap_obb >= overlap_cone); } { @@ -192,12 +191,12 @@ BOOST_AUTO_TEST_CASE(OBB_shape_test) bool overlap_obb = obb1.overlap(obb2); bool overlap_cylinder = solver.shapeIntersect(box1, box1_tf, cylinder, transforms[i], NULL); - BOOST_CHECK(overlap_obb >= overlap_cylinder); + EXPECT_TRUE(overlap_obb >= overlap_cylinder); } } } -BOOST_AUTO_TEST_CASE(OBB_AABB_test) +TEST(FCL_COLLISION, OBB_AABB_test) { FCL_REAL extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::size_t n = 1000; @@ -233,12 +232,12 @@ BOOST_AUTO_TEST_CASE(OBB_AABB_test) std::cout << obb2.To << " " << obb2.extent << " " << obb2.axis[0] << " " << obb2.axis[1] << " " << obb2.axis[2] << std::endl; } - BOOST_CHECK(overlap_aabb == overlap_obb); + EXPECT_TRUE(overlap_aabb == overlap_obb); } std::cout << std::endl; } -BOOST_AUTO_TEST_CASE(mesh_mesh) +TEST(FCL_COLLISION, mesh_mesh) { std::vector p1, p2; std::vector t1, t2; @@ -263,550 +262,550 @@ BOOST_AUTO_TEST_CASE(mesh_mesh) collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2 >(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test2(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } collide_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } test_collide_func(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER); - BOOST_CHECK(global_pairs.size() == global_pairs_now.size()); + EXPECT_TRUE(global_pairs.size() == global_pairs_now.size()); for(std::size_t j = 0; j < global_pairs.size(); ++j) { - BOOST_CHECK(global_pairs[j].b1 == global_pairs_now[j].b1); - BOOST_CHECK(global_pairs[j].b2 == global_pairs_now[j].b2); + EXPECT_TRUE(global_pairs[j].b1 == global_pairs_now[j].b1); + EXPECT_TRUE(global_pairs[j].b2 == global_pairs_now[j].b2); } } } @@ -1035,3 +1034,10 @@ bool test_collide_func(const Transform3f& tf, if(num_contacts > 0) return true; else return false; } + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_frontlist.cpp b/test/test_fcl_frontlist.cpp index 5bd23defb..5d990b88a 100644 --- a/test/test_fcl_frontlist.cpp +++ b/test/test_fcl_frontlist.cpp @@ -35,9 +35,7 @@ /** \author Jia Pan */ - -#define BOOST_TEST_MODULE "FCL_FRONT_LIST" -#include +#include #include "fcl/traversal/traversal_node_bvhs.h" #include "fcl/traversal/traversal_node_setup.h" @@ -69,7 +67,7 @@ bool collide_Test(const Transform3f& tf, const std::vector& vertices2, const std::vector& triangles2, SplitMethodType split_method, bool verbose); // TODO: randomly still have some runtime error -BOOST_AUTO_TEST_CASE(front_list) +TEST(FCL_FRONT_LIST, front_list) { std::vector p1, p2; std::vector t1, t2; @@ -92,26 +90,26 @@ BOOST_AUTO_TEST_CASE(front_list) { res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) @@ -119,78 +117,78 @@ BOOST_AUTO_TEST_CASE(front_list) // Disabled broken test lines. Please see #25. // res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); // res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - // BOOST_CHECK(res == res2); + // EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test >(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test >(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, false, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } for(std::size_t i = 0; i < transforms.size(); ++i) { res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); res = collide_Test(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); res2 = collide_front_list_Test_Oriented(transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, verbose); - BOOST_CHECK(res == res2); + EXPECT_TRUE(res == res2); } } @@ -356,3 +354,9 @@ bool collide_Test(const Transform3f& tf, return false; } +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_geometric_shapes.cpp b/test/test_fcl_geometric_shapes.cpp index 751e28339..09e95a04b 100755 --- a/test/test_fcl_geometric_shapes.cpp +++ b/test/test_fcl_geometric_shapes.cpp @@ -35,9 +35,7 @@ /** \author Jia Pan */ - -#define BOOST_TEST_MODULE "FCL_GEOMETRIC_SHAPES" -#include +#include #include "fcl/narrowphase/narrowphase.h" #include "fcl/collision.h" @@ -53,9 +51,9 @@ FCL_REAL extents [6] = {0, 0, 0, 10, 10, 10}; GJKSolver_libccd solver1; GJKSolver_indep solver2; -#define BOOST_CHECK_FALSE(p) BOOST_CHECK(!(p)) +#define EXPECT_TRUE_FALSE(p) EXPECT_TRUE(!(p)) -BOOST_AUTO_TEST_CASE(sphere_shape) +TEST(FCL_GEOMETRIC_SHAPES, sphere_shape) { const double tol = 1e-12; const double radius = 5.0; @@ -64,10 +62,10 @@ BOOST_AUTO_TEST_CASE(sphere_shape) Sphere s(radius); const double volume = 4.0 / 3.0 * pi * radius * radius * radius; - BOOST_CHECK_CLOSE(volume, s.computeVolume(), tol); + EXPECT_NEAR(volume, s.computeVolume(), tol); } -BOOST_AUTO_TEST_CASE(gjkcache) +TEST(FCL_GEOMETRIC_SHAPES, gjkcache) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -123,7 +121,7 @@ BOOST_AUTO_TEST_CASE(gjkcache) for(std::size_t i = 0; i < result1.size(); ++i) { - BOOST_CHECK(result1[i] == result2[i]); + EXPECT_TRUE(result1[i] == result2[i]); } } @@ -234,7 +232,7 @@ bool inspectContactPoints(const S1& s1, const Transform3f& tf1, { // Check number of contact points bool sameNumContacts = (actual_contacts.size() == expected_contacts.size()); - BOOST_CHECK(sameNumContacts); + EXPECT_TRUE(sameNumContacts); if (!sameNumContacts) { std::cout << "\n" @@ -406,7 +404,7 @@ void testShapeIntersection( std::cerr << "Invalid GJK solver. Test aborted." << std::endl; return; } - BOOST_CHECK_EQUAL(res, expected_res); + EXPECT_EQ(res, expected_res); // Check contact information as well if (solver_type == GST_LIBCCD) @@ -422,10 +420,10 @@ void testShapeIntersection( std::cerr << "Invalid GJK solver. Test aborted." << std::endl; return; } - BOOST_CHECK_EQUAL(res, expected_res); + EXPECT_EQ(res, expected_res); if (expected_res) { - BOOST_CHECK(inspectContactPoints(s1, tf1, s2, tf2, solver_type, + EXPECT_TRUE(inspectContactPoints(s1, tf1, s2, tf2, solver_type, expected_contacts, actual_contacts, check_position, check_depth, @@ -439,17 +437,17 @@ void testShapeIntersection( request.enable_contact = false; result.clear(); res = (collide(&s1, tf1, &s2, tf2, request, result) > 0); - BOOST_CHECK_EQUAL(res, expected_res); + EXPECT_EQ(res, expected_res); // Check contact information as well request.enable_contact = true; result.clear(); res = (collide(&s1, tf1, &s2, tf2, request, result) > 0); - BOOST_CHECK_EQUAL(res, expected_res); + EXPECT_EQ(res, expected_res); if (expected_res) { getContactPointsFromResult(actual_contacts, result); - BOOST_CHECK(inspectContactPoints(s1, tf1, s2, tf2, solver_type, + EXPECT_TRUE(inspectContactPoints(s1, tf1, s2, tf2, solver_type, expected_contacts, actual_contacts, check_position, check_depth, @@ -482,7 +480,7 @@ void testShapeIntersection( // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -BOOST_AUTO_TEST_CASE(shapeIntersection_spheresphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -624,7 +622,7 @@ void testBoxBoxContactPoints(const Matrix3f& R) // Make sure the two boxes are colliding bool res = solver1.shapeIntersect(s1, tf1, s2, tf2, &contacts); - BOOST_CHECK(res); + EXPECT_TRUE(res); // Compute global vertices for (int i = 0; i < 8; ++i) @@ -641,12 +639,12 @@ void testBoxBoxContactPoints(const Matrix3f& R) // We just check the deepest one as workaround. for (size_t i = 0; i < numContacts; ++i) { - BOOST_CHECK(vertices[i].equal(contacts[i].pos)); - BOOST_CHECK(Vec3f(0, 0, 1).equal(contacts[i].normal)); + EXPECT_TRUE(vertices[i].equal(contacts[i].pos)); + EXPECT_TRUE(Vec3f(0, 0, 1).equal(contacts[i].normal)); } } -BOOST_AUTO_TEST_CASE(shapeIntersection_boxbox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -722,7 +720,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_boxbox) } } -BOOST_AUTO_TEST_CASE(shapeIntersection_spherebox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherebox) { Sphere s1(20); Box s2(5, 5, 5); @@ -769,7 +767,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_spherebox) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, true, contacts, false, false, true, false, 1e-4); } -BOOST_AUTO_TEST_CASE(shapeIntersection_spherecapsule) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherecapsule) { Sphere s1(20); Capsule s2(5, 10); @@ -827,7 +825,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_spherecapsule) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_cylindercylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -873,7 +871,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_cylindercylinder) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_conecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -931,7 +929,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_conecone) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, true, contacts, false, false, true, false, 1e-5); } -BOOST_AUTO_TEST_CASE(shapeIntersection_cylindercone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercone) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -997,7 +995,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_cylindercone) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_ellipsoidellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -1066,7 +1064,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_ellipsoidellipsoid) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_spheretriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheretriangle) { Sphere s(10); Vec3f t[3]; @@ -1081,31 +1079,31 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_spheretriangle) bool res; res = solver1.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(30, 0, 0); t[1].setValue(9.9, -20, 0); t[2].setValue(9.9, 20, 0); res = solver1.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver1.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacetriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacetriangle) { Halfspace hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -1122,31 +1120,31 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacetriangle) bool res; res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(20, 0, 0); t[1].setValue(0, -20, 0); t[2].setValue(0, 20, 0); res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planetriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planetriangle) { Plane hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -1163,31 +1161,31 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planetriangle) bool res; res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(20, 0, 0); t[1].setValue(-0.1, -20, 0); t[2].setValue(-0.1, 20, 0); res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacesphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacesphere) { Sphere s(10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1273,7 +1271,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacesphere) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planesphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planesphere) { Sphere s(10); Plane hs(Vec3f(1, 0, 0), 0); @@ -1351,7 +1349,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planesphere) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacebox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacebox) { Box s(5, 10, 20); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1442,7 +1440,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacebox) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts, false, false, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planebox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planebox) { Box s(5, 10, 20); Plane hs(Vec3f(1, 0, 0), 0); @@ -1525,7 +1523,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planebox) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts, false, false, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspaceellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspaceellipsoid) { Ellipsoid s(5, 10, 20); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1765,7 +1763,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspaceellipsoid) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planeellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planeellipsoid) { Ellipsoid s(5, 10, 20); Plane hs(Vec3f(1, 0, 0), 0); @@ -1981,7 +1979,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planeellipsoid) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecapsule) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecapsule) { Capsule s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -2221,7 +2219,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecapsule) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planecapsule) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecapsule) { Capsule s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -2437,7 +2435,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planecapsule) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecylinder) { Cylinder s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -2677,7 +2675,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecylinder) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planecylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecylinder) { Cylinder s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -2894,7 +2892,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planecylinder) } -BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecone) { Cone s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -3134,7 +3132,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_halfspacecone) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -BOOST_AUTO_TEST_CASE(shapeIntersection_planecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecone) { Cone s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -3374,7 +3372,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersection_planecone) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -BOOST_AUTO_TEST_CASE(shapeDistance_spheresphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -3386,57 +3384,57 @@ BOOST_AUTO_TEST_CASE(shapeDistance_spheresphere) FCL_REAL dist = -1; Vec3f closest_p1, closest_p2; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(0, 40, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(40, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(30.1, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(29.9, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); // this is one problem: the precise is low sometimes - BOOST_CHECK(fabs(dist - 10) < 0.1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.1); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.06); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.06); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(40, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 10) < 0.1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.1); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(30.1, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.1); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(29.9, 0, 0)), s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_boxbox) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -3449,60 +3447,60 @@ BOOST_AUTO_TEST_CASE(shapeDistance_boxbox) FCL_REAL dist; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(20.1, 0, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(0, 20.2, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10.2) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10.2) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 10.1, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 0.1 * 1.414) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1 * 1.414) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(20.1, 0, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(0, 20.1, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s2, Transform3f(), s2, Transform3f(Vec3f(10.1, 10.1, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 0.1 * 1.414) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1 * 1.414) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(15.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(20, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 5) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(20, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 5) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_boxsphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxsphere) { Sphere s1(20); Box s2(5, 5, 5); @@ -3514,31 +3512,31 @@ BOOST_AUTO_TEST_CASE(shapeDistance_boxsphere) FCL_REAL dist; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(22.6, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(22.6, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.05); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.05); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 17.5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 17.5) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 17.5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 17.5) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_cylindercylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -3550,31 +3548,31 @@ BOOST_AUTO_TEST_CASE(shapeDistance_cylindercylinder) FCL_REAL dist; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_conecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -3586,31 +3584,31 @@ BOOST_AUTO_TEST_CASE(shapeDistance_conecone) FCL_REAL dist; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(0, 0, 40)), &dist); - BOOST_CHECK(fabs(dist - 30) < 1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 1); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(0, 0, 40)), &dist); - BOOST_CHECK(fabs(dist - 30) < 1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 1); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_conecylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecylinder) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -3622,31 +3620,31 @@ BOOST_AUTO_TEST_CASE(shapeDistance_conecylinder) FCL_REAL dist; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.01); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.01); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.02); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.02); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.01); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.01); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.1); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.1); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistance_ellipsoidellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -3659,53 +3657,53 @@ BOOST_AUTO_TEST_CASE(shapeDistance_ellipsoidellipsoid) Vec3f closest_p1, closest_p2; res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist, &closest_p1, &closest_p2); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(40, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(30.1, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, Transform3f(Vec3f(29.9, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(40, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(30.1, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver1.shapeDistance(s1, transform * Transform3f(Vec3f(29.9, 0, 0)), s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); } // Shape intersection test coverage (built-in GJK) @@ -3732,7 +3730,7 @@ BOOST_AUTO_TEST_CASE(shapeDistance_ellipsoidellipsoid) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spheresphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -3834,7 +3832,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spheresphere) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_boxbox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -3902,7 +3900,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_boxbox) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, true, contacts, false, false, true); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spherebox) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherebox) { Sphere s1(20); Box s2(5, 5, 5); @@ -3951,7 +3949,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spherebox) // built-in GJK solver returns incorrect normal. } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spherecapsule) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherecapsule) { Sphere s1(20); Capsule s2(5, 10); @@ -3999,7 +3997,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spherecapsule) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_cylindercylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -4048,7 +4046,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_cylindercylinder) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_conecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -4108,7 +4106,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_conecone) // built-in GJK solver returns incorrect normal. } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_cylindercone) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercone) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -4176,7 +4174,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_cylindercone) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_ellipsoidellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -4247,7 +4245,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_ellipsoidellipsoid) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spheretriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheretriangle) { Sphere s(10); Vec3f t[3]; @@ -4264,30 +4262,30 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_spheretriangle) bool res; res = solver2.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(30, 0, 0); t[1].setValue(9.9, -20, 0); t[2].setValue(9.9, 20, 0); res = solver2.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(s, Transform3f(), t[0], t[1], t[2], NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver2.shapeTriangleIntersect(s, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_halfspacetriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_halfspacetriangle) { Halfspace hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -4304,31 +4302,31 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_halfspacetriangle) bool res; res = solver2.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(20, 0, 0); t[1].setValue(-0.1, -20, 0); t[2].setValue(-0.1, 20, 0); res = solver2.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver2.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_planetriangle) +TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_planetriangle) { Plane hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -4345,28 +4343,28 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_planetriangle) bool res; res = solver1.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver1.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); t[0].setValue(20, 0, 0); t[1].setValue(-0.1, -20, 0); t[2].setValue(-0.1, 20, 0); res = solver2.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, NULL); - BOOST_CHECK(res); + EXPECT_TRUE(res); res = solver2.shapeTriangleIntersect(hs, Transform3f(), t[0], t[1], t[2], Transform3f(), NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(Vec3f(1, 0, 0), 1e-9)); res = solver2.shapeTriangleIntersect(hs, transform, t[0], t[1], t[2], transform, NULL, NULL, &normal); - BOOST_CHECK(res); - BOOST_CHECK(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); + EXPECT_TRUE(res); + EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } // Shape distance test coverage (built-in GJK) @@ -4393,7 +4391,7 @@ BOOST_AUTO_TEST_CASE(shapeIntersectionGJK_planetriangle) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_spheresphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -4405,56 +4403,56 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_spheresphere) FCL_REAL dist = -1; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(40, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(30.1, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(29.9, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(40, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(30.1, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(29.9, 0, 0)), s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_boxbox) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -4466,31 +4464,31 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_boxbox) FCL_REAL dist; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(15.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(15.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(20, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 5) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(20, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 5) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_boxsphere) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxsphere) { Sphere s1(20); Box s2(5, 5, 5); @@ -4502,31 +4500,31 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_boxsphere) FCL_REAL dist; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(22.6, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.01); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.01); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(22.6, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.01); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.01); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 17.5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 17.5) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 17.5) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 17.5) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_cylindercylinder) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -4538,31 +4536,31 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_cylindercylinder) FCL_REAL dist; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_conecone) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -4574,31 +4572,31 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_conecone) FCL_REAL dist; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(10.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(0, 0, 40)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(0, 0, 40)), &dist); - BOOST_CHECK(fabs(dist - 30) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 30) < 0.001); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(shapeDistanceGJK_ellipsoidellipsoid) +TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -4610,52 +4608,52 @@ BOOST_AUTO_TEST_CASE(shapeDistanceGJK_ellipsoidellipsoid) FCL_REAL dist = -1; res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(), s2, Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(40, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(30.1, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, Transform3f(Vec3f(29.9, 0, 0)), s2, Transform3f(), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(40, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(30.1, 0, 0)), &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform, s2, transform * Transform3f(Vec3f(29.9, 0, 0)), &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(40, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 10) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 10) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(30.1, 0, 0)), s2, transform, &dist); - BOOST_CHECK(fabs(dist - 0.1) < 0.001); - BOOST_CHECK(res); + EXPECT_TRUE(fabs(dist - 0.1) < 0.001); + EXPECT_TRUE(res); res = solver2.shapeDistance(s1, transform * Transform3f(Vec3f(29.9, 0, 0)), s2, transform, &dist); - BOOST_CHECK(dist < 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE(dist < 0); + EXPECT_TRUE_FALSE(res); } template @@ -4679,9 +4677,9 @@ void testReversibleShapeIntersection(const S1& s1, const S2& s2, FCL_REAL distan for (size_t i = 0; i < contactsB.size(); ++i) contactsB[i].normal = -contactsB[i].normal; - BOOST_CHECK(resA); - BOOST_CHECK(resB); - BOOST_CHECK(inspectContactPoints(s1, tf1, s2, tf2, GST_LIBCCD, + EXPECT_TRUE(resA); + EXPECT_TRUE(resB); + EXPECT_TRUE(inspectContactPoints(s1, tf1, s2, tf2, GST_LIBCCD, contactsA, contactsB, true, true, true, false, tol)); @@ -4692,14 +4690,14 @@ void testReversibleShapeIntersection(const S1& s1, const S2& s2, FCL_REAL distan for (size_t i = 0; i < contactsB.size(); ++i) contactsB[i].normal = -contactsB[i].normal; - BOOST_CHECK(resA); - BOOST_CHECK(resB); - BOOST_CHECK(inspectContactPoints(s1, tf1, s2, tf2, GST_INDEP, + EXPECT_TRUE(resA); + EXPECT_TRUE(resB); + EXPECT_TRUE(inspectContactPoints(s1, tf1, s2, tf2, GST_INDEP, contactsA, contactsB, true, true, true, false, tol)); } -BOOST_AUTO_TEST_CASE(reversibleShapeIntersection_allshapes) +TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeIntersection_allshapes) { // This test check whether a shape intersection algorithm is called for the // reverse case as well. For example, if FCL has sphere-capsule intersection @@ -4779,23 +4777,23 @@ void testReversibleShapeDistance(const S1& s1, const S2& s2, FCL_REAL distance) resA = solver1.shapeDistance(s1, tf1, s2, tf2, &distA, &p1A, &p2A); resB = solver1.shapeDistance(s2, tf2, s1, tf1, &distB, &p1B, &p2B); - BOOST_CHECK(resA); - BOOST_CHECK(resB); - BOOST_CHECK_CLOSE(distA, distB, tol); // distances should be same - BOOST_CHECK(p1A.equal(p2B, tol)); // closest points should in reverse order - BOOST_CHECK(p2A.equal(p1B, tol)); + EXPECT_TRUE(resA); + EXPECT_TRUE(resB); + EXPECT_NEAR(distA, distB, tol); // distances should be same + EXPECT_TRUE(p1A.equal(p2B, tol)); // closest points should in reverse order + EXPECT_TRUE(p2A.equal(p1B, tol)); resA = solver2.shapeDistance(s1, tf1, s2, tf2, &distA, &p1A, &p2A); resB = solver2.shapeDistance(s2, tf2, s1, tf1, &distB, &p1B, &p2B); - BOOST_CHECK(resA); - BOOST_CHECK(resB); - BOOST_CHECK_CLOSE(distA, distB, tol); - BOOST_CHECK(p1A.equal(p2B, tol)); - BOOST_CHECK(p2A.equal(p1B, tol)); + EXPECT_TRUE(resA); + EXPECT_TRUE(resB); + EXPECT_NEAR(distA, distB, tol); + EXPECT_TRUE(p1A.equal(p2B, tol)); + EXPECT_TRUE(p2A.equal(p1B, tol)); } -BOOST_AUTO_TEST_CASE(reversibleShapeDistance_allshapes) +TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeDistance_allshapes) { // This test check whether a shape distance algorithm is called for the // reverse case as well. For example, if FCL has sphere-capsule distance @@ -4854,3 +4852,9 @@ BOOST_AUTO_TEST_CASE(reversibleShapeDistance_allshapes) // testReversibleShapeDistance(plane, halfspace, distance); } +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_math.cpp b/test/test_fcl_math.cpp index aa2bf2fc3..1f514082b 100644 --- a/test/test_fcl_math.cpp +++ b/test/test_fcl_math.cpp @@ -34,9 +34,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#define BOOST_TEST_MODULE "FCL_MATH" -#include +#include #if FCL_HAVE_SSE #include "fcl/simd/math_simd_details.h" @@ -48,241 +46,241 @@ using namespace fcl; -BOOST_AUTO_TEST_CASE(vec_test_basic_vec32) +TEST(FCL_MATH, vec_test_basic_vec32) { typedef Vec3fX > Vec3f32; Vec3f32 v1(1.0f, 2.0f, 3.0f); - BOOST_CHECK(v1[0] == 1.0f); - BOOST_CHECK(v1[1] == 2.0f); - BOOST_CHECK(v1[2] == 3.0f); + EXPECT_TRUE(v1[0] == 1.0f); + EXPECT_TRUE(v1[1] == 2.0f); + EXPECT_TRUE(v1[2] == 3.0f); Vec3f32 v2 = v1; Vec3f32 v3(3.3f, 4.3f, 5.3f); v1 += v3; - BOOST_CHECK(v1.equal(v2 + v3)); + EXPECT_TRUE(v1.equal(v2 + v3)); v1 -= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= v3; - BOOST_CHECK(v1.equal(v2 - v3)); + EXPECT_TRUE(v1.equal(v2 - v3)); v1 += v3; v1 *= v3; - BOOST_CHECK(v1.equal(v2 * v3)); + EXPECT_TRUE(v1.equal(v2 * v3)); v1 /= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= v3; - BOOST_CHECK(v1.equal(v2 / v3)); + EXPECT_TRUE(v1.equal(v2 / v3)); v1 *= v3; v1 *= 2.0f; - BOOST_CHECK(v1.equal(v2 * 2.0f)); + EXPECT_TRUE(v1.equal(v2 * 2.0f)); v1 /= 2.0f; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= 2.0f; - BOOST_CHECK(v1.equal(v2 / 2.0f)); + EXPECT_TRUE(v1.equal(v2 / 2.0f)); v1 *= 2.0f; v1 += 2.0f; - BOOST_CHECK(v1.equal(v2 + 2.0f)); + EXPECT_TRUE(v1.equal(v2 + 2.0f)); v1 -= 2.0f; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= 2.0f; - BOOST_CHECK(v1.equal(v2 - 2.0f)); + EXPECT_TRUE(v1.equal(v2 - 2.0f)); v1 += 2.0f; - BOOST_CHECK((-Vec3f32(1.0f, 2.0f, 3.0f)).equal(Vec3f32(-1.0f, -2.0f, -3.0f))); + EXPECT_TRUE((-Vec3f32(1.0f, 2.0f, 3.0f)).equal(Vec3f32(-1.0f, -2.0f, -3.0f))); v1 = Vec3f32(1.0f, 2.0f, 3.0f); v2 = Vec3f32(3.0f, 4.0f, 5.0f); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f32(-2.0f, 4.0f, -2.0f))); - BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f32(-2.0f, 4.0f, -2.0f))); + EXPECT_TRUE(std::abs(v1.dot(v2) - 26) < 1e-5); v1 = Vec3f32(3.0f, 4.0f, 5.0f); - BOOST_CHECK(std::abs(v1.sqrLength() - 50.0) < 1e-5); - BOOST_CHECK(std::abs(v1.length() - sqrt(50.0)) < 1e-5); - BOOST_CHECK(normalize(v1).equal(v1 / v1.length())); + EXPECT_TRUE(std::abs(v1.sqrLength() - 50.0) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - sqrt(50.0)) < 1e-5); + EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); } -BOOST_AUTO_TEST_CASE(vec_test_basic_vec64) +TEST(FCL_MATH, vec_test_basic_vec64) { typedef Vec3fX > Vec3f64; Vec3f64 v1(1.0, 2.0, 3.0); - BOOST_CHECK(v1[0] == 1.0); - BOOST_CHECK(v1[1] == 2.0); - BOOST_CHECK(v1[2] == 3.0); + EXPECT_TRUE(v1[0] == 1.0); + EXPECT_TRUE(v1[1] == 2.0); + EXPECT_TRUE(v1[2] == 3.0); Vec3f64 v2 = v1; Vec3f64 v3(3.3, 4.3, 5.3); v1 += v3; - BOOST_CHECK(v1.equal(v2 + v3)); + EXPECT_TRUE(v1.equal(v2 + v3)); v1 -= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= v3; - BOOST_CHECK(v1.equal(v2 - v3)); + EXPECT_TRUE(v1.equal(v2 - v3)); v1 += v3; v1 *= v3; - BOOST_CHECK(v1.equal(v2 * v3)); + EXPECT_TRUE(v1.equal(v2 * v3)); v1 /= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= v3; - BOOST_CHECK(v1.equal(v2 / v3)); + EXPECT_TRUE(v1.equal(v2 / v3)); v1 *= v3; v1 *= 2.0; - BOOST_CHECK(v1.equal(v2 * 2.0)); + EXPECT_TRUE(v1.equal(v2 * 2.0)); v1 /= 2.0; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= 2.0; - BOOST_CHECK(v1.equal(v2 / 2.0)); + EXPECT_TRUE(v1.equal(v2 / 2.0)); v1 *= 2.0; v1 += 2.0; - BOOST_CHECK(v1.equal(v2 + 2.0)); + EXPECT_TRUE(v1.equal(v2 + 2.0)); v1 -= 2.0; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= 2.0; - BOOST_CHECK(v1.equal(v2 - 2.0)); + EXPECT_TRUE(v1.equal(v2 - 2.0)); v1 += 2.0; - BOOST_CHECK((-Vec3f64(1.0, 2.0, 3.0)).equal(Vec3f64(-1.0, -2.0, -3.0))); + EXPECT_TRUE((-Vec3f64(1.0, 2.0, 3.0)).equal(Vec3f64(-1.0, -2.0, -3.0))); v1 = Vec3f64(1.0, 2.0, 3.0); v2 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); - BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); + EXPECT_TRUE(std::abs(v1.dot(v2) - 26) < 1e-5); v1 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK(std::abs(v1.sqrLength() - 50.0) < 1e-5); - BOOST_CHECK(std::abs(v1.length() - sqrt(50.0)) < 1e-5); - BOOST_CHECK(normalize(v1).equal(v1 / v1.length())); + EXPECT_TRUE(std::abs(v1.sqrLength() - 50.0) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - sqrt(50.0)) < 1e-5); + EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); v1 = Vec3f64(1.0, 2.0, 3.0); v2 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); - BOOST_CHECK(v1.dot(v2) == 26); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); + EXPECT_TRUE(v1.dot(v2) == 26); } #if FCL_HAVE_SSE -BOOST_AUTO_TEST_CASE(vec_test_sse_vec32) +TEST(FCL_MATH, vec_test_sse_vec32) { typedef Vec3fX Vec3f32; Vec3f32 v1(1.0f, 2.0f, 3.0f); - BOOST_CHECK(v1[0] == 1.0f); - BOOST_CHECK(v1[1] == 2.0f); - BOOST_CHECK(v1[2] == 3.0f); + EXPECT_TRUE(v1[0] == 1.0f); + EXPECT_TRUE(v1[1] == 2.0f); + EXPECT_TRUE(v1[2] == 3.0f); Vec3f32 v2 = v1; Vec3f32 v3(3.3f, 4.3f, 5.3f); v1 += v3; - BOOST_CHECK(v1.equal(v2 + v3)); + EXPECT_TRUE(v1.equal(v2 + v3)); v1 -= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= v3; - BOOST_CHECK(v1.equal(v2 - v3)); + EXPECT_TRUE(v1.equal(v2 - v3)); v1 += v3; v1 *= v3; - BOOST_CHECK(v1.equal(v2 * v3)); + EXPECT_TRUE(v1.equal(v2 * v3)); v1 /= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= v3; - BOOST_CHECK(v1.equal(v2 / v3)); + EXPECT_TRUE(v1.equal(v2 / v3)); v1 *= v3; v1 *= 2.0f; - BOOST_CHECK(v1.equal(v2 * 2.0f)); + EXPECT_TRUE(v1.equal(v2 * 2.0f)); v1 /= 2.0f; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= 2.0f; - BOOST_CHECK(v1.equal(v2 / 2.0f)); + EXPECT_TRUE(v1.equal(v2 / 2.0f)); v1 *= 2.0f; v1 += 2.0f; - BOOST_CHECK(v1.equal(v2 + 2.0f)); + EXPECT_TRUE(v1.equal(v2 + 2.0f)); v1 -= 2.0f; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= 2.0f; - BOOST_CHECK(v1.equal(v2 - 2.0f)); + EXPECT_TRUE(v1.equal(v2 - 2.0f)); v1 += 2.0f; - BOOST_CHECK((-Vec3f32(1.0f, 2.0f, 3.0f)).equal(Vec3f32(-1.0f, -2.0f, -3.0f))); + EXPECT_TRUE((-Vec3f32(1.0f, 2.0f, 3.0f)).equal(Vec3f32(-1.0f, -2.0f, -3.0f))); v1 = Vec3f32(1.0f, 2.0f, 3.0f); v2 = Vec3f32(3.0f, 4.0f, 5.0f); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f32(-2.0f, 4.0f, -2.0f))); - BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f32(-2.0f, 4.0f, -2.0f))); + EXPECT_TRUE(std::abs(v1.dot(v2) - 26) < 1e-5); v1 = Vec3f32(3.0f, 4.0f, 5.0f); - BOOST_CHECK(std::abs(v1.sqrLength() - 50) < 1e-5); - BOOST_CHECK(std::abs(v1.length() - sqrt(50)) < 1e-5); - BOOST_CHECK(normalize(v1).equal(v1 / v1.length())); + EXPECT_TRUE(std::abs(v1.sqrLength() - 50) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - sqrt(50)) < 1e-5); + EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); } -BOOST_AUTO_TEST_CASE(vec_test_sse_vec64) +TEST(FCL_MATH, vec_test_sse_vec64) { typedef Vec3fX Vec3f64; Vec3f64 v1(1.0, 2.0, 3.0); - BOOST_CHECK(v1[0] == 1.0); - BOOST_CHECK(v1[1] == 2.0); - BOOST_CHECK(v1[2] == 3.0); + EXPECT_TRUE(v1[0] == 1.0); + EXPECT_TRUE(v1[1] == 2.0); + EXPECT_TRUE(v1[2] == 3.0); Vec3f64 v2 = v1; Vec3f64 v3(3.3, 4.3, 5.3); v1 += v3; - BOOST_CHECK(v1.equal(v2 + v3)); + EXPECT_TRUE(v1.equal(v2 + v3)); v1 -= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= v3; - BOOST_CHECK(v1.equal(v2 - v3)); + EXPECT_TRUE(v1.equal(v2 - v3)); v1 += v3; v1 *= v3; - BOOST_CHECK(v1.equal(v2 * v3)); + EXPECT_TRUE(v1.equal(v2 * v3)); v1 /= v3; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= v3; - BOOST_CHECK(v1.equal(v2 / v3)); + EXPECT_TRUE(v1.equal(v2 / v3)); v1 *= v3; v1 *= 2.0; - BOOST_CHECK(v1.equal(v2 * 2.0)); + EXPECT_TRUE(v1.equal(v2 * 2.0)); v1 /= 2.0; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 /= 2.0; - BOOST_CHECK(v1.equal(v2 / 2.0)); + EXPECT_TRUE(v1.equal(v2 / 2.0)); v1 *= 2.0; v1 += 2.0; - BOOST_CHECK(v1.equal(v2 + 2.0)); + EXPECT_TRUE(v1.equal(v2 + 2.0)); v1 -= 2.0; - BOOST_CHECK(v1.equal(v2)); + EXPECT_TRUE(v1.equal(v2)); v1 -= 2.0; - BOOST_CHECK(v1.equal(v2 - 2.0)); + EXPECT_TRUE(v1.equal(v2 - 2.0)); v1 += 2.0; - BOOST_CHECK((-Vec3f64(1.0, 2.0, 3.0)).equal(Vec3f64(-1.0, -2.0, -3.0))); + EXPECT_TRUE((-Vec3f64(1.0, 2.0, 3.0)).equal(Vec3f64(-1.0, -2.0, -3.0))); v1 = Vec3f64(1.0, 2.0, 3.0); v2 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); - BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); + EXPECT_TRUE(std::abs(v1.dot(v2) - 26) < 1e-5); v1 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK(std::abs(v1.sqrLength() - 50) < 1e-5); - BOOST_CHECK(std::abs(v1.length() - sqrt(50)) < 1e-5); - BOOST_CHECK(normalize(v1).equal(v1 / v1.length())); + EXPECT_TRUE(std::abs(v1.sqrLength() - 50) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - sqrt(50)) < 1e-5); + EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); v1 = Vec3f64(1.0, 2.0, 3.0); v2 = Vec3f64(3.0, 4.0, 5.0); - BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); - BOOST_CHECK(v1.dot(v2) == 26); + EXPECT_TRUE((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0))); + EXPECT_TRUE(v1.dot(v2) == 26); } -BOOST_AUTO_TEST_CASE(sse_mat32_consistent) +TEST(FCL_MATH, sse_mat32_consistent) { typedef Vec3fX > Vec3f32; typedef Vec3fX Vec3f32SSE; @@ -298,38 +296,38 @@ BOOST_AUTO_TEST_CASE(sse_mat32_consistent) for(size_t i = 0; i < 3; ++i) for(size_t j = 0; j < 3; ++j) - BOOST_CHECK((m1(i, j) - m2(i, j) < 1e-1)); + EXPECT_TRUE((m1(i, j) - m2(i, j) < 1e-1)); Matrix3f32 m3(transpose(m1)); Matrix3f32SSE m4(transpose(m2)); for(size_t i = 0; i < 3; ++i) for(size_t j = 0; j < 3; ++j) - BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1)); + EXPECT_TRUE((m3(i, j) - m4(i, j) < 1e-1)); m3 = m1; m3.transpose(); m4 = m2; m4.transpose(); for(size_t i = 0; i < 3; ++i) for(size_t j = 0; j < 3; ++j) - BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1)); + EXPECT_TRUE((m3(i, j) - m4(i, j) < 1e-1)); m3 = inverse(m1); m4 = inverse(m2); for(size_t i = 0; i < 3; ++i) for(size_t j = 0; j < 3; ++j) - BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1)); + EXPECT_TRUE((m3(i, j) - m4(i, j) < 1e-1)); m3 = m1; m3.inverse(); m4 = m2; m4.inverse(); for(size_t i = 0; i < 3; ++i) for(size_t j = 0; j < 3; ++j) - BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1)); + EXPECT_TRUE((m3(i, j) - m4(i, j) < 1e-1)); } -BOOST_AUTO_TEST_CASE(vec_test_sse_vec32_consistent) +TEST(FCL_MATH, vec_test_sse_vec32_consistent) { typedef Vec3fX > Vec3f32; typedef Vec3fX Vec3f32SSE; @@ -338,146 +336,146 @@ BOOST_AUTO_TEST_CASE(vec_test_sse_vec32_consistent) Vec3f32SSE v3(3.4f, 4.2f, 10.5f), v4(3.1f, 0.1f, -50.4f); Vec3f32 v12 = v1 + v2; Vec3f32SSE v34 = v3 + v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 - v2; v34 = v3 - v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 * v2; v34 = v3 * v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 / v2; v34 = v3 / v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); float t = 1234.433f; v12 = v1 + t; v34 = v3 + t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 - t; v34 = v3 - t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 * t; v34 = v3 * t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 / t; v34 = v3 / t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 += v2; v34 = v3; v34 += v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 -= v2; v34 = v3; v34 -= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 *= v2; v34 = v3; v34 *= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 /= v2; v34 = v3; v34 /= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 += t; v34 = v3; v34 += t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 -= t; v34 = v3; v34 -= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 *= t; v34 = v3; v34 *= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 /= t; v34 = v3; v34 /= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = -v1; v34 = -v3; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1.cross(v2); v34 = v3.cross(v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); - BOOST_CHECK(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-5); + EXPECT_TRUE(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-5); v12 = min(v1, v2); v34 = min(v3, v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = max(v1, v2); v34 = max(v3, v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = abs(v2); v34 = abs(v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); Vec3f32 delta1(1e-9f, 1e-9f, 1e-9f); Vec3f32SSE delta2(1e-9f, 1e-9f, 1e-9f); - BOOST_CHECK((v1 + delta1).equal(v1)); - BOOST_CHECK((v3 + delta2).equal(v3)); + EXPECT_TRUE((v1 + delta1).equal(v1)); + EXPECT_TRUE((v3 + delta2).equal(v3)); - BOOST_CHECK(std::abs(v1.length() - v3.length()) < 1e-5); - BOOST_CHECK(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - v3.length()) < 1e-5); + EXPECT_TRUE(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5); v12 = v1; v12.negate(); v34 = v3; v34.negate(); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12.normalize(); v34 = v3; v34.normalize(); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = normalize(v1); v34 = normalize(v3); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); } -BOOST_AUTO_TEST_CASE(vec_test_sse_vec64_consistent) +TEST(FCL_MATH, vec_test_sse_vec64_consistent) { typedef Vec3fX > Vec3f64; typedef Vec3fX Vec3f64SSE; @@ -486,148 +484,148 @@ BOOST_AUTO_TEST_CASE(vec_test_sse_vec64_consistent) Vec3f64SSE v3(3.4, 4.2, 10.5), v4(3.1, 0.1, -50.4); Vec3f64 v12 = v1 + v2; Vec3f64SSE v34 = v3 + v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 - v2; v34 = v3 - v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 * v2; v34 = v3 * v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 / v2; v34 = v3 / v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); double t = 1234.433; v12 = v1 + t; v34 = v3 + t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 - t; v34 = v3 - t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 * t; v34 = v3 * t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1 / t; v34 = v3 / t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 += v2; v34 = v3; v34 += v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 -= v2; v34 = v3; v34 -= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 *= v2; v34 = v3; v34 *= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 /= v2; v34 = v3; v34 /= v4; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 += t; v34 = v3; v34 += t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 -= t; v34 = v3; v34 -= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 *= t; v34 = v3; v34 *= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12 /= t; v34 = v3; v34 /= t; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = -v1; v34 = -v3; - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1.cross(v2); v34 = v3.cross(v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); - BOOST_CHECK(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-5); + EXPECT_TRUE(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-5); v12 = min(v1, v2); v34 = min(v3, v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = max(v1, v2); v34 = max(v3, v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = abs(v2); v34 = abs(v4); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); Vec3f64 delta1(1e-15, 1e-15, 1e-15); Vec3f64SSE delta2(1e-15, 1e-15, 1e-15); - BOOST_CHECK((v1 + delta1).equal(v1)); - BOOST_CHECK((v3 + delta2).equal(v3)); + EXPECT_TRUE((v1 + delta1).equal(v1)); + EXPECT_TRUE((v3 + delta2).equal(v3)); - BOOST_CHECK(std::abs(v1.length() - v3.length()) < 1e-5); - BOOST_CHECK(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5); + EXPECT_TRUE(std::abs(v1.length() - v3.length()) < 1e-5); + EXPECT_TRUE(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5); v12 = v1; v12.negate(); v34 = v3; v34.negate(); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = v1; v12.normalize(); v34 = v3; v34.normalize(); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); v12 = normalize(v1); v34 = normalize(v3); - BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5); - BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5); - BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5); + EXPECT_TRUE(std::abs(v12[0] - v34[0]) < 1e-5); + EXPECT_TRUE(std::abs(v12[1] - v34[1]) < 1e-5); + EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); } #endif -BOOST_AUTO_TEST_CASE(morton) +TEST(FCL_MATH, morton) { AABB bbox(Vec3f(0, 0, 0), Vec3f(1000, 1000, 1000)); morton_functor> F1(bbox); @@ -637,6 +635,13 @@ BOOST_AUTO_TEST_CASE(morton) Vec3f p(254, 873, 674); - BOOST_CHECK(F1(p).to_ulong() == F4(p)); - BOOST_CHECK(F2(p).to_ullong() == F3(p)); + EXPECT_TRUE(F1(p).to_ulong() == F4(p)); + EXPECT_TRUE(F2(p).to_ullong() == F3(p)); +} + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } diff --git a/test/test_fcl_octomap.cpp b/test/test_fcl_octomap.cpp index 4dbda4e19..db52e2f59 100644 --- a/test/test_fcl_octomap.cpp +++ b/test/test_fcl_octomap.cpp @@ -35,8 +35,7 @@ /** \author Jia Pan */ -#define BOOST_TEST_MODULE "FCL_OCTOMAP" -#include +#include #include "fcl/config.h" #include "fcl/octree.h" @@ -102,19 +101,19 @@ void octomap_collision_test_BVH(std::size_t n, bool exhaustive); template void octomap_distance_test_BVH(std::size_t n); -BOOST_AUTO_TEST_CASE(test_octomap_cost) +TEST(FCL_OCTOMAP, test_octomap_cost) { octomap_cost_test(200, 100, 10, false, false); octomap_cost_test(200, 1000, 10, false, false); } -BOOST_AUTO_TEST_CASE(test_octomap_cost_mesh) +TEST(FCL_OCTOMAP, test_octomap_cost_mesh) { octomap_cost_test(200, 100, 10, true, false); octomap_cost_test(200, 1000, 10, true, false); } -BOOST_AUTO_TEST_CASE(test_octomap_collision) +TEST(FCL_OCTOMAP, test_octomap_collision) { octomap_collision_test(200, 100, false, 10, false, false); octomap_collision_test(200, 1000, false, 10, false, false); @@ -122,7 +121,7 @@ BOOST_AUTO_TEST_CASE(test_octomap_collision) octomap_collision_test(200, 1000, true, 1, false, false); } -BOOST_AUTO_TEST_CASE(test_octomap_collision_mesh) +TEST(FCL_OCTOMAP, test_octomap_collision_mesh) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_collision_test(200, 10, false, 10, true, true); @@ -137,13 +136,13 @@ BOOST_AUTO_TEST_CASE(test_octomap_collision_mesh) #endif } -BOOST_AUTO_TEST_CASE(test_octomap_collision_mesh_triangle_id) +TEST(FCL_OCTOMAP, test_octomap_collision_mesh_triangle_id) { octomap_collision_test_mesh_triangle_id(1, 30, 100000); } -BOOST_AUTO_TEST_CASE(test_octomap_collision_mesh_octomap_box) +TEST(FCL_OCTOMAP, test_octomap_collision_mesh_octomap_box) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_collision_test(200, 10, false, 10, true, false); @@ -158,13 +157,13 @@ BOOST_AUTO_TEST_CASE(test_octomap_collision_mesh_octomap_box) #endif } -BOOST_AUTO_TEST_CASE(test_octomap_distance) +TEST(FCL_OCTOMAP, test_octomap_distance) { octomap_distance_test(200, 100, false, false); octomap_distance_test(200, 1000, false, false); } -BOOST_AUTO_TEST_CASE(test_octomap_distance_mesh) +TEST(FCL_OCTOMAP, test_octomap_distance_mesh) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test(200, 5, true, true); @@ -175,7 +174,7 @@ BOOST_AUTO_TEST_CASE(test_octomap_distance_mesh) #endif } -BOOST_AUTO_TEST_CASE(test_octomap_distance_mesh_octomap_box) +TEST(FCL_OCTOMAP, test_octomap_distance_mesh_octomap_box) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test(200, 10, true, false); @@ -186,23 +185,23 @@ BOOST_AUTO_TEST_CASE(test_octomap_distance_mesh_octomap_box) #endif } -BOOST_AUTO_TEST_CASE(test_octomap_bvh_obb_collision_obb) +TEST(FCL_OCTOMAP, test_octomap_bvh_obb_collision_obb) { octomap_collision_test_BVH(5, false); octomap_collision_test_BVH(5, true); } -BOOST_AUTO_TEST_CASE(test_octomap_bvh_rss_d_distance_rss) +TEST(FCL_OCTOMAP, test_octomap_bvh_rss_d_distance_rss) { octomap_distance_test_BVH(5); } -BOOST_AUTO_TEST_CASE(test_octomap_bvh_obb_d_distance_obb) +TEST(FCL_OCTOMAP, test_octomap_bvh_obb_d_distance_obb) { octomap_distance_test_BVH(5); } -BOOST_AUTO_TEST_CASE(test_octomap_bvh_kios_d_distance_kios) +TEST(FCL_OCTOMAP, test_octomap_bvh_kios_d_distance_kios) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test_BVH(2); @@ -266,12 +265,12 @@ void octomap_collision_test_BVH(std::size_t n, bool exhaustive) if(exhaustive) { std::cout << cdata.result.numContacts() << " " << cdata2.result.numContacts() << std::endl; - BOOST_CHECK(cdata.result.numContacts() == cdata2.result.numContacts()); + EXPECT_TRUE(cdata.result.numContacts() == cdata2.result.numContacts()); } else { std::cout << (cdata.result.numContacts() > 0) << " " << (cdata2.result.numContacts() > 0) << std::endl; - BOOST_CHECK((cdata.result.numContacts() > 0) == (cdata2.result.numContacts() > 0)); + EXPECT_TRUE((cdata.result.numContacts() > 0) == (cdata2.result.numContacts() > 0)); } } } @@ -329,7 +328,7 @@ void octomap_distance_test_BVH(std::size_t n) delete manager; std::cout << dist1 << " " << dist2 << std::endl; - BOOST_CHECK(std::abs(dist1 - dist2) < 0.001); + EXPECT_TRUE(std::abs(dist1 - dist2) < 0.001); } } @@ -434,8 +433,8 @@ void octomap_cost_test(double env_scale, std::size_t env_size, std::size_t num_m } - if(use_mesh) BOOST_CHECK((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); - else BOOST_CHECK(cdata.result.numContacts() >= cdata2.result.numContacts()); + if(use_mesh) EXPECT_TRUE((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); + else EXPECT_TRUE(cdata.result.numContacts() >= cdata2.result.numContacts()); delete manager; delete manager2; @@ -526,13 +525,13 @@ void octomap_collision_test(double env_scale, std::size_t env_size, bool exhaust std::cout << cdata.result.numContacts() << " " << cdata3.result.numContacts() << " " << cdata2.result.numContacts() << std::endl; if(exhaustive) { - if(use_mesh) BOOST_CHECK((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); - else BOOST_CHECK(cdata.result.numContacts() == cdata2.result.numContacts()); + if(use_mesh) EXPECT_TRUE((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); + else EXPECT_TRUE(cdata.result.numContacts() == cdata2.result.numContacts()); } else { - if(use_mesh) BOOST_CHECK((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); - else BOOST_CHECK((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); // because AABB return collision when two boxes contact + if(use_mesh) EXPECT_TRUE((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); + else EXPECT_TRUE((cdata.result.numContacts() > 0) >= (cdata2.result.numContacts() > 0)); // because AABB return collision when two boxes contact } delete manager; @@ -571,7 +570,7 @@ void octomap_collision_test_mesh_triangle_id(double env_scale, std::size_t env_s { const Contact& contact = cResult.getContact(index); const fcl::BVHModel* surface = static_cast*> (contact.o2); - BOOST_CHECK(surface->num_tris > contact.b2); + EXPECT_TRUE(surface->num_tris > contact.b2); } } } @@ -643,9 +642,9 @@ void octomap_distance_test(double env_scale, std::size_t env_size, bool use_mesh std::cout << cdata.result.min_distance << " " << cdata3.result.min_distance << " " << cdata2.result.min_distance << std::endl; if(cdata.result.min_distance < 0) - BOOST_CHECK(cdata2.result.min_distance <= 0); + EXPECT_TRUE(cdata2.result.min_distance <= 0); else - BOOST_CHECK(std::abs(cdata.result.min_distance - cdata2.result.min_distance) < 1e-3); + EXPECT_TRUE(std::abs(cdata.result.min_distance - cdata2.result.min_distance) < 1e-3); delete manager; delete manager2; @@ -807,4 +806,9 @@ octomap::OcTree* generateOcTree() return tree; } - +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/test_fcl_shape_mesh_consistency.cpp b/test/test_fcl_shape_mesh_consistency.cpp index 75074ac60..41320a8e6 100644 --- a/test/test_fcl_shape_mesh_consistency.cpp +++ b/test/test_fcl_shape_mesh_consistency.cpp @@ -35,8 +35,7 @@ /** \author Jia Pan */ -#define BOOST_TEST_MODULE "FCL_SHAPE_MESH_CONSISTENCY" -#include +#include #include "fcl/narrowphase/narrowphase.h" #include "fcl/shape/geometric_shape_to_BVH_model.h" @@ -47,11 +46,11 @@ using namespace fcl; -#define BOOST_CHECK_FALSE(p) BOOST_CHECK(!(p)) +#define EXPECT_TRUE_FALSE(p) EXPECT_TRUE(!(p)) FCL_REAL extents[6] = {0, 0, 0, 10, 10, 10}; -BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_libccd) { Sphere s1(20); Sphere s2(20); @@ -71,15 +70,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) { @@ -92,15 +91,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(40.1, 0, 0)); @@ -108,15 +107,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_libccd) res.clear(), res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) @@ -130,19 +129,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_libccd) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -162,15 +161,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) { @@ -183,15 +182,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(30.1, 0, 0)); @@ -199,15 +198,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_libccd) res.clear(), res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -220,19 +219,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_libccd) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -253,15 +252,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); for(std::size_t i = 0; i < 10; ++i) { @@ -274,15 +273,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); } pose.setTranslation(Vec3f(15.1, 0, 0)); @@ -290,15 +289,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -311,19 +310,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_libccd) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -344,15 +343,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); for(std::size_t i = 0; i < 10; ++i) { @@ -365,15 +364,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); } pose.setTranslation(Vec3f(15, 0, 0)); // libccd cannot use small value here :( @@ -381,15 +380,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -402,19 +401,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_conecone_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_libccd) { Cone s1(5, 10); Cone s2(5, 10); @@ -435,14 +434,14 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) { @@ -455,15 +454,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(15, 0, 0)); // libccd cannot use small value here :( @@ -471,15 +470,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_libccd) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -492,20 +491,20 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_libccd) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_GJK) { Sphere s1(20); Sphere s2(20); @@ -526,15 +525,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) @@ -548,15 +547,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(40.1, 0, 0)); @@ -564,15 +563,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); for(std::size_t i = 0; i < 10; ++i) @@ -586,19 +585,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); } } -BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_GJK) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -619,15 +618,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) @@ -641,15 +640,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(30.1, 0, 0)); @@ -657,15 +656,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); for(std::size_t i = 0; i < 10; ++i) @@ -679,19 +678,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_ellipsoidellipsoid_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 4); } } -BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_GJK) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -713,15 +712,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); for(std::size_t i = 0; i < 10; ++i) { @@ -734,15 +733,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.01); } pose.setTranslation(Vec3f(15.1, 0, 0)); @@ -750,15 +749,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -771,19 +770,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_boxbox_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_GJK) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -805,15 +804,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) { @@ -829,21 +828,21 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_GJK) if(fabs(res1.min_distance - res.min_distance) / res.min_distance > 0.05) std::cout << "low resolution: " << res1.min_distance << " " << res.min_distance << std::endl; else - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); if(fabs(res1.min_distance - res.min_distance) / res.min_distance > 0.05) std::cout << "low resolution: " << res1.min_distance << " " << res.min_distance << std::endl; else - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); if(fabs(res1.min_distance - res.min_distance) / res.min_distance > 0.05) std::cout << "low resolution: " << res1.min_distance << " " << res.min_distance << std::endl; else - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(10.1, 0, 0)); @@ -851,15 +850,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -872,19 +871,19 @@ BOOST_AUTO_TEST_CASE(consistency_distance_cylindercylinder_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_distance_conecone_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_GJK) { Cone s1(5, 10); Cone s2(5, 10); @@ -906,15 +905,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); for(std::size_t i = 0; i < 10; ++i) { @@ -927,15 +926,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 0.05); } pose.setTranslation(Vec3f(10.1, 0, 0)); @@ -943,15 +942,15 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_GJK) res.clear(); res1.clear(); distance(&s1, Transform3f(), &s2, pose, request, res); distance(&s1_rss, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, Transform3f(), &s2_rss, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, Transform3f(), &s2, pose, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); for(std::size_t i = 0; i < 10; ++i) { @@ -964,21 +963,21 @@ BOOST_AUTO_TEST_CASE(consistency_distance_conecone_GJK) res.clear(); res1.clear(); distance(&s1, pose1, &s2, pose2, request, res); distance(&s1_rss, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1, pose1, &s2_rss, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); res1.clear(); distance(&s1_rss, pose1, &s2, pose2, request, res1); - BOOST_CHECK(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); + EXPECT_TRUE(fabs(res1.min_distance - res.min_distance) / res.min_distance < 2); } } -BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_libccd) { Sphere s1(20); Sphere s2(10); @@ -1007,31 +1006,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(40, 0, 0)); pose_aabb.setTranslation(Vec3f(40, 0, 0)); @@ -1039,31 +1038,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(30, 0, 0)); pose_aabb.setTranslation(Vec3f(30, 0, 0)); @@ -1071,31 +1070,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(29.9, 0, 0)); pose_aabb.setTranslation(Vec3f(29.8, 0, 0)); // 29.9 fails, result depends on mesh precision @@ -1103,31 +1102,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-29.9, 0, 0)); @@ -1136,31 +1135,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-30, 0, 0)); pose_aabb.setTranslation(Vec3f(-30, 0, 0)); @@ -1168,34 +1167,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_libccd) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -1224,31 +1223,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(40, 0, 0)); pose_aabb.setTranslation(Vec3f(40, 0, 0)); @@ -1256,31 +1255,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(30, 0, 0)); pose_aabb.setTranslation(Vec3f(30, 0, 0)); @@ -1288,34 +1287,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); // libccd cannot detect collision when two ellipsoid is exactly touching each other + EXPECT_TRUE_FALSE(res); // libccd cannot detect collision when two ellipsoid is exactly touching each other result.clear(); res = (collide(&s1, Transform3f(), &s2, Transform3f(Vec3f(29.999, 0, 0)), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(29.9, 0, 0)); pose_aabb.setTranslation(Vec3f(29.9, 0, 0)); // 29.9 fails, result depends on mesh precision @@ -1323,31 +1322,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-29.9, 0, 0)); pose_aabb.setTranslation(Vec3f(-29.9, 0, 0)); @@ -1355,31 +1354,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-30, 0, 0)); pose_aabb.setTranslation(Vec3f(-30, 0, 0)); @@ -1387,34 +1386,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_libccd) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -1443,31 +1442,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_libccd) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(15.01, 0, 0)); pose_aabb.setTranslation(Vec3f(15.01, 0, 0)); @@ -1475,31 +1474,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(14.99, 0, 0)); pose_aabb.setTranslation(Vec3f(14.99, 0, 0)); @@ -1507,34 +1506,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_libccd) { Sphere s1(20); Box s2(5, 5, 5); @@ -1563,31 +1562,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_libccd) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(22.4, 0, 0)); pose_aabb.setTranslation(Vec3f(22.4, 0, 0)); @@ -1595,31 +1594,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(22.51, 0, 0)); pose_aabb.setTranslation(Vec3f(22.51, 0, 0)); @@ -1627,34 +1626,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_libccd) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -1682,31 +1681,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(10.01, 0, 0)); pose_aabb.setTranslation(Vec3f(10.01, 0, 0)); @@ -1714,34 +1713,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_conecone_libccd) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_libccd) { Cone s1(5, 10); Cone s2(5, 10); @@ -1769,31 +1768,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(10.1, 0, 0)); pose_aabb.setTranslation(Vec3f(10.1, 0, 0)); @@ -1801,31 +1800,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(0, 0, 9.9)); pose_aabb.setTranslation(Vec3f(0, 0, 9.9)); @@ -1833,31 +1832,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(0, 0, 10.1)); pose_aabb.setTranslation(Vec3f(0, 0, 10.1)); @@ -1865,37 +1864,37 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_libccd) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_GJK) { Sphere s1(20); Sphere s2(10); @@ -1926,31 +1925,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(40, 0, 0)); pose_aabb.setTranslation(Vec3f(40, 0, 0)); @@ -1958,31 +1957,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(30, 0, 0)); pose_aabb.setTranslation(Vec3f(30, 0, 0)); @@ -1990,31 +1989,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(29.9, 0, 0)); pose_aabb.setTranslation(Vec3f(29.8, 0, 0)); // 29.9 fails, result depends on mesh precision @@ -2022,31 +2021,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-29.9, 0, 0)); @@ -2055,31 +2054,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-30, 0, 0)); pose_aabb.setTranslation(Vec3f(-30, 0, 0)); @@ -2087,34 +2086,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spheresphere_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_GJK) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -2145,31 +2144,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(40, 0, 0)); pose_aabb.setTranslation(Vec3f(40, 0, 0)); @@ -2177,31 +2176,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(30, 0, 0)); pose_aabb.setTranslation(Vec3f(30, 0, 0)); @@ -2209,31 +2208,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(29.9, 0, 0)); pose_aabb.setTranslation(Vec3f(29.9, 0, 0)); @@ -2241,31 +2240,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-29.9, 0, 0)); @@ -2274,31 +2273,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(-30, 0, 0)); pose_aabb.setTranslation(Vec3f(-30, 0, 0)); @@ -2306,34 +2305,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_ellipsoidellipsoid_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_GJK) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -2364,31 +2363,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_GJK) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(15.01, 0, 0)); pose_aabb.setTranslation(Vec3f(15.01, 0, 0)); @@ -2396,31 +2395,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(14.99, 0, 0)); pose_aabb.setTranslation(Vec3f(14.99, 0, 0)); @@ -2428,34 +2427,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_boxbox_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_GJK) { Sphere s1(20); Box s2(5, 5, 5); @@ -2486,31 +2485,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_GJK) // all are reasonable result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(22.4, 0, 0)); pose_aabb.setTranslation(Vec3f(22.4, 0, 0)); @@ -2518,31 +2517,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(22.51, 0, 0)); pose_aabb.setTranslation(Vec3f(22.51, 0, 0)); @@ -2550,34 +2549,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_spherebox_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_GJK) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -2607,31 +2606,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(10.01, 0, 0)); pose_aabb.setTranslation(Vec3f(10.01, 0, 0)); @@ -2639,34 +2638,34 @@ BOOST_AUTO_TEST_CASE(consistency_collision_cylindercylinder_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); } -BOOST_AUTO_TEST_CASE(consistency_collision_conecone_GJK) +TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_GJK) { Cone s1(5, 10); Cone s2(5, 10); @@ -2696,31 +2695,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(10.1, 0, 0)); pose_aabb.setTranslation(Vec3f(10.1, 0, 0)); @@ -2728,31 +2727,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); pose.setTranslation(Vec3f(0, 0, 9.9)); pose_aabb.setTranslation(Vec3f(0, 0, 9.9)); @@ -2760,31 +2759,31 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK(res); + EXPECT_TRUE(res); pose.setTranslation(Vec3f(0, 0, 10.1)); pose_aabb.setTranslation(Vec3f(0, 0, 10.1)); @@ -2792,29 +2791,36 @@ BOOST_AUTO_TEST_CASE(consistency_collision_conecone_GJK) result.clear(); res = (collide(&s1, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_aabb, pose_aabb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2_obb, pose_obb, &s1, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_aabb, pose_aabb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1, Transform3f(), &s2_obb, pose_obb, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_aabb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s2, pose, &s1_obb, Transform3f(), request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); result.clear(); res = (collide(&s1_aabb, Transform3f(), &s2, pose, request, result) > 0); - BOOST_CHECK_FALSE(res); + EXPECT_TRUE_FALSE(res); +} + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } diff --git a/test/test_fcl_simple.cpp b/test/test_fcl_simple.cpp index 49486f813..cebde650b 100644 --- a/test/test_fcl_simple.cpp +++ b/test/test_fcl_simple.cpp @@ -1,5 +1,4 @@ -#define BOOST_TEST_MODULE "FCL_SIMPLE" -#include +#include #include "fcl/intersect.h" #include "fcl/collision.h" @@ -32,7 +31,7 @@ double distance_Vecnf(const Vecnf& a, const Vecnf& b) } -BOOST_AUTO_TEST_CASE(Vec_nf_test) +TEST(FCL_SIMPLE, Vec_nf_test) { Vecnf<4> a; Vecnf<4> b; @@ -79,35 +78,35 @@ BOOST_AUTO_TEST_CASE(Vec_nf_test) } -BOOST_AUTO_TEST_CASE(projection_test_line) +TEST(FCL_SIMPLE, projection_test_line) { Vec3f v1(0, 0, 0); Vec3f v2(2, 0, 0); Vec3f p(1, 0, 0); Project::ProjectResult res = Project::projectLine(v1, v2, p); - BOOST_CHECK(res.encode == 3); - BOOST_CHECK(approx(res.sqr_distance, 0)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(res.encode == 3); + EXPECT_TRUE(approx(res.sqr_distance, 0)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); p = Vec3f(-1, 0, 0); res = Project::projectLine(v1, v2, p); - BOOST_CHECK(res.encode == 1); - BOOST_CHECK(approx(res.sqr_distance, 1)); - BOOST_CHECK(approx(res.parameterization[0], 1)); - BOOST_CHECK(approx(res.parameterization[1], 0)); + EXPECT_TRUE(res.encode == 1); + EXPECT_TRUE(approx(res.sqr_distance, 1)); + EXPECT_TRUE(approx(res.parameterization[0], 1)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); p = Vec3f(3, 0, 0); res = Project::projectLine(v1, v2, p); - BOOST_CHECK(res.encode == 2); - BOOST_CHECK(approx(res.sqr_distance, 1)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 1)); + EXPECT_TRUE(res.encode == 2); + EXPECT_TRUE(approx(res.sqr_distance, 1)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 1)); } -BOOST_AUTO_TEST_CASE(projection_test_triangle) +TEST(FCL_SIMPLE, projection_test_triangle) { Vec3f v1(0, 0, 1); Vec3f v2(0, 1, 0); @@ -115,62 +114,62 @@ BOOST_AUTO_TEST_CASE(projection_test_triangle) Vec3f p(1, 1, 1); Project::ProjectResult res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 7); - BOOST_CHECK(approx(res.sqr_distance, 4/3.0)); - BOOST_CHECK(approx(res.parameterization[0], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[1], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[2], 1/3.0)); + EXPECT_TRUE(res.encode == 7); + EXPECT_TRUE(approx(res.sqr_distance, 4/3.0)); + EXPECT_TRUE(approx(res.parameterization[0], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[1], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[2], 1/3.0)); p = Vec3f(0, 0, 1.5); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 1); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 1)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0)); + EXPECT_TRUE(res.encode == 1); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 1)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); p = Vec3f(1.5, 0, 0); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 4); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 1)); + EXPECT_TRUE(res.encode == 4); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 1)); p = Vec3f(0, 1.5, 0); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 2); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 1)); - BOOST_CHECK(approx(res.parameterization[2], 0)); + EXPECT_TRUE(res.encode == 2); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 1)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); p = Vec3f(1, 1, 0); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 6); - BOOST_CHECK(approx(res.sqr_distance, 0.5)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); - BOOST_CHECK(approx(res.parameterization[2], 0.5)); + EXPECT_TRUE(res.encode == 6); + EXPECT_TRUE(approx(res.sqr_distance, 0.5)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(approx(res.parameterization[2], 0.5)); p = Vec3f(1, 0, 1); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 5); - BOOST_CHECK(approx(res.sqr_distance, 0.5)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0.5)); + EXPECT_TRUE(res.encode == 5); + EXPECT_TRUE(approx(res.sqr_distance, 0.5)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0.5)); p = Vec3f(0, 1, 1); res = Project::projectTriangle(v1, v2, v3, p); - BOOST_CHECK(res.encode == 3); - BOOST_CHECK(approx(res.sqr_distance, 0.5)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); - BOOST_CHECK(approx(res.parameterization[2], 0)); + EXPECT_TRUE(res.encode == 3); + EXPECT_TRUE(approx(res.sqr_distance, 0.5)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); } -BOOST_AUTO_TEST_CASE(projection_test_tetrahedron) +TEST(FCL_SIMPLE, projection_test_tetrahedron) { Vec3f v1(0, 0, 1); Vec3f v2(0, 1, 0); @@ -179,137 +178,144 @@ BOOST_AUTO_TEST_CASE(projection_test_tetrahedron) Vec3f p(0.5, 0.5, 0.5); Project::ProjectResult res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 15); - BOOST_CHECK(approx(res.sqr_distance, 0)); - BOOST_CHECK(approx(res.parameterization[0], 0.25)); - BOOST_CHECK(approx(res.parameterization[1], 0.25)); - BOOST_CHECK(approx(res.parameterization[2], 0.25)); - BOOST_CHECK(approx(res.parameterization[3], 0.25)); + EXPECT_TRUE(res.encode == 15); + EXPECT_TRUE(approx(res.sqr_distance, 0)); + EXPECT_TRUE(approx(res.parameterization[0], 0.25)); + EXPECT_TRUE(approx(res.parameterization[1], 0.25)); + EXPECT_TRUE(approx(res.parameterization[2], 0.25)); + EXPECT_TRUE(approx(res.parameterization[3], 0.25)); p = Vec3f(0, 0, 0); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 7); - BOOST_CHECK(approx(res.sqr_distance, 1/3.0)); - BOOST_CHECK(approx(res.parameterization[0], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[1], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[2], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 7); + EXPECT_TRUE(approx(res.sqr_distance, 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[0], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[1], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[2], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(0, 1, 1); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 11); - BOOST_CHECK(approx(res.sqr_distance, 1/3.0)); - BOOST_CHECK(approx(res.parameterization[0], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[1], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 1/3.0)); + EXPECT_TRUE(res.encode == 11); + EXPECT_TRUE(approx(res.sqr_distance, 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[0], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[1], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 1/3.0)); p = Vec3f(1, 1, 0); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 14); - BOOST_CHECK(approx(res.sqr_distance, 1/3.0)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[2], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[3], 1/3.0)); + EXPECT_TRUE(res.encode == 14); + EXPECT_TRUE(approx(res.sqr_distance, 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[2], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[3], 1/3.0)); p = Vec3f(1, 0, 1); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 13); - BOOST_CHECK(approx(res.sqr_distance, 1/3.0)); - BOOST_CHECK(approx(res.parameterization[0], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 1/3.0)); - BOOST_CHECK(approx(res.parameterization[3], 1/3.0)); + EXPECT_TRUE(res.encode == 13); + EXPECT_TRUE(approx(res.sqr_distance, 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[0], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 1/3.0)); + EXPECT_TRUE(approx(res.parameterization[3], 1/3.0)); p = Vec3f(1.5, 1.5, 1.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 8); - BOOST_CHECK(approx(res.sqr_distance, 0.75)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 1)); + EXPECT_TRUE(res.encode == 8); + EXPECT_TRUE(approx(res.sqr_distance, 0.75)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 1)); p = Vec3f(1.5, -0.5, -0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 4); - BOOST_CHECK(approx(res.sqr_distance, 0.75)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 1)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 4); + EXPECT_TRUE(approx(res.sqr_distance, 0.75)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 1)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(-0.5, -0.5, 1.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 1); - BOOST_CHECK(approx(res.sqr_distance, 0.75)); - BOOST_CHECK(approx(res.parameterization[0], 1)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 1); + EXPECT_TRUE(approx(res.sqr_distance, 0.75)); + EXPECT_TRUE(approx(res.parameterization[0], 1)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(-0.5, 1.5, -0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 2); - BOOST_CHECK(approx(res.sqr_distance, 0.75)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 1)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 2); + EXPECT_TRUE(approx(res.sqr_distance, 0.75)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 1)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(0.5, -0.5, 0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 5); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0.5)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 5); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0.5)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(0.5, 1.5, 0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 10); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 0.5)); + EXPECT_TRUE(res.encode == 10); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 0.5)); p = Vec3f(1.5, 0.5, 0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 12); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0.5)); - BOOST_CHECK(approx(res.parameterization[3], 0.5)); + EXPECT_TRUE(res.encode == 12); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0.5)); + EXPECT_TRUE(approx(res.parameterization[3], 0.5)); p = Vec3f(-0.5, 0.5, 0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 3); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 3); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); p = Vec3f(0.5, 0.5, 1.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 9); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0.5)); - BOOST_CHECK(approx(res.parameterization[1], 0)); - BOOST_CHECK(approx(res.parameterization[2], 0)); - BOOST_CHECK(approx(res.parameterization[3], 0.5)); + EXPECT_TRUE(res.encode == 9); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0.5)); + EXPECT_TRUE(approx(res.parameterization[1], 0)); + EXPECT_TRUE(approx(res.parameterization[2], 0)); + EXPECT_TRUE(approx(res.parameterization[3], 0.5)); p = Vec3f(0.5, 0.5, -0.5); res = Project::projectTetrahedra(v1, v2, v3, v4, p); - BOOST_CHECK(res.encode == 6); - BOOST_CHECK(approx(res.sqr_distance, 0.25)); - BOOST_CHECK(approx(res.parameterization[0], 0)); - BOOST_CHECK(approx(res.parameterization[1], 0.5)); - BOOST_CHECK(approx(res.parameterization[2], 0.5)); - BOOST_CHECK(approx(res.parameterization[3], 0)); + EXPECT_TRUE(res.encode == 6); + EXPECT_TRUE(approx(res.sqr_distance, 0.25)); + EXPECT_TRUE(approx(res.parameterization[0], 0)); + EXPECT_TRUE(approx(res.parameterization[1], 0.5)); + EXPECT_TRUE(approx(res.parameterization[2], 0.5)); + EXPECT_TRUE(approx(res.parameterization[3], 0)); } + +//============================================================================== +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From f5e9d390087a058275adc75175cef457be021b82 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:02:10 -0400 Subject: [PATCH 04/17] Add missing copyright to test_fcl_simple.cpp --- test/test_fcl_simple.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/test_fcl_simple.cpp b/test/test_fcl_simple.cpp index cebde650b..03636564a 100644 --- a/test/test_fcl_simple.cpp +++ b/test/test_fcl_simple.cpp @@ -1,3 +1,38 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011-2014, Willow Garage, Inc. + * Copyright (c) 2014-2016, Open Source Robotics Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Open Source Robotics Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + #include #include "fcl/intersect.h" From f02408eee933c25b367d7cee0502fb785681cf27 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:05:34 -0400 Subject: [PATCH 05/17] Drop dependency on Boost Test --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aca843565..e02d747f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,8 +164,8 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") -find_package(Boost COMPONENTS date_time filesystem system unit_test_framework) -option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND}) +find_package(Boost COMPONENTS date_time filesystem system) +option(FCL_BUILD_TESTS "Build FCL tests" ON) if(FCL_BUILD_TESTS) enable_testing() add_subdirectory(test) From 80d458bb9b485ab62d5a8bb0bbdcb458f8eff74a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:10:39 -0400 Subject: [PATCH 06/17] Update changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7d745cb..1cebc6f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ## FCL 0 -### FCL 0.5.0 (2016-XX-XX) +### FCL 0.6.0 (2016-XX-XX) + +* Removed Boost Test and replaced with Google Test: [#146](https://github.com/flexible-collision-library/fcl/pull/146), [#140](https://github.com/flexible-collision-library/fcl/pull/140) + +### FCL 0.5.0 (2016-07-19) * Added safe-guards to allow octree headers only if octomap enabled: [#136](https://github.com/flexible-collision-library/fcl/pull/136) * Added CMake option to disable octomap in build: [#135](https://github.com/flexible-collision-library/fcl/pull/135) From 5d47544e52562e8577604ca4da6714fd577bd444 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:14:12 -0400 Subject: [PATCH 07/17] Remove Boost.Date_Time --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e02d747f6..16e82bd92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") -find_package(Boost COMPONENTS date_time filesystem system) +find_package(Boost COMPONENTS filesystem system) option(FCL_BUILD_TESTS "Build FCL tests" ON) if(FCL_BUILD_TESTS) enable_testing() From 4f57239b226a033de8606f7120a41c280e177459 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:19:58 -0400 Subject: [PATCH 08/17] Revert the default value of FCL_BUILD_TESTS option --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16e82bd92..9ea703a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") find_package(Boost COMPONENTS filesystem system) -option(FCL_BUILD_TESTS "Build FCL tests" ON) +option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND}) if(FCL_BUILD_TESTS) enable_testing() add_subdirectory(test) From c5d14019a8f05258dca5482054edb35dfe9b8024 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:28:59 -0400 Subject: [PATCH 09/17] Remove boost::timer and replace with fcl::Timer --- CMakeLists.txt | 2 +- test/test_fcl_distance.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea703a67..a56681441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") -find_package(Boost COMPONENTS filesystem system) +find_package(Boost COMPONENTS filesystem) option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND}) if(FCL_BUILD_TESTS) enable_testing() diff --git a/test/test_fcl_distance.cpp b/test/test_fcl_distance.cpp index 85ad39ac6..f20c981f0 100644 --- a/test/test_fcl_distance.cpp +++ b/test/test_fcl_distance.cpp @@ -41,7 +41,6 @@ #include "fcl/traversal/traversal_node_setup.h" #include "fcl/collision_node.h" #include "test_fcl_utility.h" -#include #include "fcl_resources/config.h" #include @@ -100,13 +99,17 @@ TEST(FCL_DISTANCE, mesh_distance) DistanceRes res, res_now; for(std::size_t i = 0; i < transforms.size(); ++i) { - boost::timer timer_col; + Timer timer_col; + timer_col.start(); collide_Test_OBB(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, verbose); - col_time += timer_col.elapsed(); + timer_col.stop(); + col_time += timer_col.getElapsedTimeInSec(); - boost::timer timer_dist; + Timer timer_dist; + timer_dist.start(); distance_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, 2, res, verbose); - dis_time += timer_dist.elapsed(); + timer_dist.stop(); + dis_time += timer_dist.getElapsedTimeInSec(); distance_Test_Oriented(transforms[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, 2, res_now, verbose); From 3279ea0f07bc23ab335a92ccdc88fe67d18b6e93 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:31:16 -0400 Subject: [PATCH 10/17] Bump version to 0.6.0 --- CMakeModules/FCLVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeModules/FCLVersion.cmake b/CMakeModules/FCLVersion.cmake index 0b535e7f4..46a3a91c1 100644 --- a/CMakeModules/FCLVersion.cmake +++ b/CMakeModules/FCLVersion.cmake @@ -1,6 +1,6 @@ # set the version in a way CMake can use set(FCL_MAJOR_VERSION 0) -set(FCL_MINOR_VERSION 5) +set(FCL_MINOR_VERSION 6) set(FCL_PATCH_VERSION 0) set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}") From ea83e19491c1a99f1d57f42ab0ae86dbbd2cda5a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:37:28 -0400 Subject: [PATCH 11/17] Add back boost settings for filesystem and system --- test/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7046e1a9e..16a025794 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -45,7 +45,7 @@ if (FCL_HAVE_OCTOMAP) list(APPEND tests test_fcl_octomap.cpp) endif() -macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_test once we completely drop the dependency on Boost Test +macro(add_fcl_test test_file_name) # Get the name (i.e. bla.cpp => bla) get_filename_component(test_name ${ARGV} NAME_WE) add_executable(${test_name} ${ARGV}) @@ -57,7 +57,7 @@ macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_te ${Boost_SYSTEM_LIBRARY} ) add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) -endmacro(add_fcl_gtest) +endmacro(add_fcl_test) # configure location of resources file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/fcl_resources" TEST_RESOURCES_SRC_DIR) @@ -71,8 +71,14 @@ configure_file("${TEST_RESOURCES_SRC_DIR}/config.h.in" "${TEST_RESOURCES_BIN_DIR include_directories(.) include_directories("${CMAKE_CURRENT_BINARY_DIR}") +include_directories(${Boost_INCLUDE_DIR}) + +if(MSVC) + add_definitions(-DBOOST_ALL_NO_LIB) +endif() +add_definitions(-DBOOST_TEST_DYN_LINK) # Build all the tests foreach(test ${tests}) - add_fcl_gtest(${test}) + add_fcl_test(${test}) endforeach(test) From b518e3e1af43421ef9ab809fd2a04d7c2df3c68d Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 22:57:19 -0400 Subject: [PATCH 12/17] Remove boost::filesystem --- CMakeLists.txt | 3 +-- src/CMakeLists.txt | 3 +-- test/CMakeLists.txt | 14 +------------- test/test_fcl_collision.cpp | 6 ++---- test/test_fcl_distance.cpp | 7 +++---- test/test_fcl_frontlist.cpp | 7 +++---- test/test_fcl_octomap.cpp | 9 ++++----- test/test_fcl_simple.cpp | 1 - 8 files changed, 15 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a56681441..376090e84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,8 +164,7 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") -find_package(Boost COMPONENTS filesystem) -option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND}) +option(FCL_BUILD_TESTS "Build FCL tests" ON) if(FCL_BUILD_TESTS) enable_testing() add_subdirectory(test) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ce1f77fc..7c7504e3c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,8 +11,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES target_link_libraries(${PROJECT_NAME} PUBLIC ${OCTOMAP_LIBRARIES} - PRIVATE ${CCD_LIBRARIES} - PRIVATE ${Boost_LIBRARIES}) + PRIVATE ${CCD_LIBRARIES}) target_include_directories(${PROJECT_NAME} INTERFACE $ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 16a025794..740a50694 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,13 +49,7 @@ macro(add_fcl_test test_file_name) # Get the name (i.e. bla.cpp => bla) get_filename_component(test_name ${ARGV} NAME_WE) add_executable(${test_name} ${ARGV}) - target_link_libraries(${test_name} - fcl - test_fcl_utility - gtest - ${Boost_FILESYSTEM_LIBRARY} # Boost libraries should be removed - ${Boost_SYSTEM_LIBRARY} - ) + target_link_libraries(${test_name} fcl test_fcl_utility gtest) add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) endmacro(add_fcl_test) @@ -71,12 +65,6 @@ configure_file("${TEST_RESOURCES_SRC_DIR}/config.h.in" "${TEST_RESOURCES_BIN_DIR include_directories(.) include_directories("${CMAKE_CURRENT_BINARY_DIR}") -include_directories(${Boost_INCLUDE_DIR}) - -if(MSVC) - add_definitions(-DBOOST_ALL_NO_LIB) -endif() -add_definitions(-DBOOST_TEST_DYN_LINK) # Build all the tests foreach(test ${tests}) diff --git a/test/test_fcl_collision.cpp b/test/test_fcl_collision.cpp index 76f231868..858a40bb8 100644 --- a/test/test_fcl_collision.cpp +++ b/test/test_fcl_collision.cpp @@ -46,7 +46,6 @@ #include "fcl/narrowphase/narrowphase.h" #include "test_fcl_utility.h" #include "fcl_resources/config.h" -#include using namespace fcl; @@ -241,10 +240,9 @@ TEST(FCL_COLLISION, mesh_mesh) { std::vector p1, p2; std::vector t1, t2; - boost::filesystem::path path(TEST_RESOURCES_DIR); - loadOBJFile((path / "env.obj").string().c_str(), p1, t1); - loadOBJFile((path / "rob.obj").string().c_str(), p2, t2); + loadOBJFile(TEST_RESOURCES_DIR"/env.obj", p1, t1); + loadOBJFile(TEST_RESOURCES_DIR"/rob.obj", p2, t2); std::vector transforms; FCL_REAL extents[] = {-3000, -3000, 0, 3000, 3000, 3000}; diff --git a/test/test_fcl_distance.cpp b/test/test_fcl_distance.cpp index f20c981f0..c68143249 100644 --- a/test/test_fcl_distance.cpp +++ b/test/test_fcl_distance.cpp @@ -42,7 +42,6 @@ #include "fcl/collision_node.h" #include "test_fcl_utility.h" #include "fcl_resources/config.h" -#include using namespace fcl; @@ -83,9 +82,9 @@ TEST(FCL_DISTANCE, mesh_distance) { std::vector p1, p2; std::vector t1, t2; - boost::filesystem::path path(TEST_RESOURCES_DIR); - loadOBJFile((path / "env.obj").string().c_str(), p1, t1); - loadOBJFile((path / "rob.obj").string().c_str(), p2, t2); + + loadOBJFile(TEST_RESOURCES_DIR"/env.obj", p1, t1); + loadOBJFile(TEST_RESOURCES_DIR"/rob.obj", p2, t2); std::vector transforms; // t0 FCL_REAL extents[] = {-3000, -3000, 0, 3000, 3000, 3000}; diff --git a/test/test_fcl_frontlist.cpp b/test/test_fcl_frontlist.cpp index 5d990b88a..e86422156 100644 --- a/test/test_fcl_frontlist.cpp +++ b/test/test_fcl_frontlist.cpp @@ -43,7 +43,6 @@ #include "test_fcl_utility.h" #include "fcl_resources/config.h" -#include using namespace fcl; @@ -71,9 +70,9 @@ TEST(FCL_FRONT_LIST, front_list) { std::vector p1, p2; std::vector t1, t2; - boost::filesystem::path path(TEST_RESOURCES_DIR); - loadOBJFile((path / "env.obj").string().c_str(), p1, t1); - loadOBJFile((path / "rob.obj").string().c_str(), p2, t2); + + loadOBJFile(TEST_RESOURCES_DIR"/env.obj", p1, t1); + loadOBJFile(TEST_RESOURCES_DIR"/rob.obj", p2, t2); std::vector transforms; // t0 std::vector transforms2; // t1 diff --git a/test/test_fcl_octomap.cpp b/test/test_fcl_octomap.cpp index db52e2f59..47471b320 100644 --- a/test/test_fcl_octomap.cpp +++ b/test/test_fcl_octomap.cpp @@ -46,7 +46,6 @@ #include "fcl/math/transform.h" #include "test_fcl_utility.h" #include "fcl_resources/config.h" -#include using namespace fcl; @@ -215,8 +214,8 @@ void octomap_collision_test_BVH(std::size_t n, bool exhaustive) { std::vector p1; std::vector t1; - boost::filesystem::path path(TEST_RESOURCES_DIR); - loadOBJFile((path / "env.obj").string().c_str(), p1, t1); + + loadOBJFile(TEST_RESOURCES_DIR"/env.obj", p1, t1); BVHModel* m1 = new BVHModel(); std::shared_ptr m1_ptr(m1); @@ -281,8 +280,8 @@ void octomap_distance_test_BVH(std::size_t n) { std::vector p1; std::vector t1; - boost::filesystem::path path(TEST_RESOURCES_DIR); - loadOBJFile((path / "env.obj").string().c_str(), p1, t1); + + loadOBJFile(TEST_RESOURCES_DIR"/env.obj", p1, t1); BVHModel* m1 = new BVHModel(); std::shared_ptr m1_ptr(m1); diff --git a/test/test_fcl_simple.cpp b/test/test_fcl_simple.cpp index 03636564a..14de2ef1a 100644 --- a/test/test_fcl_simple.cpp +++ b/test/test_fcl_simple.cpp @@ -39,7 +39,6 @@ #include "fcl/collision.h" #include "fcl/BVH/BVH_model.h" #include "fcl_resources/config.h" -#include #include #include "fcl/math/vec_nf.h" #include "fcl/math/sampling.h" From 0134dbe6039032aadb04a50b39ba47bf8df5675e Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 23:04:46 -0400 Subject: [PATCH 13/17] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cebc6f7c..0964c8810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### FCL 0.6.0 (2016-XX-XX) -* Removed Boost Test and replaced with Google Test: [#146](https://github.com/flexible-collision-library/fcl/pull/146), [#140](https://github.com/flexible-collision-library/fcl/pull/140) +* Removed dependency on boost: [#148](https://github.com/flexible-collision-library/fcl/pull/148), [#147](https://github.com/flexible-collision-library/fcl/pull/147), [#146](https://github.com/flexible-collision-library/fcl/pull/146), [#140](https://github.com/flexible-collision-library/fcl/pull/140) ### FCL 0.5.0 (2016-07-19) From 4ed76920350abff0329c69f682b46f189654ad4a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 22 Jul 2016 23:40:39 -0400 Subject: [PATCH 14/17] Add back boost::system --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a56681441..9ea703a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ configure_file( add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") -find_package(Boost COMPONENTS filesystem) +find_package(Boost COMPONENTS filesystem system) option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND}) if(FCL_BUILD_TESTS) enable_testing() From 89da46e4652ec1dfb954f6a6d9567a3beff64dda Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sat, 23 Jul 2016 08:17:48 -0400 Subject: [PATCH 15/17] Use GTEST_TEST rather than TEST to avoid potential name conflicts --- test/CMakeLists.txt | 10 +++ test/test_fcl_broadphase.cpp | 32 +++---- test/test_fcl_bvh_models.cpp | 2 +- test/test_fcl_capsule_box_1.cpp | 2 +- test/test_fcl_capsule_box_2.cpp | 2 +- test/test_fcl_capsule_capsule.cpp | 8 +- test/test_fcl_collision.cpp | 8 +- test/test_fcl_distance.cpp | 2 +- test/test_fcl_frontlist.cpp | 2 +- test/test_fcl_geometric_shapes.cpp | 102 +++++++++++------------ test/test_fcl_math.cpp | 16 ++-- test/test_fcl_octomap.cpp | 26 +++--- test/test_fcl_shape_mesh_consistency.cpp | 44 +++++----- test/test_fcl_simple.cpp | 8 +- test/test_fcl_sphere_capsule.cpp | 16 ++-- 15 files changed, 145 insertions(+), 135 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 16a025794..377fa51dc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,6 +18,16 @@ if(NOT WIN32) target_link_libraries(gtest pthread) endif() +add_definitions(-DGTEST_DONT_DEFINE_TEST=1) +add_definitions(-DGTEST_DONT_DEFINE_FAIL=1) +add_definitions(-DGTEST_DONT_DEFINE_SUCCEED=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_EQ=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_NE=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LE=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LT=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GE=1) +add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GT=1) + execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results) execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results) include_directories(${GTEST_INCLUDE_DIRS}) diff --git a/test/test_fcl_broadphase.cpp b/test/test_fcl_broadphase.cpp index d4ac1c310..b09f561ac 100644 --- a/test/test_fcl_broadphase.cpp +++ b/test/test_fcl_broadphase.cpp @@ -110,28 +110,28 @@ struct GoogleDenseHashTable : public google::dense_hash_map(); } -TEST(FCL_BVH_MODELS, building_bvh_models) +GTEST_TEST(FCL_BVH_MODELS, building_bvh_models) { testBVHModel(); testBVHModel(); diff --git a/test/test_fcl_capsule_box_1.cpp b/test/test_fcl_capsule_box_1.cpp index 6d1632437..8b07a5e87 100644 --- a/test/test_fcl_capsule_box_1.cpp +++ b/test/test_fcl_capsule_box_1.cpp @@ -43,7 +43,7 @@ #include #include -TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) { typedef std::shared_ptr CollisionGeometryPtr_t; // Capsule of radius 2 and of height 4 diff --git a/test/test_fcl_capsule_box_2.cpp b/test/test_fcl_capsule_box_2.cpp index e1e0ec622..bce2eb921 100644 --- a/test/test_fcl_capsule_box_2.cpp +++ b/test/test_fcl_capsule_box_2.cpp @@ -43,7 +43,7 @@ #include #include -TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, distance_capsule_box) { typedef std::shared_ptr CollisionGeometryPtr_t; // Capsule of radius 2 and of height 4 diff --git a/test/test_fcl_capsule_capsule.cpp b/test/test_fcl_capsule_capsule.cpp index 4fc29d24f..dfc80f4f3 100644 --- a/test/test_fcl_capsule_capsule.cpp +++ b/test/test_fcl_capsule_capsule.cpp @@ -45,7 +45,7 @@ #include using namespace fcl; -TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_origin) +GTEST_TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_origin) { GJKSolver_indep solver; @@ -71,7 +71,7 @@ TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_origin) } -TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformXY) +GTEST_TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformXY) { GJKSolver_indep solver; @@ -97,7 +97,7 @@ TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformXY) } -TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ) +GTEST_TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ) { GJKSolver_indep solver; @@ -123,7 +123,7 @@ TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ) } -TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ2) +GTEST_TEST(FCL_CAPSULE_CAPSULE, distance_capsulecapsule_transformZ2) { const FCL_REAL Pi = constants::pi; diff --git a/test/test_fcl_collision.cpp b/test/test_fcl_collision.cpp index 76f231868..330003fbe 100644 --- a/test/test_fcl_collision.cpp +++ b/test/test_fcl_collision.cpp @@ -77,7 +77,7 @@ bool enable_contact = true; std::vector global_pairs; std::vector global_pairs_now; -TEST(FCL_COLLISION, OBB_Box_test) +GTEST_TEST(FCL_COLLISION, OBB_Box_test) { FCL_REAL r_extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::vector rotate_transform; @@ -121,7 +121,7 @@ TEST(FCL_COLLISION, OBB_Box_test) } } -TEST(FCL_COLLISION, OBB_shape_test) +GTEST_TEST(FCL_COLLISION, OBB_shape_test) { FCL_REAL r_extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::vector rotate_transform; @@ -196,7 +196,7 @@ TEST(FCL_COLLISION, OBB_shape_test) } } -TEST(FCL_COLLISION, OBB_AABB_test) +GTEST_TEST(FCL_COLLISION, OBB_AABB_test) { FCL_REAL extents[] = {-1000, -1000, -1000, 1000, 1000, 1000}; std::size_t n = 1000; @@ -237,7 +237,7 @@ TEST(FCL_COLLISION, OBB_AABB_test) std::cout << std::endl; } -TEST(FCL_COLLISION, mesh_mesh) +GTEST_TEST(FCL_COLLISION, mesh_mesh) { std::vector p1, p2; std::vector t1, t2; diff --git a/test/test_fcl_distance.cpp b/test/test_fcl_distance.cpp index 85ad39ac6..a5a45ecb9 100644 --- a/test/test_fcl_distance.cpp +++ b/test/test_fcl_distance.cpp @@ -80,7 +80,7 @@ inline bool nearlyEqual(const Vec3f& a, const Vec3f& b) return true; } -TEST(FCL_DISTANCE, mesh_distance) +GTEST_TEST(FCL_DISTANCE, mesh_distance) { std::vector p1, p2; std::vector t1, t2; diff --git a/test/test_fcl_frontlist.cpp b/test/test_fcl_frontlist.cpp index 5d990b88a..d484b2ee2 100644 --- a/test/test_fcl_frontlist.cpp +++ b/test/test_fcl_frontlist.cpp @@ -67,7 +67,7 @@ bool collide_Test(const Transform3f& tf, const std::vector& vertices2, const std::vector& triangles2, SplitMethodType split_method, bool verbose); // TODO: randomly still have some runtime error -TEST(FCL_FRONT_LIST, front_list) +GTEST_TEST(FCL_FRONT_LIST, front_list) { std::vector p1, p2; std::vector t1, t2; diff --git a/test/test_fcl_geometric_shapes.cpp b/test/test_fcl_geometric_shapes.cpp index 09e95a04b..bd802cc2d 100755 --- a/test/test_fcl_geometric_shapes.cpp +++ b/test/test_fcl_geometric_shapes.cpp @@ -53,7 +53,7 @@ GJKSolver_indep solver2; #define EXPECT_TRUE_FALSE(p) EXPECT_TRUE(!(p)) -TEST(FCL_GEOMETRIC_SHAPES, sphere_shape) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, sphere_shape) { const double tol = 1e-12; const double radius = 5.0; @@ -65,7 +65,7 @@ TEST(FCL_GEOMETRIC_SHAPES, sphere_shape) EXPECT_NEAR(volume, s.computeVolume(), tol); } -TEST(FCL_GEOMETRIC_SHAPES, gjkcache) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, gjkcache) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -480,7 +480,7 @@ void testShapeIntersection( // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheresphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -644,7 +644,7 @@ void testBoxBoxContactPoints(const Matrix3f& R) } } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_boxbox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -720,7 +720,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_boxbox) } } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherebox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherebox) { Sphere s1(20); Box s2(5, 5, 5); @@ -767,7 +767,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherebox) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, true, contacts, false, false, true, false, 1e-4); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherecapsule) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherecapsule) { Sphere s1(20); Capsule s2(5, 10); @@ -825,7 +825,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spherecapsule) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -871,7 +871,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercylinder) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_conecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -929,7 +929,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_conecone) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, true, contacts, false, false, true, false, 1e-5); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercone) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -995,7 +995,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_cylindercone) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_ellipsoidellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -1064,7 +1064,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_ellipsoidellipsoid) testShapeIntersection(s1, tf1, s2, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheretriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheretriangle) { Sphere s(10); Vec3f t[3]; @@ -1103,7 +1103,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_spheretriangle) EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacetriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacetriangle) { Halfspace hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -1144,7 +1144,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacetriangle) EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planetriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planetriangle) { Plane hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -1185,7 +1185,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planetriangle) EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacesphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacesphere) { Sphere s(10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1271,7 +1271,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacesphere) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planesphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planesphere) { Sphere s(10); Plane hs(Vec3f(1, 0, 0), 0); @@ -1349,7 +1349,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planesphere) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacebox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacebox) { Box s(5, 10, 20); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1440,7 +1440,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacebox) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts, false, false, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planebox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planebox) { Box s(5, 10, 20); Plane hs(Vec3f(1, 0, 0), 0); @@ -1523,7 +1523,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planebox) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, true, contacts, false, false, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspaceellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspaceellipsoid) { Ellipsoid s(5, 10, 20); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -1763,7 +1763,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspaceellipsoid) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planeellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planeellipsoid) { Ellipsoid s(5, 10, 20); Plane hs(Vec3f(1, 0, 0), 0); @@ -1979,7 +1979,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planeellipsoid) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecapsule) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecapsule) { Capsule s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -2219,7 +2219,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecapsule) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecapsule) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecapsule) { Capsule s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -2435,7 +2435,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecapsule) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecylinder) { Cylinder s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -2675,7 +2675,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecylinder) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecylinder) { Cylinder s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -2892,7 +2892,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecylinder) } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecone) { Cone s(5, 10); Halfspace hs(Vec3f(1, 0, 0), 0); @@ -3132,7 +3132,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_halfspacecone) testShapeIntersection(s, tf1, hs, tf2, GST_LIBCCD, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecone) { Cone s(5, 10); Plane hs(Vec3f(1, 0, 0), 0); @@ -3372,7 +3372,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersection_planecone) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_spheresphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -3434,7 +3434,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_spheresphere) EXPECT_TRUE_FALSE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxbox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -3500,7 +3500,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxbox) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxsphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxsphere) { Sphere s1(20); Box s2(5, 5, 5); @@ -3536,7 +3536,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_boxsphere) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_cylindercylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -3572,7 +3572,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_cylindercylinder) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -3608,7 +3608,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecone) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecylinder) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -3644,7 +3644,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_conecylinder) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_ellipsoidellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -3730,7 +3730,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistance_ellipsoidellipsoid) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheresphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -3832,7 +3832,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheresphere) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_boxbox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -3900,7 +3900,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_boxbox) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, true, contacts, false, false, true); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherebox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherebox) { Sphere s1(20); Box s2(5, 5, 5); @@ -3949,7 +3949,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherebox) // built-in GJK solver returns incorrect normal. } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherecapsule) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherecapsule) { Sphere s1(20); Capsule s2(5, 10); @@ -3997,7 +3997,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spherecapsule) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -4046,7 +4046,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercylinder) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_conecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -4106,7 +4106,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_conecone) // built-in GJK solver returns incorrect normal. } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercone) { Cylinder s1(5, 10); Cone s2(5, 10); @@ -4174,7 +4174,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_cylindercone) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_ellipsoidellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -4245,7 +4245,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_ellipsoidellipsoid) testShapeIntersection(s1, tf1, s2, tf2, GST_INDEP, false); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheretriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheretriangle) { Sphere s(10); Vec3f t[3]; @@ -4285,7 +4285,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_spheretriangle) EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_halfspacetriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_halfspacetriangle) { Halfspace hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -4326,7 +4326,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_halfspacetriangle) EXPECT_TRUE(normal.equal(transform.getRotation() * Vec3f(1, 0, 0), 1e-9)); } -TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_planetriangle) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_planetriangle) { Plane hs(Vec3f(1, 0, 0), 0); Vec3f t[3]; @@ -4391,7 +4391,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeIntersectionGJK_planetriangle) // | triangle |/////|////////|///////////|/////////|//////|//////////|///////|////////////| | // +------------+-----+--------+-----------+---------+------+----------+-------+------------+----------+ -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_spheresphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_spheresphere) { Sphere s1(20); Sphere s2(10); @@ -4452,7 +4452,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_spheresphere) EXPECT_TRUE_FALSE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxbox) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxbox) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -4488,7 +4488,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxbox) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxsphere) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxsphere) { Sphere s1(20); Box s2(5, 5, 5); @@ -4524,7 +4524,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_boxsphere) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_cylindercylinder) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_cylindercylinder) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -4560,7 +4560,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_cylindercylinder) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_conecone) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_conecone) { Cone s1(5, 10); Cone s2(5, 10); @@ -4596,7 +4596,7 @@ TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_conecone) EXPECT_TRUE(res); } -TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_ellipsoidellipsoid) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, shapeDistanceGJK_ellipsoidellipsoid) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -4697,7 +4697,7 @@ void testReversibleShapeIntersection(const S1& s1, const S2& s2, FCL_REAL distan true, true, true, false, tol)); } -TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeIntersection_allshapes) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeIntersection_allshapes) { // This test check whether a shape intersection algorithm is called for the // reverse case as well. For example, if FCL has sphere-capsule intersection @@ -4793,7 +4793,7 @@ void testReversibleShapeDistance(const S1& s1, const S2& s2, FCL_REAL distance) EXPECT_TRUE(p2A.equal(p1B, tol)); } -TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeDistance_allshapes) +GTEST_TEST(FCL_GEOMETRIC_SHAPES, reversibleShapeDistance_allshapes) { // This test check whether a shape distance algorithm is called for the // reverse case as well. For example, if FCL has sphere-capsule distance diff --git a/test/test_fcl_math.cpp b/test/test_fcl_math.cpp index 1f514082b..b88a6a19c 100644 --- a/test/test_fcl_math.cpp +++ b/test/test_fcl_math.cpp @@ -46,7 +46,7 @@ using namespace fcl; -TEST(FCL_MATH, vec_test_basic_vec32) +GTEST_TEST(FCL_MATH, vec_test_basic_vec32) { typedef Vec3fX > Vec3f32; Vec3f32 v1(1.0f, 2.0f, 3.0f); @@ -101,7 +101,7 @@ TEST(FCL_MATH, vec_test_basic_vec32) EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); } -TEST(FCL_MATH, vec_test_basic_vec64) +GTEST_TEST(FCL_MATH, vec_test_basic_vec64) { typedef Vec3fX > Vec3f64; Vec3f64 v1(1.0, 2.0, 3.0); @@ -164,7 +164,7 @@ TEST(FCL_MATH, vec_test_basic_vec64) #if FCL_HAVE_SSE -TEST(FCL_MATH, vec_test_sse_vec32) +GTEST_TEST(FCL_MATH, vec_test_sse_vec32) { typedef Vec3fX Vec3f32; Vec3f32 v1(1.0f, 2.0f, 3.0f); @@ -219,7 +219,7 @@ TEST(FCL_MATH, vec_test_sse_vec32) EXPECT_TRUE(normalize(v1).equal(v1 / v1.length())); } -TEST(FCL_MATH, vec_test_sse_vec64) +GTEST_TEST(FCL_MATH, vec_test_sse_vec64) { typedef Vec3fX Vec3f64; Vec3f64 v1(1.0, 2.0, 3.0); @@ -280,7 +280,7 @@ TEST(FCL_MATH, vec_test_sse_vec64) EXPECT_TRUE(v1.dot(v2) == 26); } -TEST(FCL_MATH, sse_mat32_consistent) +GTEST_TEST(FCL_MATH, sse_mat32_consistent) { typedef Vec3fX > Vec3f32; typedef Vec3fX Vec3f32SSE; @@ -327,7 +327,7 @@ TEST(FCL_MATH, sse_mat32_consistent) EXPECT_TRUE((m3(i, j) - m4(i, j) < 1e-1)); } -TEST(FCL_MATH, vec_test_sse_vec32_consistent) +GTEST_TEST(FCL_MATH, vec_test_sse_vec32_consistent) { typedef Vec3fX > Vec3f32; typedef Vec3fX Vec3f32SSE; @@ -475,7 +475,7 @@ TEST(FCL_MATH, vec_test_sse_vec32_consistent) EXPECT_TRUE(std::abs(v12[2] - v34[2]) < 1e-5); } -TEST(FCL_MATH, vec_test_sse_vec64_consistent) +GTEST_TEST(FCL_MATH, vec_test_sse_vec64_consistent) { typedef Vec3fX > Vec3f64; typedef Vec3fX Vec3f64SSE; @@ -625,7 +625,7 @@ TEST(FCL_MATH, vec_test_sse_vec64_consistent) #endif -TEST(FCL_MATH, morton) +GTEST_TEST(FCL_MATH, morton) { AABB bbox(Vec3f(0, 0, 0), Vec3f(1000, 1000, 1000)); morton_functor> F1(bbox); diff --git a/test/test_fcl_octomap.cpp b/test/test_fcl_octomap.cpp index db52e2f59..c2fa9a5d3 100644 --- a/test/test_fcl_octomap.cpp +++ b/test/test_fcl_octomap.cpp @@ -101,19 +101,19 @@ void octomap_collision_test_BVH(std::size_t n, bool exhaustive); template void octomap_distance_test_BVH(std::size_t n); -TEST(FCL_OCTOMAP, test_octomap_cost) +GTEST_TEST(FCL_OCTOMAP, test_octomap_cost) { octomap_cost_test(200, 100, 10, false, false); octomap_cost_test(200, 1000, 10, false, false); } -TEST(FCL_OCTOMAP, test_octomap_cost_mesh) +GTEST_TEST(FCL_OCTOMAP, test_octomap_cost_mesh) { octomap_cost_test(200, 100, 10, true, false); octomap_cost_test(200, 1000, 10, true, false); } -TEST(FCL_OCTOMAP, test_octomap_collision) +GTEST_TEST(FCL_OCTOMAP, test_octomap_collision) { octomap_collision_test(200, 100, false, 10, false, false); octomap_collision_test(200, 1000, false, 10, false, false); @@ -121,7 +121,7 @@ TEST(FCL_OCTOMAP, test_octomap_collision) octomap_collision_test(200, 1000, true, 1, false, false); } -TEST(FCL_OCTOMAP, test_octomap_collision_mesh) +GTEST_TEST(FCL_OCTOMAP, test_octomap_collision_mesh) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_collision_test(200, 10, false, 10, true, true); @@ -136,13 +136,13 @@ TEST(FCL_OCTOMAP, test_octomap_collision_mesh) #endif } -TEST(FCL_OCTOMAP, test_octomap_collision_mesh_triangle_id) +GTEST_TEST(FCL_OCTOMAP, test_octomap_collision_mesh_triangle_id) { octomap_collision_test_mesh_triangle_id(1, 30, 100000); } -TEST(FCL_OCTOMAP, test_octomap_collision_mesh_octomap_box) +GTEST_TEST(FCL_OCTOMAP, test_octomap_collision_mesh_octomap_box) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_collision_test(200, 10, false, 10, true, false); @@ -157,13 +157,13 @@ TEST(FCL_OCTOMAP, test_octomap_collision_mesh_octomap_box) #endif } -TEST(FCL_OCTOMAP, test_octomap_distance) +GTEST_TEST(FCL_OCTOMAP, test_octomap_distance) { octomap_distance_test(200, 100, false, false); octomap_distance_test(200, 1000, false, false); } -TEST(FCL_OCTOMAP, test_octomap_distance_mesh) +GTEST_TEST(FCL_OCTOMAP, test_octomap_distance_mesh) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test(200, 5, true, true); @@ -174,7 +174,7 @@ TEST(FCL_OCTOMAP, test_octomap_distance_mesh) #endif } -TEST(FCL_OCTOMAP, test_octomap_distance_mesh_octomap_box) +GTEST_TEST(FCL_OCTOMAP, test_octomap_distance_mesh_octomap_box) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test(200, 10, true, false); @@ -185,23 +185,23 @@ TEST(FCL_OCTOMAP, test_octomap_distance_mesh_octomap_box) #endif } -TEST(FCL_OCTOMAP, test_octomap_bvh_obb_collision_obb) +GTEST_TEST(FCL_OCTOMAP, test_octomap_bvh_obb_collision_obb) { octomap_collision_test_BVH(5, false); octomap_collision_test_BVH(5, true); } -TEST(FCL_OCTOMAP, test_octomap_bvh_rss_d_distance_rss) +GTEST_TEST(FCL_OCTOMAP, test_octomap_bvh_rss_d_distance_rss) { octomap_distance_test_BVH(5); } -TEST(FCL_OCTOMAP, test_octomap_bvh_obb_d_distance_obb) +GTEST_TEST(FCL_OCTOMAP, test_octomap_bvh_obb_d_distance_obb) { octomap_distance_test_BVH(5); } -TEST(FCL_OCTOMAP, test_octomap_bvh_kios_d_distance_kios) +GTEST_TEST(FCL_OCTOMAP, test_octomap_bvh_kios_d_distance_kios) { #ifdef FCL_BUILD_TYPE_DEBUG octomap_distance_test_BVH(2); diff --git a/test/test_fcl_shape_mesh_consistency.cpp b/test/test_fcl_shape_mesh_consistency.cpp index 41320a8e6..344873cce 100644 --- a/test/test_fcl_shape_mesh_consistency.cpp +++ b/test/test_fcl_shape_mesh_consistency.cpp @@ -50,7 +50,7 @@ using namespace fcl; FCL_REAL extents[6] = {0, 0, 0, 10, 10, 10}; -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_libccd) { Sphere s1(20); Sphere s2(20); @@ -141,7 +141,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_libccd) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_libccd) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -231,7 +231,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_libccd) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_libccd) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -322,7 +322,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_libccd) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_libccd) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -413,7 +413,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_libccd) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_libccd) { Cone s1(5, 10); Cone s2(5, 10); @@ -504,7 +504,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_libccd) } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_GJK) { Sphere s1(20); Sphere s2(20); @@ -597,7 +597,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_spheresphere_GJK) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_GJK) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -690,7 +690,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_ellipsoidellipsoid_GJK) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_GJK) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -782,7 +782,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_boxbox_GJK) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_GJK) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -883,7 +883,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_cylindercylinder_GJK) } } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_GJK) { Cone s1(5, 10); Cone s2(5, 10); @@ -977,7 +977,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_distance_conecone_GJK) -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_libccd) { Sphere s1(20); Sphere s2(10); @@ -1194,7 +1194,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_libccd) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_libccd) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -1413,7 +1413,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_libccd EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_libccd) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -1533,7 +1533,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_libccd) EXPECT_TRUE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_libccd) { Sphere s1(20); Box s2(5, 5, 5); @@ -1653,7 +1653,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_libccd) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_libccd) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -1740,7 +1740,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_libccd) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_libccd) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_libccd) { Cone s1(5, 10); Cone s2(5, 10); @@ -1894,7 +1894,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_libccd) -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_GJK) { Sphere s1(20); Sphere s2(10); @@ -2113,7 +2113,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spheresphere_GJK) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_GJK) { Ellipsoid s1(20, 40, 50); Ellipsoid s2(10, 10, 10); @@ -2332,7 +2332,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_ellipsoidellipsoid_GJK) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_GJK) { Box s1(20, 40, 50); Box s2(10, 10, 10); @@ -2454,7 +2454,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_boxbox_GJK) EXPECT_TRUE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_GJK) { Sphere s1(20); Box s2(5, 5, 5); @@ -2576,7 +2576,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_spherebox_GJK) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_GJK) { Cylinder s1(5, 10); Cylinder s2(5, 10); @@ -2665,7 +2665,7 @@ TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_cylindercylinder_GJK) EXPECT_TRUE_FALSE(res); } -TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_GJK) +GTEST_TEST(FCL_SHAPE_MESH_CONSISTENCY, consistency_collision_conecone_GJK) { Cone s1(5, 10); Cone s2(5, 10); diff --git a/test/test_fcl_simple.cpp b/test/test_fcl_simple.cpp index 03636564a..ee7045868 100644 --- a/test/test_fcl_simple.cpp +++ b/test/test_fcl_simple.cpp @@ -66,7 +66,7 @@ double distance_Vecnf(const Vecnf& a, const Vecnf& b) } -TEST(FCL_SIMPLE, Vec_nf_test) +GTEST_TEST(FCL_SIMPLE, Vec_nf_test) { Vecnf<4> a; Vecnf<4> b; @@ -113,7 +113,7 @@ TEST(FCL_SIMPLE, Vec_nf_test) } -TEST(FCL_SIMPLE, projection_test_line) +GTEST_TEST(FCL_SIMPLE, projection_test_line) { Vec3f v1(0, 0, 0); Vec3f v2(2, 0, 0); @@ -141,7 +141,7 @@ TEST(FCL_SIMPLE, projection_test_line) } -TEST(FCL_SIMPLE, projection_test_triangle) +GTEST_TEST(FCL_SIMPLE, projection_test_triangle) { Vec3f v1(0, 0, 1); Vec3f v2(0, 1, 0); @@ -204,7 +204,7 @@ TEST(FCL_SIMPLE, projection_test_triangle) EXPECT_TRUE(approx(res.parameterization[2], 0)); } -TEST(FCL_SIMPLE, projection_test_tetrahedron) +GTEST_TEST(FCL_SIMPLE, projection_test_tetrahedron) { Vec3f v1(0, 0, 1); Vec3f v2(0, 1, 0); diff --git a/test/test_fcl_sphere_capsule.cpp b/test/test_fcl_sphere_capsule.cpp index 6c9bffe81..9cb660212 100644 --- a/test/test_fcl_sphere_capsule.cpp +++ b/test/test_fcl_sphere_capsule.cpp @@ -44,7 +44,7 @@ using namespace fcl; -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z) { GJKSolver_libccd solver; @@ -58,7 +58,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z) EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z_negative) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z_negative) { GJKSolver_libccd solver; @@ -72,7 +72,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_z_negative) EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_x) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_x) { GJKSolver_libccd solver; @@ -86,7 +86,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_x) EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_capsule_rotated) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_capsule_rotated) { GJKSolver_libccd solver; @@ -102,7 +102,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_separated_capsule_rotated EXPECT_TRUE (!solver.shapeIntersect(sphere1, sphere1_transform, capsule, capsule_transform, NULL)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z) { GJKSolver_libccd solver; @@ -127,7 +127,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z) EXPECT_TRUE (Vec3f (0., 0., 0.).equal(contact_point)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z_rotated) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z_rotated) { GJKSolver_libccd solver; @@ -154,7 +154,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Intersect_test_penetration_z_rotated) EXPECT_TRUE (Vec3f (0., 0., 50.).equal(contact_point, solver.collision_tolerance)); } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_collision) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_collision) { GJKSolver_libccd solver; @@ -171,7 +171,7 @@ TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_collision) } -TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_separated) +GTEST_TEST(FCL_SPHERE_CAPSULE, Sphere_Capsule_Distance_test_separated) { GJKSolver_libccd solver; From 8919cf302ff6c58be659d7b24d5777fcce7e7565 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sat, 23 Jul 2016 08:22:41 -0400 Subject: [PATCH 16/17] Update README.md; removed boost --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 156686704..b815a641e 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ FCL has the following features ## Installation -Before compiling FCL, please make libccd (for collision checking between convex objects and is available here https://github.com/danfis/libccd) is installed. For libccd, make sure to compile from github version instead of the zip file from the webpage, because one bug fixing is not included in the zipped version. To compile -the unit tests, Boost also needs to be to installed. +Before compiling FCL, please make libccd (for collision checking between convex objects and is available here https://github.com/danfis/libccd) is installed. For libccd, make sure to compile from github version instead of the zip file from the webpage, because one bug fixing is not included in the zipped version. Some optional libraries need to be installed for some optional capability of FCL. For octree collision, please install the octomap library from http://octomap.github.com. From d1821983f6efe44d11ad36b6e65c9c3887e0de99 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sat, 23 Jul 2016 08:32:04 -0400 Subject: [PATCH 17/17] Remove boost from CI settings and install instruction --- .appveyor.yml | 4 +--- INSTALL | 3 +-- ci/install_osx.sh | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d74414cb3..3c9bfb16c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,8 +14,6 @@ platform: x64 environment: CTEST_OUTPUT_ON_FAILURE: 1 - BOOST_ROOT: C:\Libraries\boost_1_59_0 - BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0 cache: - C:\Program Files\libccd @@ -36,7 +34,7 @@ before_build: - cmd: set - cmd: mkdir build - cmd: cd build - - cmd: cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=%Configuration% -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DCCD_INCLUDE_DIRS="C:\Program Files\libccd\include" -DCCD_LIBRARY="C:\Program Files\libccd\lib\ccd.lib" .. + - cmd: cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=%Configuration% -DCCD_INCLUDE_DIRS="C:\Program Files\libccd\include" -DCCD_LIBRARY="C:\Program Files\libccd\lib\ccd.lib" .. build: project: C:\projects\fcl\build\fcl.sln diff --git a/INSTALL b/INSTALL index 85759aa8c..bc618c4b6 100644 --- a/INSTALL +++ b/INSTALL @@ -2,11 +2,10 @@ Dependencies: ============ - - Boost (thread, date_time, unit_test_framework, filesystem) - libccd (available at http://libccd.danfis.cz/) - octomap (optional dependency, available at http://octomap.github.com) -Boost and libccd are mandatory dependencies. If octomap is not found, +libccd is the only mandatory dependency. If octomap is not found, collision detection with octrees will not be possible. For installation, CMake will also be needed (http://cmake.org). diff --git a/ci/install_osx.sh b/ci/install_osx.sh index 1b1a61070..9e8854374 100755 --- a/ci/install_osx.sh +++ b/ci/install_osx.sh @@ -2,5 +2,4 @@ brew tap homebrew/science brew install git brew install cmake -brew install boost brew install libccd