diff --git a/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp b/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp index bbfed61ef41..0c51392cc44 100644 --- a/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp +++ b/Spatial_searching/test/Spatial_searching/Orthogonal_k_neighbor_search.cpp @@ -22,7 +22,7 @@ typedef CGAL::Distance_adapter typedef CGAL::Orthogonal_k_neighbor_search Neighbor_search_with_info; template -void search(bool nearest) +bool search(bool nearest) { const unsigned int N = 1000; const double cube_side_length = 1.0; @@ -71,6 +71,7 @@ void search(bool nearest) } } } + bool res=true; // the other points must be further/closer than min_dist { for(std::vector::iterator it = diff.begin(); @@ -80,22 +81,26 @@ void search(bool nearest) if(nearest){ if(dist < sep_dist){ std::cout << "Error: Point " << *it << " at distance " << dist << " < " << sep_dist << std::endl; + res=false; } } else { if(dist > sep_dist){ std::cout << "Error: Point " << *it << " at distance " << dist << " > " << sep_dist << std::endl; + res=false; } } } } + return res; } int main() { - search(true); - search(false); - search(true); - search(false); + bool res=true; + res&=search(true); + res&=search(false); + res&=search(true); + res&=search(false); std::cout << "done" << std::endl; - return 0; + return res ? 0 : 1; }