Browse Source

use std::any_of to check result in is_irregular_vertex test.

Nico Brügel 6 years ago
parent
commit
40db7208d0
1 changed files with 3 additions and 9 deletions
  1. 3 9
      tests/include/igl/is_irregular_vertex.cpp

+ 3 - 9
tests/include/igl/is_irregular_vertex.cpp

@@ -6,16 +6,10 @@ TEST_CASE("is_irregular_vertex: simple", "[igl]")
 {
     Eigen::MatrixXd V;
     Eigen::MatrixXi F;
-    // Known non-manifold mesh
+    // Known "bad" mesh (many boundaries + irregular vertices, non-manifold)
     test_common::load_mesh("truck.obj", V, F);
     std::vector<bool> vec = igl::is_irregular_vertex(V,F);
-    int ret = false;
-    for (auto val : vec)
-    {
-        // true corresponds to 1
-        ret += val;
-    }
-    // some verticies are irregular thus the sum over all verticies should evaluate to a value > 0
-    REQUIRE( ret > 0 );
+    // some vertices are irregular thus the sum over all vertices should evaluate to true
+    REQUIRE(std::any_of(vec.begin(),vec.end(), [](bool v) { return v; }));
 
 }