summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/test
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-05 15:30:39 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-05 15:30:39 +0000
commitd55d30d2fadff5b7f9a045c596e9f8ad37c6b206 (patch)
tree371b2c6c7e060f1acc094f2f65881c178ae42bcc /src/Skeleton_blocker/test
parent33bc9838165eab60042d3e474d31e743272c26dd (diff)
skbl add test skbl constructor
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@454 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3d83eeb565fb1d4299edaf9958a54bbe7719aedf
Diffstat (limited to 'src/Skeleton_blocker/test')
-rw-r--r--src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp
index 9392cc9e..468a4fca 100644
--- a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp
+++ b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp
@@ -758,6 +758,11 @@ bool test_constructor3(){
Complex complex(simplices.begin(),simplices.end());
DBGVALUE(complex.to_string());
+ if(complex.num_blockers()!=1) return false;
+ Sh expected_blocker(Vh(0),Vh(1),Vh(2));
+ for(auto b : complex.const_blocker_range())
+ if(*b!=expected_blocker) return false;
+
return complex.num_vertices()==3 && complex.num_blockers()==1;
}
@@ -767,7 +772,6 @@ bool test_constructor4(){
typedef Simplex_handle Sh;
std::vector<Simplex_handle> simplices;
auto subf(subfaces(Sh(Vh(0),Vh(1),Vh(2),Vh(3))));
- // subf.pop_back(); //remove max face -> now a blocker 012
simplices.insert(simplices.begin(),subf.begin(),subf.end());
simplices.push_back(Sh(Vh(4)));
@@ -778,6 +782,10 @@ bool test_constructor4(){
Complex complex(simplices.begin(),simplices.end());
DBGVALUE(complex.to_string());
+ if(complex.num_blockers()!=1) return false;
+ Sh expected_blocker(Vh(0),Vh(1),Vh(4));
+ for(auto b : complex.const_blocker_range())
+ if(*b!=expected_blocker) return false;
return complex.num_vertices()==5 && complex.num_blockers()==1 && complex.num_edges()==8;
}
@@ -810,6 +818,31 @@ bool test_constructor5(){
}
+bool test_constructor6(){
+ typedef Vertex_handle Vh;
+ typedef Simplex_handle Sh;
+ std::vector<Simplex_handle> simplices;
+ auto subf(subfaces(Sh(Vh(0),Vh(1),Vh(2),Vh(3))));
+ for(auto s:subf){
+ Sh s1(Vh(0),Vh(1),Vh(2),Vh(3));
+ Sh s2(Vh(1),Vh(2),Vh(3));
+ if(s!=s1 && s!=s2) simplices.push_back(s);
+ }
+
+ DBGCONT(simplices);
+ Complex complex(simplices.begin(),simplices.end());
+
+ DBGVALUE(complex.to_string());
+
+ if(complex.num_blockers()!=1) return false;
+ Sh expected_blocker(Vh(1),Vh(2),Vh(3));
+ for(auto b : complex.const_blocker_range())
+ if(*b!=expected_blocker) return false;
+ return complex.num_vertices()==4 && complex.num_blockers()==1 && complex.num_edges()==6;
+}
+
+
+
int main (int argc, char *argv[])
{
Tests tests_complex;
@@ -843,6 +876,8 @@ int main (int argc, char *argv[])
tests_complex.add("test_constructor_list_simplices3",test_constructor3);
tests_complex.add("test_constructor_list_simplices4",test_constructor4);
tests_complex.add("test_constructor_list_simplices5",test_constructor5);
+ tests_complex.add("test_constructor_list_simplices6",test_constructor6);
+
if(tests_complex.run()){
return EXIT_SUCCESS;