diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index c7b0bb9c4ad..23a01a4fc2b 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -340,7 +340,7 @@ struct Test check_no_do_intersect (C(p( 2, 8), 6), S(p(-3, -2), p( 2, -4))); check_no_do_intersect (C(p( 2, 8), 6), S(p(-3, 22), p( 2, 34))); - check_no_do_intersect (C(p( 2, 8), 9), S(p(2.5, 3.5), p(3, 4))); + check_no_do_intersect (C(p( 4, 16), 18), S(p(5, 7), p(6, 8))); check_do_intersect (C(p( 3, 4), 0), S(p(-3, 8), p( 6, 2))); check_do_intersect (C(p( 4, 3), 4), S(p( 6, -7), p( 5, 2))); diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h index 736522636a1..fa55cb268f2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h @@ -45,11 +45,10 @@ intersection( typedef typename K::Segment_3 Segment_3; Inter_type intersections[4]; - std::size_t seg_id = -1, - p_id = -1; + int p_id = -1; std::vector points; std::vector segments; - for(std::size_t i = 0; i < 4; ++i) + for(int i = 0; i < 4; ++i) { const typename K::Triangle_3 triangle(tet.vertex((i+1)%4), tet.vertex((i+2)%4), @@ -65,7 +64,6 @@ intersection( = boost::get(&*intersections[i])) { segments.push_back(*s); - seg_id = i; } else if( const typename K::Point_3* p = boost::get(&*intersections[i])) @@ -127,6 +125,7 @@ intersection( } break; } + CGAL_assertion(false); return result_type(); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h index 243fa7185b4..80fdbb55520 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h @@ -279,6 +279,7 @@ intersection( //never happens (only 3 pts in a tr) break; } + return result_type(); } template diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h index d74d6392e57..0c1037834af 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h @@ -143,7 +143,7 @@ struct Tetrahedron_lines_intersection_3_base } CGAL_assertion(res_id != -1); - CGAL_assertion(res_id_2 != -1); + CGAL_assertion(res_id_2 != static_cast(-1)); CGAL_assertion(max_dist >0 ); typename K::Segment_3 res_seg(res_points[res_id], res_points[res_id_2]); diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index b83f4d23276..99390106d79 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -679,8 +679,8 @@ struct Test { Res res = CGAL::intersection (tet, pl); const std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); } else { @@ -718,11 +718,11 @@ struct Test { Res res = CGAL::intersection(tet, tr); const std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(tet.has_on_boundary(p) && tr.has_on(p)); + assert(tet.has_on_boundary(p) && tr.has_on(p)); } //only one edge intersecting @@ -771,11 +771,11 @@ struct Test { std::vector

* inter = boost::get >(&*res); - CGAL_assertion(inter != nullptr); - CGAL_assertion(inter->size() == 4); + assert(inter != nullptr); + assert(inter->size() == 4); for(auto& p : *inter) { - CGAL_assertion(tet.has_on_boundary(p) && tr.has_on(p)); + assert(tet.has_on_boundary(p) && tr.has_on(p)); } tr = Tr(P(-2, 0.25, 0), @@ -786,11 +786,11 @@ struct Test { inter = boost::get >(&*res); - CGAL_assertion(inter != nullptr); - CGAL_assertion(inter->size() == 4); + assert(inter != nullptr); + assert(inter->size() == 4); for(auto& p : *inter) { - CGAL_assertion(tet.has_on_boundary(p) && tr.has_on(p)); + assert(tet.has_on_boundary(p) && tr.has_on(p)); } tr = Tr(P(0.2, 0.15, 0.3), @@ -799,7 +799,7 @@ struct Test { res = CGAL::intersection(tet, tr); Tr* res_tr = boost::get(&*res); - CGAL_assertion(res_tr != nullptr); + assert(res_tr != nullptr); tr = Tr(P(0.2, 0.15, 0.3), P(-1, 0.15, -2), @@ -809,8 +809,8 @@ struct Test { inter = boost::get >(&*res); - CGAL_assertion(inter != nullptr); - CGAL_assertion(inter->size() == 4); + assert(inter != nullptr); + assert(inter->size() == 4); tr = Tr(P(0.45, 0.20, 0.1), P(0.1, 0.20, 0.5), @@ -820,12 +820,12 @@ struct Test { inter = boost::get >(&*res); - CGAL_assertion(inter != nullptr); - CGAL_assertion(inter->size() == 4); + assert(inter != nullptr); + assert(inter->size() == 4); for(auto& p : *inter) { - CGAL_assertion( + assert( (tet.has_on_bounded_side(p) || tet.has_on_boundary(p)) && tr.has_on(p)); } @@ -834,14 +834,14 @@ struct Test { tr = Tr(P(0,1,0), P(0.1,0.1,0), P(0.9,0.1,0)); res = CGAL::intersection(tet, tr); res_tr = boost::get(&*res); - CGAL_assertion(res_tr != nullptr); + assert(res_tr != nullptr); tr = Tr(P(0.1, 0.5, 0.1), P(0.3,0.1,0.1), P(4,0.3,0.9)); res = CGAL::intersection(tet, tr); inter = boost::get >(&*res); - CGAL_assertion(inter != nullptr); - CGAL_assertion(inter->size() == 4); + assert(inter != nullptr); + assert(inter->size() == 4); } else { @@ -912,19 +912,19 @@ struct Test { Res res = CGAL::intersection(cub, Pl(P(1,1,1), P(1,2,1), P(1,2,2))); const std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(p.x() == 1); + assert(p.x() == 1); } res = CGAL::intersection(cub, Pl(P(1,1,1), P(1,2,1), P(2,2,2))); poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(cub.has_on_boundary(p)); + assert(cub.has_on_boundary(p)); } //vertex @@ -943,22 +943,22 @@ struct Test { Pl pl(P(1,1,1), P(1,2,1), P(1.5, 1, 2)); res = CGAL::intersection(cub, pl); poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(pl.has_on(p) && cub.has_on_boundary(p)); + assert(pl.has_on(p) && cub.has_on_boundary(p)); } //random pl = Pl(0.265189, 0.902464, 0.33946, -2.47551); res = CGAL::intersection(cub, pl); poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 5); + assert(poly != nullptr); + assert(poly->size() == 5); for(auto& p : *poly) { - CGAL_assertion(pl.has_on(p) && cub.has_on_boundary(p)); + assert(pl.has_on(p) && cub.has_on_boundary(p)); } } else @@ -1103,16 +1103,16 @@ struct Test { Res res = CGAL::intersection(cub, Pl(P(1,1,1), P(1,2,1), P(1,2,2))); const std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(p.x() == 1); + assert(p.x() == 1); } res = CGAL::intersection(cub, Pl(P(1,1,1), P(1,2,1), P(2,2,2))); poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); //vertex check_intersection (cub, Pl(0.5, -0.5, -0.5, 0), P(2,1,1)); @@ -1129,11 +1129,11 @@ struct Test { Pl pl(0.265189, 0.902464, 0.33946, -2.47551); res = CGAL::intersection(cub, pl); poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 5); + assert(poly != nullptr); + assert(poly->size() == 5); for(auto& p : *poly) { - CGAL_assertion(pl.has_on(p)); + assert(pl.has_on(p)); } } else @@ -1182,11 +1182,11 @@ struct Test { if(is_exact) { std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(tr.has_on(p) && cub.has_on_boundary(p)); + assert(tr.has_on(p) && cub.has_on_boundary(p)); } } @@ -1210,11 +1210,11 @@ struct Test { if(is_exact) { std::vector

* poly = boost::get >(&*res); - CGAL_assertion(poly != nullptr); - CGAL_assertion(poly->size() == 4); + assert(poly != nullptr); + assert(poly->size() == 4); for(auto& p : *poly) { - CGAL_assertion(tr.has_on(p) && cub.has_on_boundary(p)); + assert(tr.has_on(p) && cub.has_on_boundary(p)); } } }