From e9de7e88adc7cd3abb0c43b44eddd21a37833463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sat, 7 Dec 2024 23:34:58 +0100 Subject: [PATCH] Fix test pretty much never testing envelope tests + read all formats --- .../test_remove_caps_needles.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_remove_caps_needles.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_remove_caps_needles.cpp index fa80d93caf0..548d15e8b01 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_remove_caps_needles.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_remove_caps_needles.cpp @@ -28,7 +28,7 @@ void general_test(std::string filename) std::ifstream input(filename); Mesh mesh; - if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) { + if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Not a valid input file." << std::endl; exit(EXIT_FAILURE); } @@ -56,7 +56,8 @@ void test_with_envelope(std::string filename, double eps) std::ifstream input(filename); Mesh mesh, bk; - if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) { + if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) + { std::cerr << "Not a valid input file." << std::endl; exit(EXIT_FAILURE); } @@ -131,7 +132,8 @@ void test_parameters_on_pig(std::string filename) std::ifstream input(filename); Mesh mesh, bk; - if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) { + if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) + { std::cerr << "Not a valid input file." << std::endl; exit(EXIT_FAILURE); } @@ -164,13 +166,11 @@ void test_parameters_on_pig(std::string filename) int main(int argc, char** argv) { const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/pig.off"); + double eps = (argc > 2) ? atof(argv[2]) : 0.01; general_test(filename); - if (argc==2) - test_with_envelope(filename, 0.01); - else - if (argc==3) - test_with_envelope(filename, atof(argv[2])); + + test_with_envelope(filename, eps); // only run that test with pig.off if (argc==1)