From 47babfefae1401e3a2da1c623bcb4f5c68d12821 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 7 Nov 2022 10:38:49 +0100 Subject: [PATCH] reverted exclusion of some tests --- .../test_pmp_locate.cpp | 84 ++++++------------- 1 file changed, 26 insertions(+), 58 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp index 3997ade8a77..2767dad9338 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_locate.cpp @@ -172,25 +172,17 @@ void test_constructions(const G& g, // --------------------------------------------------------------------------- bar = PMP::barycentric_coordinates(p, q, r, p, K()); - if (std::is_same()) { - assert(is_equal(bar[0], FT(1)) && is_equal(bar[1], FT(0)) && is_equal(bar[2], FT(0))); - } + assert(is_equal(bar[0], FT(1)) && is_equal(bar[1], FT(0)) && is_equal(bar[2], FT(0))); bar = PMP::barycentric_coordinates(p, q, r, q, K()); - if (std::is_same()) { - assert(is_equal(bar[0], FT(0)) && is_equal(bar[1], FT(1)) && is_equal(bar[2], FT(0))); - } + assert(is_equal(bar[0], FT(0)) && is_equal(bar[1], FT(1)) && is_equal(bar[2], FT(0))); bar = PMP::barycentric_coordinates(p, q, r, r, K()); - if (std::is_same()) { - assert(is_equal(bar[0], FT(0)) && is_equal(bar[1], FT(0)) && is_equal(bar[2], FT(1))); - } + assert(is_equal(bar[0], FT(0)) && is_equal(bar[1], FT(0)) && is_equal(bar[2], FT(1))); Point mp = Point(CGAL::midpoint(bp, bq)); bar = PMP::barycentric_coordinates(p, q, r, mp); - if (std::is_same()) { - assert(is_equal(bar[0], FT(0.5)) && is_equal(bar[1], FT(0.5)) && is_equal(bar[2], FT(0))); - } + assert(is_equal(bar[0], FT(0.5)) && is_equal(bar[1], FT(0.5)) && is_equal(bar[2], FT(0))); int n = 100; while(n --> 0) // :) @@ -202,9 +194,7 @@ void test_constructions(const G& g, // Point to location and inversely Bare_point barycentric_pt = CGAL::barycenter(bp, a, bq, b, br, c); bar = PMP::barycentric_coordinates(p, q, r, Point(barycentric_pt)); - if (std::is_same()) { - assert(is_equal(bar[0], a) && is_equal(bar[1], b) && is_equal(bar[2], c)); - } + assert(is_equal(bar[0], a) && is_equal(bar[1], b) && is_equal(bar[2], c)); loc.second = bar; const Bare_point barycentric_pt_2 = @@ -213,30 +203,22 @@ void test_constructions(const G& g, .geom_traits(K()))); const FT sq_dist = CGAL::squared_distance(barycentric_pt, barycentric_pt_2); - if (std::is_same()) { - assert(is_equal(sq_dist, FT(0))); - } + assert(is_equal(sq_dist, FT(0))); } // --------------------------------------------------------------------------- loc = std::make_pair(f, CGAL::make_array(FT(0.3), FT(0.4), FT(0.3))); descriptor_variant dv = PMP::get_descriptor_from_location(loc, g); const face_descriptor* fd = boost::get(&dv); - if (std::is_same()) { - assert(fd); - } + assert(fd); loc = std::make_pair(f, CGAL::make_array(FT(0.5), FT(0.5), FT(0))); dv = PMP::get_descriptor_from_location(loc, g); const halfedge_descriptor* hd = boost::get(&dv); - if (std::is_same()) { - assert(hd); - } + assert(hd); loc = std::make_pair(f, CGAL::make_array(FT(1), FT(0), FT(0))); - if (std::is_same()) { - assert(PMP::is_on_vertex(loc, source(halfedge(f, g), g), g)); - } + assert(PMP::is_on_vertex(loc, source(halfedge(f, g), g), g)); dv = PMP::get_descriptor_from_location(loc, g); if(const vertex_descriptor* v = boost::get(&dv)) { } else { assert(false); } @@ -270,20 +252,16 @@ void test_random_entities(const G& g, CGAL::Random& rnd) while(nn --> 0) // the infamous 'go to zero' operator { loc = PMP::random_location_on_mesh(g, rnd); - if (std::is_same()) { - assert(loc.first != boost::graph_traits::null_face()); - assert(loc.second[0] >= FT(0) && loc.second[0] <= FT(1) && - loc.second[1] >= FT(0) && loc.second[1] <= FT(1) && - loc.second[2] >= FT(0) && loc.second[2] <= FT(1)); - } + assert(loc.first != boost::graph_traits::null_face()); + assert(loc.second[0] >= FT(0) && loc.second[0] <= FT(1) && + loc.second[1] >= FT(0) && loc.second[1] <= FT(1) && + loc.second[2] >= FT(0) && loc.second[2] <= FT(1)); loc = PMP::random_location_on_face(f, g, rnd); - if (std::is_same()) { - assert(loc.first == f); - assert(loc.second[0] >= FT(0) && loc.second[0] <= FT(1) && - loc.second[1] >= FT(0) && loc.second[1] <= FT(1) && - loc.second[2] >= FT(0) && loc.second[2] <= FT(1)); - } + assert(loc.first == f); + assert(loc.second[0] >= FT(0) && loc.second[0] <= FT(1) && + loc.second[1] >= FT(0) && loc.second[1] <= FT(1) && + loc.second[2] >= FT(0) && loc.second[2] <= FT(1)); loc = PMP::random_location_on_halfedge(h, g, rnd); assert(loc.first == face(h, g)); @@ -459,38 +437,28 @@ void test_locate_in_face(const G& g, loc = PMP::locate_vertex(v, g); - if (std::is_same()) { - assert(is_equal(loc.second[CGAL::vertex_index_in_face(v, loc.first, g)], FT(1))); - assert(is_equal(loc.second[(CGAL::vertex_index_in_face(v, loc.first, g) + 1) % 3], FT(0))); - assert(is_equal(loc.second[(CGAL::vertex_index_in_face(v, loc.first, g) + 2) % 3], FT(0))); - } + assert(is_equal(loc.second[CGAL::vertex_index_in_face(v, loc.first, g)], FT(1))); + assert(is_equal(loc.second[(CGAL::vertex_index_in_face(v, loc.first, g) + 1) % 3], FT(0))); + assert(is_equal(loc.second[(CGAL::vertex_index_in_face(v, loc.first, g) + 2) % 3], FT(0))); loc = PMP::locate_vertex(v, f, g); - if (std::is_same()) { - assert(loc.first == f); - assert(is_equal(loc.second[0], FT(0)) && is_equal(loc.second[1], FT(1)) && is_equal(loc.second[2], FT(0))); - } + assert(loc.first == f); + assert(is_equal(loc.second[0], FT(0)) && is_equal(loc.second[1], FT(1)) && is_equal(loc.second[2], FT(0))); loc = PMP::locate_on_halfedge(h, a, g); const int h_id = CGAL::halfedge_index_in_face(h, g); - if (std::is_same()) { - assert(loc.first == f && is_equal(loc.second[(h_id + 2) % 3], FT(0))); - } + assert(loc.first == f && is_equal(loc.second[(h_id + 2) % 3], FT(0))); loc = PMP::locate_in_face(p, f, g, CGAL::parameters::vertex_point_map(vpm).geom_traits(K())); int v_id = CGAL::vertex_index_in_face(v, f, g); - if (std::is_same()) { - assert(loc.first == f && is_equal(loc.second[v_id], FT(1))); - } + assert(loc.first == f && is_equal(loc.second[v_id], FT(1))); // Internal vertex point pmap typedef typename boost::property_map_value::type Point; Point p2 = get(CGAL::vertex_point, g, v); PMP::locate_in_face(p2, f, g); - if (std::is_same()) { - assert(loc.first == f && is_equal(loc.second[v_id], FT(1))); - } + assert(loc.first == f && is_equal(loc.second[v_id], FT(1))); // --------------------------------------------------------------------------- loc.second[0] = FT(0.2); @@ -516,8 +484,8 @@ void test_locate_in_face(const G& g, if (std::is_same()) { assert(PMP::locate_in_common_face(loc, p, neigh_loc, g, CGAL::parameters::vertex_point_map(vpm).geom_traits(K()))); - assert(PMP::locate_in_common_face(loc, p, neigh_loc, g, CGAL::parameters::vertex_point_map(vpm).geom_traits(K()), 1e-7)); } + assert(PMP::locate_in_common_face(loc, p, neigh_loc, g, CGAL::parameters::vertex_point_map(vpm).geom_traits(K()), 1e-7)); } }