From 0cb9a5a1bec4e55ae5dbfd682324410246a377a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jul 2015 08:59:50 +0200 Subject: [PATCH 1/3] use assert in tests --- .../self_intersection_surface_mesh_test.cpp | 4 ++-- .../triangulate_hole_Polyhedron_3_no_delaunay_test.cpp | 6 +++--- .../triangulate_hole_Polyhedron_3_test.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/self_intersection_surface_mesh_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/self_intersection_surface_mesh_test.cpp index 386e05de0f2..c69bc8716a1 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/self_intersection_surface_mesh_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/self_intersection_surface_mesh_test.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) std::back_inserter(intersected_tris), CGAL::Polygon_mesh_processing::parameters::vertex_index_map(get(CGAL::vertex_point, m))); bool intersecting_1 = !intersected_tris.empty(); - CGAL_assertion(!intersecting_1); + assert(!intersecting_1); std::cerr << "self_intersections test took " << timer.time() << " sec." << std::endl; std::cerr << intersected_tris.size() << " pairs of triangles are intersecting." << std::endl; @@ -40,7 +40,7 @@ int main(int argc, char** argv) bool intersecting_2 = CGAL::Polygon_mesh_processing::does_self_intersect(m, CGAL::Polygon_mesh_processing::parameters::vertex_index_map(get(CGAL::vertex_point, m))); - CGAL_assertion(intersecting_1 == intersecting_2); + assert(intersecting_1 == intersecting_2); std::cerr << "does_self_intersect test took " << timer.time() << " sec." << std::endl; std::cerr diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp index 6d4050f1408..705b44e5da4 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_no_delaunay_test.cpp @@ -58,7 +58,7 @@ void detect_borders(Polyhedron& poly, std::vector& border_reps) Halfedge_around_facet_circulator hf_around_facet(h,poly), done(hf_around_facet); do { bool insertion_ok = border_map.insert(*hf_around_facet).second; - CGAL_assertion(insertion_ok); + assert(insertion_ok); } while(++hf_around_facet != done); } } @@ -135,13 +135,13 @@ void test_triangulate_hole(const char* file_name) { CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch)); if(patch.empty()) { std::cerr << " Error: empty patch created." << std::endl; - CGAL_assertion(false); + assert(false); } } if(!poly.is_valid() || ! is_closed(poly)) { std::cerr << " Error: patched polyhedron is not valid or closed." << std::endl; - CGAL_assertion(false); + assert(false); } std::cout << " Done!" << std::endl; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp index a9b76d26efb..5240955b1d8 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/triangulate_hole_Polyhedron_3_test.cpp @@ -57,7 +57,7 @@ void detect_borders(Polyhedron& poly, std::vector& border_reps) Halfedge_around_facet_circulator hf_around_facet(h,poly), done(hf_around_facet); do { bool insertion_ok = border_map.insert(*hf_around_facet).second; - CGAL_assertion(insertion_ok); + assert(insertion_ok); } while(++hf_around_facet != done); } } @@ -146,13 +146,13 @@ void test_triangulate_hole(const char* file_name) { CGAL::Polygon_mesh_processing::triangulate_hole(poly, *it, back_inserter(patch)); if(patch.empty()) { std::cerr << " Error: empty patch created." << std::endl; - CGAL_assertion(false); + assert(false); } } if(!poly.is_valid() || ! is_closed(poly)) { std::cerr << " Error: patched polyhedron is not valid or closed." << std::endl; - CGAL_assertion(false); + assert(false); } std::cout << " Done!" << std::endl; From 1e743cf0ae9abf1dae5cbd160ddcf5ecb5d6551d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jul 2015 09:00:08 +0200 Subject: [PATCH 2/3] remove extra ; --- .../demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp index 3fc313b8bba..b6e5337fbc4 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp @@ -504,7 +504,8 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_selected_holes_button() { } print_message(tr("%1 of %2 holes are filled!").arg(filled_counter).arg(counter)); QApplication::restoreOverrideCursor(); -}; +} + // fills all holes and removes associated Scene_hole_visualizer if any void Polyhedron_demo_hole_filling_plugin::on_Select_all_holes_button() { Scene_hole_visualizer* hole_visualizer = get_selected_item(); From 0140746292f23db277484298420758340dbf9eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jul 2015 14:43:07 +0200 Subject: [PATCH 3/3] remove non-needed typedef --- Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp index 6509814e4ca..b7ead0f0bdf 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp @@ -433,7 +433,6 @@ Scene_polyhedron_item::compute_normals_and_vertices(void) typedef Polyhedron::Traits Kernel; typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; - typedef Polyhedron::Facet Facet; typedef Polyhedron::Facet_iterator Facet_iterator; typedef Polyhedron::Halfedge_around_facet_circulator HF_circulator;