From 98e0ec06f1aededb0f45bd46310ff1399bb0b98e Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Wed, 9 Nov 2016 17:04:09 -0500 Subject: [PATCH] Test for LCC et CMap. --- .../Combinatorial_map_copy_test.cpp | 8 ++++++-- .../Linear_cell_complex_3_test.h | 18 +++++++++++++----- .../Linear_cell_complex_copy_test.cpp | 5 +++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_copy_test.cpp b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_copy_test.cpp index 3c5f12060a8..33793f5c2bc 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_copy_test.cpp +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_copy_test.cpp @@ -72,7 +72,7 @@ struct MonInfo MonInfo(long long int i=0) : mnb(i==0?rand():i), ptr(reinterpret_cast(this)) {} - int mnb; + long long int mnb; std::string s; char *ptr; @@ -163,8 +163,12 @@ struct CreateAttributes itend=map.darts().end(); it!=itend; ++it) { if ( map.template attribute(it)==map.null_handle ) + { map.template set_attribute - (it, map.template create_attribute(++nb)); + (it, map.template create_attribute + (typename Map::template Attribute_type::type::Info(nb))); + ++nb; + } } } }; diff --git a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h index 29efb79a3db..ca998bbbcbb 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h +++ b/Linear_cell_complex/test/Linear_cell_complex/Linear_cell_complex_3_test.h @@ -959,23 +959,31 @@ bool test_LCC_3() LCC lcc2; std::ifstream is("save.map"); assert(is.is_open()); - is>>lcc2; - + try + { + is>>lcc2; + } + catch(...) + { // Problem during the load (boost assertion) + std::cout<<"Problem to load combinatorial map save.map"<(this)) {} - int mnb; + long long int mnb; std::string s; char *ptr; @@ -278,7 +278,8 @@ struct SetInfoIfNonVoid typename Map::template Attribute_handle::type attr, long long int nb) { - map.template info_of_attribute(attr)=nb; + map.template info_of_attribute(attr)= + typename Map::template Attribute_type::type::Info(nb); } }; template