diff --git a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp index d1a8b19c9f4..fa756716fcb 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp +++ b/Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits.cpp @@ -103,7 +103,7 @@ void test_CR_for(const NT& f){ // try chinese remainder do{ // chinese remainder failed if q > 2*max_coeff(f) - CGAL_postcondition_msg(pq < p*(2*max_coeff), " chinese remainder failed "); + assert(pq < p*(2*max_coeff)); prime_index++; if(prime_index < 1000){ diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index c74accc8586..fcc7d42ce9f 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -934,7 +935,7 @@ public: void build_TM_vertices_vector(std::vector& tm_vds) const { - assert(tm_vds.empty()); + CGAL_precondition(tm_vds.empty()); // If the input is a list of integers, we need to build a correspondence // between vertices and integers. @@ -1008,7 +1009,7 @@ public: TM_halfedge_descriptor add_seams(InputIterator first, InputIterator last) { // must have an even number of input vertices - assert(std::distance(first, last) % 2 == 0); + CGAL_precondition(std::distance(first, last) % 2 == 0); TM_halfedge_descriptor tmhd = boost::graph_traits::null_halfedge(); InputIterator it = first; diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index dd98a8f6852..b88d2da34b6 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -22,6 +22,7 @@ #include #include +#include namespace CGAL { @@ -1112,7 +1113,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, for(halfedge_descriptor f_hd : faces_traversed) { - assert(target(f_hd, tm) == vd); + CGAL_assertion(target(f_hd, tm) == vd); put(is_selected, face(f_hd, tm), true); vertices_queue.insert( target( next(f_hd, tm), tm) ); vertices_queue.insert( source(f_hd, tm) ); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 5f409521c1e..0d93046670d 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -13,6 +13,7 @@ #define CGAL_COMBINATORIAL_MAP_H 1 #include +#include #include @@ -2627,7 +2628,7 @@ namespace CGAL { if ( marks[acells[i]]==INVALID_MARK ) { marks[acells[i]] = get_new_mark(); - assert(is_whole_map_unmarked(marks[acells[i]])); + CGAL_assertion(is_whole_map_unmarked(marks[acells[i]])); } } @@ -3636,9 +3637,9 @@ namespace CGAL { } } - assert(is_whole_map_unmarked(m1)); - assert(is_whole_map_unmarked(markpush)); - assert(map2.is_whole_map_unmarked(m2)); + CGAL_postcondition(is_whole_map_unmarked(m1)); + CGAL_postcondition(is_whole_map_unmarked(markpush)); + CGAL_postcondition(map2.is_whole_map_unmarked(m2)); free_mark(m1); free_mark(markpush); map2.free_mark(m2); @@ -4660,7 +4661,7 @@ namespace CGAL { } // Make copies of the new facet for dimension >=4 - assert(!is_free(first, 2)); + CGAL_assertion(!is_free(first, 2)); for ( unsigned int dim=4; dim<=dimension; ++dim ) { if ( !is_free(beta(first, 2), dim) ) @@ -4684,7 +4685,7 @@ namespace CGAL { basic_link_beta_for_involution<2>(beta(it, 3, 2, dim), dd); } - assert(!is_free(it, 2)); + CGAL_assertion(!is_free(it, 2)); this->template basic_link_beta_for_involution<2>(beta(it, 2, dim), d); if ( prec!=null_handle ) diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 73fa3becf5e..90390482abc 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -12,6 +12,8 @@ #ifndef CGAL_GENERALIZED_MAP_H #define CGAL_GENERALIZED_MAP_H 1 +#include + #include #include #include @@ -755,14 +757,14 @@ namespace CGAL { void set_next(Dart_handle dh1, Dart_handle dh2) { - assert(!this->template is_free<0>(dh1)); + CGAL_assertion(!this->template is_free<0>(dh1)); this->template link_alpha<1>(this->template alpha<0>(dh1), dh2); } template void set_opposite(Dart_handle dh1, Dart_handle dh2) { - assert(!this->template is_free<0>(dh1)); - assert(!this->template is_free<0>(dh2)); + CGAL_assertion(!this->template is_free<0>(dh1)); + CGAL_assertion(!this->template is_free<0>(dh2)); this->template link_alpha(this->template alpha<0>(dh1), dh2); this->template link_alpha(dh1, this->template alpha<0>(dh2)); } @@ -780,7 +782,7 @@ namespace CGAL { size_type number_of_halfedges() const { - assert(is_without_boundary(0)); + CGAL_assertion(is_without_boundary(0)); return number_of_darts()/2; } @@ -1752,7 +1754,7 @@ namespace CGAL { if ( marks[acells[i]]==INVALID_MARK ) { marks[acells[i]] = get_new_mark(); - assert(is_whole_map_unmarked(marks[acells[i]])); + CGAL_assertion(is_whole_map_unmarked(marks[acells[i]])); } } @@ -2632,9 +2634,9 @@ namespace CGAL { } } - assert(is_whole_map_unmarked(m1)); - assert(is_whole_map_unmarked(markpush)); - assert(map2.is_whole_map_unmarked(m2)); + CGAL_postcondition(is_whole_map_unmarked(m1)); + CGAL_postcondition(is_whole_map_unmarked(markpush)); + CGAL_postcondition(map2.is_whole_map_unmarked(m2)); free_mark(m1); free_mark(markpush); map2.free_mark(m2); @@ -2771,11 +2773,11 @@ namespace CGAL { if (aorientationmark==INVALID_MARK) { - assert(is_whole_map_marked(orientationmark)); + CGAL_assertion(is_whole_map_marked(orientationmark)); free_mark(orientationmark); } - assert(is_whole_map_marked(ccmark)); + CGAL_assertion(is_whole_map_marked(ccmark)); free_mark(ccmark); } @@ -2817,11 +2819,11 @@ namespace CGAL { if (aorientationmark==INVALID_MARK) { - assert(is_whole_map_unmarked(orientationmark)); + CGAL_assertion(is_whole_map_unmarked(orientationmark)); free_mark(orientationmark); } - assert(is_whole_map_unmarked(ccmark)); + CGAL_postcondition(is_whole_map_unmarked(ccmark)); free_mark(ccmark); return orientable; diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 57c91cb7701..882bf7c98d7 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,7 @@ namespace internal ++nb; } - assert(nb>0); + CGAL_assertion(nb>0); return (typename Kernel_traits::Kernel::Construct_scaled_vector_3() (normal, 1.0/nb)); } diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 3bf83132a3a..111b70f0fd3 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -52,6 +52,7 @@ #include #include #include +#include namespace CGAL { @@ -612,7 +613,7 @@ protected: vao[VAO_MONO_POINTS].bind(); unsigned int bufn = 0; - assert(bufn(arrays[POS_MONO_POINTS].size()*sizeof(float))); @@ -629,7 +630,7 @@ protected: vao[VAO_COLORED_POINTS].bind(); ++bufn; - assert(bufn(arrays[POS_COLORED_POINTS].size()*sizeof(float))); @@ -638,7 +639,7 @@ protected: buffers[bufn].release(); ++bufn; - assert(bufn(arrays[COLOR_POINTS].size()*sizeof(float))); @@ -654,7 +655,7 @@ protected: vao[VAO_MONO_SEGMENTS].bind(); ++bufn; - assert(bufn(arrays[POS_MONO_SEGMENTS].size()*sizeof(float))); @@ -671,7 +672,7 @@ protected: vao[VAO_COLORED_SEGMENTS].bind(); ++bufn; - assert(bufn(arrays[POS_COLORED_SEGMENTS].size()*sizeof(float))); @@ -681,7 +682,7 @@ protected: buffers[bufn].release(); ++bufn; - assert(bufn(arrays[COLOR_SEGMENTS].size()*sizeof(float))); @@ -699,7 +700,7 @@ protected: vao[VAO_MONO_RAYS].bind(); ++bufn; - assert(bufn(arrays[POS_MONO_RAYS].size()*sizeof(float))); @@ -717,7 +718,7 @@ protected: vao[VAO_COLORED_RAYS].bind(); ++bufn; - assert(bufn(arrays[POS_COLORED_RAYS].size()*sizeof(float))); @@ -727,7 +728,7 @@ protected: buffers[bufn].release(); ++bufn; - assert(bufn(arrays[COLOR_RAYS].size()*sizeof(float))); @@ -744,7 +745,7 @@ protected: vao[VAO_MONO_LINES].bind(); ++bufn; - assert(bufn(arrays[POS_MONO_LINES].size()*sizeof(float))); @@ -762,7 +763,7 @@ protected: vao[VAO_COLORED_LINES].bind(); ++bufn; - assert(bufn(arrays[POS_COLORED_LINES].size()*sizeof(float))); @@ -772,7 +773,7 @@ protected: buffers[bufn].release(); ++bufn; - assert(bufn(arrays[COLOR_LINES].size()*sizeof(float))); @@ -792,7 +793,7 @@ protected: // 5.1.1) points of the mono faces ++bufn; - assert(bufn(arrays[POS_MONO_FACES].size()*sizeof(float))); @@ -803,7 +804,7 @@ protected: // 5.1.2) normals of the mono faces ++bufn; - assert(bufn(arrays[POS_COLORED_FACES].size()*sizeof(float))); @@ -842,7 +843,7 @@ protected: // 5.2.2) normals of the color faces ++bufn; - assert(bufn(arrays[COLOR_FACES].size()*sizeof(float))); @@ -886,7 +887,7 @@ protected: vao[VAO_CLIPPING_PLANE].bind(); ++bufn; - assert(bufn < NB_VBO_BUFFERS); + CGAL_assertion(bufn < NB_VBO_BUFFERS); buffers[bufn].bind(); buffers[bufn].allocate(arrays[POS_CLIPPING_PLANE].data(), static_cast(arrays[POS_CLIPPING_PLANE].size() * sizeof(float))); diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h index 04e247e7ddb..a0d7e74a3ab 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h @@ -17,6 +17,7 @@ #include #include +#include namespace CGAL { @@ -123,7 +124,7 @@ public: Circle_2 circle = _gt.construct_circle_2_object()(center, sq_radius); // uncomment!!! - //assert(circle.has_on_boundary(p) && circle.has_on_boundary(q)); + // CGAL_assertion(circle.has_on_boundary(p) && circle.has_on_boundary(q)); if(_gt.orientation_2_object()(p, q, center) == LEFT_TURN) return Circular_arc_2(circle, p, q); diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h index 56fe0a14f7a..597cfa0ce66 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -513,7 +514,7 @@ namespace CGAL { { for (++it2; it2!=it1end; ) { - assert(*it1!=*it2); + CGAL_assertion(*it1!=*it2); if (!this->template is_opposite_exist<3>(*it2) && are_facets_opposite_and_same_geometry (*it1, this->previous(*it2))) diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 845664fcbb4..494b5e68fa0 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -341,7 +342,7 @@ namespace CGAL { do { ++n; - assert(alcc.is_next_exist(cur)); + CGAL_assertion(alcc.is_next_exist(cur)); cur=alcc.next(cur); } while(cur!=itall); @@ -356,7 +357,7 @@ namespace CGAL { writer.write_facet_vertex_index(index[VCI(alcc.vertex_attribute(cur))]); alcc.mark(cur, m); alcc.mark(alcc.other_orientation(cur), m); // for GMap only, for CMap - assert(alcc.is_next_exist(cur)); // marks the same dart twice + CGAL_assertion(alcc.is_next_exist(cur)); // marks the same dart twice cur=alcc.next(cur); } while(cur!=itall); diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h index 5720390772b..1aaac16e103 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace CGAL { /////////////////////////////////////////////////////////////////////////////// @@ -70,7 +71,7 @@ namespace CGAL { typename LCC::Dart_handle prev_dart) { // here we need to create a last dart and 0-link it - assert(prev_dart!=lcc.null_handle); + CGAL_assertion(prev_dart!=lcc.null_handle); lcc.template link_alpha<0>(prev_dart, lcc.create_dart(vh)); } }; @@ -353,8 +354,8 @@ public: DH s2=d2; do { - assert(lcc.is_next_exist(d1) && lcc.is_previous_exist(d2)); - assert(lcc.other_extremity(d2)!=lcc.null_handle); + CGAL_assertion(lcc.is_next_exist(d1) && lcc.is_previous_exist(d2)); + CGAL_assertion(lcc.other_extremity(d2)!=lcc.null_handle); if (lcc.vertex_attribute(d1)!=lcc.vertex_attribute(d2)) { return false; } diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h index 496a4c58fd8..025ed1d5f60 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace CGAL { @@ -82,7 +83,7 @@ namespace CGAL { } while(adart!=start); - assert(nb>0); + CGAL_assertion(nb>0); return (typename LCC::Traits::Construct_scaled_vector()(normal, 1.0/nb)); // return normal / std::sqrt(normal * normal); } @@ -201,7 +202,7 @@ namespace CGAL { } while(adart!=start); - assert(nb>1); + CGAL_assertion(nb>1); return typename LCC::Traits::Construct_translated_point() (CGAL::ORIGIN, typename LCC::Traits::Construct_scaled_vector() (vec, 1.0/nb)); diff --git a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h index 3354388be33..dda7b92e5ac 100644 --- a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h +++ b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h @@ -29,6 +29,7 @@ #include #include +#include #define CGAL_LCC_TEMPLATE_ARGS templateget_f(2); } diff --git a/Modifier/test/Modifier/test_modifier.cpp b/Modifier/test/Modifier/test_modifier.cpp index b247c524476..6c32ee3eeba 100644 --- a/Modifier/test/Modifier/test_modifier.cpp +++ b/Modifier/test/Modifier/test_modifier.cpp @@ -37,7 +37,7 @@ public: void delegate( Modifier_base& modifier) { modifier(i); // check validity - CGAL_postcondition( i > 0); + assert( i > 0); } int get_i() const { return i;} // read access }; diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 5a81d639ea3..2931c43f407 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -22,6 +22,8 @@ #include #include #include +#include + #include namespace CGAL { @@ -209,7 +211,7 @@ protected: ++nb; } - assert(nb > 0); + CGAL_assertion(nb > 0); return (typename Local_kernel::Construct_scaled_vector_3()(normal, 1.0 / nb)); } diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index f77bff917f8..528d0d161af 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -475,7 +476,7 @@ public: iterator insert (const Point& p, const Vector& n) { iterator out = insert (p); - assert (has_normal_map()); + CGAL_assertion(has_normal_map()); m_normals[size()-1] = n; return out; } diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index 03309fd9027..147f7e90b26 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -69,6 +69,7 @@ #include #include +#include #ifdef CGAL_ENVELOPE_DEBUG // This is for computing the surface mesh of a prism @@ -1753,7 +1754,7 @@ private: inter = Implicit_Seg_Facet_interpoint_Out_Prism_return_local_id_with_face_order_jump_over(ip, filtered_intersection, intersect_face, coverlist, jump1, check_id); - assert(inter != 2);// the point must exist because it is a seg-halfplane intersection + CGAL_assertion(inter != 2);// the point must exist because it is a seg-halfplane intersection if (inter == 1) { return true; @@ -2084,7 +2085,7 @@ private: std::cout << p.ep << " | " << p.eq << " | " << p.er << std::endl; ePoint_3 pv(ver[faces[i][0]].x(), ver[faces[i][0]].y(),ver[faces[i][0]].z()); Orientation ori = orientation(p.ep, p.eq, p.er, pv); - assert(ori == NEGATIVE); + CGAL_assertion(ori == NEGATIVE); } #endif diff --git a/Polyhedron/test/Polyhedron/test_polyhedron.cpp b/Polyhedron/test/Polyhedron/test_polyhedron.cpp index 0ac4ea66945..0f565b2f046 100644 --- a/Polyhedron/test/Polyhedron/test_polyhedron.cpp +++ b/Polyhedron/test/Polyhedron/test_polyhedron.cpp @@ -221,7 +221,7 @@ typename Poly::Halfedge_handle make_cube_3( Poly& P) { Halfedge_handle e = P.split_edge( f); e->vertex()->point() = Point( 1, 1, 1); // Fig. (e) P.split_facet( e, f->next()->next()); // Fig. (f) - CGAL_postcondition( P.is_valid()); + assert( P.is_valid()); return h; } diff --git a/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h b/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h index ad52f1c95cc..a797ebb5d9e 100644 --- a/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h +++ b/Polynomial/test/Polynomial/include/CGAL/gen_sparse_polynomial.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace CGAL { @@ -36,7 +37,7 @@ generate_sparse_random_polynomial(CGAL::Random random, int max_degree = 6){ Monom_rep monom_rep; monom_rep.push_back(Monom(exps,c)); result += construct(monom_rep.begin(), monom_rep.end()); - CGAL_postcondition(result.degree() >= 0); + assert(result.degree() >= 0); } // std::cout << result << std::endl; return result; diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 6e64790a239..5d1f91158b0 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -480,7 +481,7 @@ public: // We use the block structure to provide an efficient version : // we check if the address is in the range of each block. - assert(cit != end()); + CGAL_assertion(cit != end()); const_pointer c = &*cit; size_type res=0; @@ -1050,7 +1051,7 @@ namespace internal { bool operator<(const CC_iterator& other) const { #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP - assert( is_time_stamp_valid() ); + CGAL_assertion( is_time_stamp_valid() ); #endif return Time_stamper::less(m_ptr, other.m_ptr); } @@ -1058,7 +1059,7 @@ namespace internal { bool operator>(const CC_iterator& other) const { #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP - assert( is_time_stamp_valid() ); + CGAL_assertion( is_time_stamp_valid() ); #endif return Time_stamper::less(other.m_ptr, m_ptr); } @@ -1066,7 +1067,7 @@ namespace internal { bool operator<=(const CC_iterator& other) const { #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP - assert( is_time_stamp_valid() ); + CGAL_assertion( is_time_stamp_valid() ); #endif return Time_stamper::less(m_ptr, other.m_ptr) || (*this == other); @@ -1075,7 +1076,7 @@ namespace internal { bool operator>=(const CC_iterator& other) const { #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP - assert( is_time_stamp_valid() ); + CGAL_assertion( is_time_stamp_valid() ); #endif return Time_stamper::less(other.m_ptr, m_ptr) || (*this == other); diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 7ba9befa3a3..6bbdeee9176 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -481,7 +482,7 @@ public: // We use the block structure to provide an efficient version : // we check if the address is in the range of each block. - assert(cit != end()); + CGAL_assertion(cit != end()); const_pointer c = &*cit; size_type res=0; diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp b/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp index e416af439d5..7996c1af5dd 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp +++ b/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp @@ -22,6 +22,8 @@ #define BOOST_RELAXED_HEAP_HEADER +#include + #include #include #include @@ -192,7 +194,7 @@ public: void remove(const value_type& x) { group* a = &index_to_group[get(id, x) / log_n]; - assert(groups[get(id, x)]); + CGAL_assertion(groups[get(id, x)]); a->value = x; a->kind = smallest_key; promote(a); @@ -203,14 +205,14 @@ public: value_type& top() { find_smallest(); - assert(smallest_value->value != boost::none); + CGAL_assertion(smallest_value->value != boost::none); return *smallest_value->value; } const value_type& top() const { find_smallest(); - assert(smallest_value->value != boost::none); + CGAL_assertion(smallest_value->value != boost::none); return *smallest_value->value; } @@ -236,7 +238,7 @@ public: rank_type r = x->rank; group* p = x->parent; { - assert(x->value != boost::none); + CGAL_assertion(x->value != boost::none); // Find x's group size_type start = get(id, *x->value) - get(id, *x->value) % log_n; @@ -276,7 +278,7 @@ public: y->parent = p; p->children[r] = y; - assert(r == y->rank); + CGAL_assertion(r == y->rank); if (A[y->rank] == x) A[y->rank] = do_compare(y, p) ? y : 0; } @@ -368,7 +370,7 @@ public: } else { - assert(p->parent == p); + CGAL_assertion(p->parent == p); } } if (!in_progress) @@ -481,10 +483,10 @@ private: void promote(group* a) { - assert(a != 0); + CGAL_assertion(a != 0); rank_type r = a->rank; group* p = a->parent; - assert(p != 0); + CGAL_assertion(p != 0); if (do_compare(a, p)) { // s is the rank + 1 sibling @@ -500,7 +502,7 @@ private: } else { - assert(s != 0); + CGAL_assertion(s != 0); if (A[r + 1] == s) active_sibling_transform(a, s); else @@ -511,7 +513,7 @@ private: group* combine(group* a1, group* a2) { - assert(a1->rank == a2->rank); + CGAL_assertion(a1->rank == a2->rank); if (do_compare(a2, a1)) do_swap(a1, a2); a1->children[a1->rank++] = a2; @@ -528,7 +530,7 @@ private: rank_type s = q->rank - 2; group* x = q->children[s]; group* xp = qp->children[s]; - assert(s == x->rank); + CGAL_assertion(s == x->rank); // If x is active, swap x and xp if (A[s] == x) @@ -549,35 +551,35 @@ private: // p is a's parent group* p = a->parent; - assert(p != 0); + CGAL_assertion(p != 0); // g is p's parent (a's grandparent) group* g = p->parent; - assert(g != 0); + CGAL_assertion(g != 0); // a' <- A(r) - assert(A[r] != 0); + CGAL_assertion(A[r] != 0); group* ap = A[r]; - assert(ap != 0); + CGAL_assertion(ap != 0); // A(r) <- nil A[r] = 0; // let a' have parent p' group* pp = ap->parent; - assert(pp != 0); + CGAL_assertion(pp != 0); // let a' have grandparent g' group* gp = pp->parent; - assert(gp != 0); + CGAL_assertion(gp != 0); // Remove a and a' from their parents - assert(ap + CGAL_assertion(ap == pp->children[pp->rank - 1]); // Guaranteed because ap is active --pp->rank; // Guaranteed by caller - assert(a == p->children[p->rank - 1]); + CGAL_assertion(a == p->children[p->rank - 1]); --p->rank; // Note: a, ap, p, pp all have rank r @@ -590,7 +592,7 @@ private: // Assuming k(p) <= k(p') // make p' the rank r child of p - assert(r == p->rank); + CGAL_assertion(r == p->rank); p->children[p->rank++] = pp; pp->parent = p; @@ -598,7 +600,7 @@ private: group* c = combine(a, ap); // make c the rank r+1 child of g' - assert(gp->rank > r + 1); + CGAL_assertion(gp->rank > r + 1); gp->children[r + 1] = c; c->parent = gp; @@ -622,10 +624,10 @@ private: group* g = p->parent; // remove a, s from their parents - assert(s->parent == p); - assert(p->children[p->rank - 1] == s); + CGAL_assertion(s->parent == p); + CGAL_assertion(p->children[p->rank - 1] == s); --p->rank; - assert(p->children[p->rank - 1] == a); + CGAL_assertion(p->children[p->rank - 1] == a); --p->rank; rank_type r = a->rank; @@ -634,7 +636,7 @@ private: group* c = combine(a, s); // make c the rank r+2 child of g - assert(g->children[r + 2] == p); + CGAL_assertion(g->children[r + 2] == p); g->children[r + 2] = c; c->parent = g; if (A[r + 2] == p) @@ -650,7 +652,7 @@ private: #endif rank_type r = a->rank; group* c = s->children[s->rank - 1]; - assert(c->rank == r); + CGAL_assertion(c->rank == r); if (A[r] == c) { #if defined(BOOST_RELAXED_HEAP_DEBUG) && BOOST_RELAXED_HEAP_DEBUG > 1 @@ -667,7 +669,7 @@ private: p->children[r] = s; // combine a, c and let the result by the rank r+1 child of p - assert(p->rank > r + 1); + CGAL_assertion(p->rank > r + 1); group* x = combine(a, c); x->parent = p; p->children[r + 1] = x; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index e04f4055621..9c58d2a242f 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -23,6 +24,7 @@ #include + #include #include #include @@ -200,7 +202,7 @@ private: VertexParameterizedMap vpmap, Offset_map& offset) { - assert(offset.empty()); + CGAL_assertion(offset.empty()); put(vpmap, v0, true); put(vpmap, v1, true); @@ -234,7 +236,7 @@ private: if(get(vpmap, vt)) { // If both extremeties of a segment are corners, offsets are already correct if(!get(vpmap, vs)) { - assert(len != 0.0); + CGAL_assertion(len != 0.0); double ld = 1.0 / len; for(std::size_t i=index_of_previous_corner+1; i<=current_index; ++i) { // ld * offset[i] is in [0;1[ @@ -333,7 +335,7 @@ public: for(halfedge_descriptor hd : halfedges_around_face(start_hd, mesh)) { vertex_descriptor vd = source(hd, mesh); Point_2 uv; - assert(counter < offset.size()); + CGAL_assertion(counter < offset.size()); if(corners_encountered == 0) uv = Point_2(offset[counter++], 0.0); diff --git a/Surface_mesh_topology/include/CGAL/Face_graph_wrapper.h b/Surface_mesh_topology/include/CGAL/Face_graph_wrapper.h index 547af360146..13eb031c1f0 100644 --- a/Surface_mesh_topology/include/CGAL/Face_graph_wrapper.h +++ b/Surface_mesh_topology/include/CGAL/Face_graph_wrapper.h @@ -13,6 +13,7 @@ #define CGAL_FACE_GRAPH_WRAPPER_H 1 #include +#include #include #include @@ -23,6 +24,7 @@ #include #include #include + #include namespace CGAL @@ -614,7 +616,7 @@ public: if (marks[acells[i]]==INVALID_MARK ) { marks[acells[i]]=get_new_mark(); - assert(is_whole_map_unmarked(marks[acells[i]])); + CGAL_assertion(is_whole_map_unmarked(marks[acells[i]])); } } diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h index 20cf61acd2a..824612fa702 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_generators.h @@ -13,6 +13,7 @@ #define CGAL_PATH_GENERATORS_H 1 #include +#include #include #include @@ -174,7 +175,7 @@ generate_random_connected_set_of_faces(const LCC& lcc, std::size_t nb, { return NULL; } } - assert (border_faces.size()!=0); + CGAL_assertion(border_faces.size()!=0); typename LCC::Dart_const_handle dhres=border_faces[0]; while(lcc.template is_free<2>(dhres) || lcc.is_marked(lcc.template beta<2>(dhres), amark)) diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 6b8ae90e6fa..4187cd5ccc9 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef CGAL_USE_BASIC_VIEWER @@ -52,7 +53,7 @@ struct LCC_geom_utils, Local_kernel, 3> } while(adart!=dh); - assert(nb>0); + CGAL_assertion(nb>0); return typename Get_traits::Kernel::Construct_scaled_vector_3() (normal, 1.0/nb); }