Add a few more tests

This commit is contained in:
Mael Rouxel-Labbé 2021-07-19 15:58:10 +02:00
parent 8727fd17af
commit 3fcae5244d
2 changed files with 30 additions and 3 deletions

View File

@ -132,9 +132,14 @@ _test_cls_triangulation_2( const Triangul & )
assert( T1.number_of_vertices() == 0 );
Triangul T3(T1);
Triangul T4 = T1;
T3.swap(T1);
assert(T3.tds().vertices().size() == T1.tds().vertices().size());
assert(T3.tds().faces().size() == T1.tds().faces().size());
Triangul T4 = T1;
assert(T4.tds().vertices().size() == T1.tds().vertices().size());
assert(T4.tds().faces().size() == T1.tds().faces().size());
T3.swap(T1);
/**************************/
/******* INSERTIONS *******/
@ -162,6 +167,10 @@ _test_cls_triangulation_2( const Triangul & )
assert( T0_1.number_of_faces() == 0);
assert( T0_1.is_valid() );
Triangul T0_1b(T0_1);
assert(T0_1b.tds().vertices().size() == T0_1.tds().vertices().size());
assert(T0_1b.tds().faces().size() == T0_1.tds().faces().size());
// test insert_first()
Triangul T0_2;
Vertex_handle v0_2_0 = T0_2.insert_first(p0);
@ -184,6 +193,10 @@ _test_cls_triangulation_2( const Triangul & )
assert( T1_2.number_of_faces() == 0 );
assert( T1_2.is_valid() );
Triangul T1_2b(T1_2);
assert(T1_2b.tds().vertices().size() == T1_2.tds().vertices().size());
assert(T1_2b.tds().faces().size() == T1_2.tds().faces().size());
// p1,p3,p2 [endpoints first]
Triangul T1_3_0;
Vertex_handle v1_3_0_1 = T1_3_0.insert(p1); assert( v1_3_0_1 != NULL );

View File

@ -190,7 +190,21 @@ _test_cls_triangulation_3(const Triangulation &)
//########################################################################
/**************CONSTRUCTORS (1)*********************/
/************** CONSTRUCTORS (1)********************/
Cls Tm1;
assert( Tm1.dimension() == -1 );
assert( Tm1.number_of_vertices() == 0 );
Cls Tm3(Tm1);
assert(Tm3 == Tm1);
Cls Tm4 = Tm1;
assert(Tm4 == Tm1);
Tm3.swap(Tm1);
/************** INSERTIONS *************************/
/************** and I/O ****************************/
std::cout << " Constructor " << std::endl;