TDS::is_valid add a check of number_of_cells()

This commit is contained in:
Laurent Rineau 2024-02-22 15:21:22 +01:00
parent ed26ee0ab1
commit 5c636823ba
1 changed files with 6 additions and 0 deletions

View File

@ -3573,6 +3573,12 @@ is_valid(bool verbose, int level ) const
size_type cell_count;
if ( ! count_cells(cell_count,verbose,level) )
return false;
if( number_of_cells() != cell_count ) {
if (verbose)
std::cerr << "wrong number of cells" << std::endl;
CGAL_assertion(false);
return false;
}
size_type edge_count;
if ( ! count_edges(edge_count,verbose,level) )
return false;