is_edge_manifold.cpp 834 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <test_common.h>
  2. #include <igl/is_edge_manifold.h>
  3. class is_edge_manifold : public ::testing::TestWithParam<std::string> {};
  4. TEST_CASE("is_edge_manifold: positive", "[igl]")
  5. {
  6. const auto test_case = [](const std::string &param)
  7. {
  8. Eigen::MatrixXd V, TC;
  9. Eigen::MatrixXi F;
  10. test_common::load_mesh(param, V, F, TC);
  11. REQUIRE ( igl::is_edge_manifold(F) );
  12. };
  13. test_common::run_test_cases(test_common::manifold_meshes(), test_case);
  14. }
  15. TEST_CASE("is_edge_manifold: negative", "[igl]")
  16. {
  17. Eigen::MatrixXd V, TC;
  18. Eigen::MatrixXi F;
  19. // Known non-manifold mesh
  20. test_common::load_mesh("truck.obj", V, F, TC);
  21. REQUIRE (! igl::is_edge_manifold(F) );
  22. }
  23. INSTANTIATE_TEST_CASE_P
  24. (
  25. manifold_meshes,
  26. is_edge_manifold,
  27. ::testing::ValuesIn(test_common::manifold_meshes()),
  28. test_common::string_test_name
  29. );