Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 committed Jan 12, 2025
1 parent cea27d1 commit 43ccf6d
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 462 deletions.
1 change: 0 additions & 1 deletion tesseract_urdf/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_executable(
tesseract_urdf_capsule_unit.cpp
tesseract_urdf_collision_unit.cpp
tesseract_urdf_cone_unit.cpp
tesseract_urdf_convex_mesh_unit.cpp
tesseract_urdf_cylinder_unit.cpp
tesseract_urdf_dynamics_unit.cpp
tesseract_urdf_extra_delimeters_unit.cpp
Expand Down
15 changes: 9 additions & 6 deletions tesseract_urdf/test/tesseract_urdf_collision_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
TEST(TesseractURDFUnit, parse_collision) // NOLINT
{
tesseract_common::GeneralResourceLocator resource_locator;
const bool global_make_convex = false;
const auto parse_collision_fn =
std::bind(&tesseract_urdf::parseCollision, std::placeholders::_1, std::placeholders::_2, global_make_convex);

{
std::string str = R"(<collision extra="0 0 0">
Expand All @@ -23,7 +26,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_TRUE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem->geometry != nullptr);
EXPECT_FALSE(elem->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8));
}
Expand All @@ -36,7 +39,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_TRUE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem->geometry != nullptr);
EXPECT_TRUE(elem->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8));
}
Expand All @@ -49,7 +52,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_TRUE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem->geometry != nullptr);
EXPECT_TRUE(elem->origin.isApprox(Eigen::Isometry3d::Identity(), 1e-8));
EXPECT_TRUE(elem->geometry->getType() == tesseract_geometry::GeometryType::COMPOUND_MESH);
Expand All @@ -65,7 +68,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_FALSE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem == nullptr);
}

Expand All @@ -77,7 +80,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_FALSE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem == nullptr);
}

Expand All @@ -86,7 +89,7 @@ TEST(TesseractURDFUnit, parse_collision) // NOLINT
</collision>)";
tesseract_scene_graph::Collision::Ptr elem;
EXPECT_FALSE(runTest<tesseract_scene_graph::Collision::Ptr>(
elem, &tesseract_urdf::parseCollision, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
elem, parse_collision_fn, str, tesseract_urdf::COLLISION_ELEMENT_NAME, resource_locator));
EXPECT_TRUE(elem == nullptr);
}
}
Expand Down
289 changes: 0 additions & 289 deletions tesseract_urdf/test/tesseract_urdf_convex_mesh_unit.cpp

This file was deleted.

Loading

0 comments on commit 43ccf6d

Please sign in to comment.