summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/test
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-20 13:49:41 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-20 13:49:41 +0000
commit664b4dcbeb549e89128802b2402d60cb6d28268d (patch)
treec80bb92a19d09fdf11f6d0159a3c4ec138043c36 /src/Simplex_tree/test
parentc9f8ebc4d43d4a861aab1dabc2d31f2f6ed640d2 (diff)
Add tests limits
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_automatic_dimension_set@2690 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fc3e0cb28170f49a598d50fc7e32ac2d9d191447
Diffstat (limited to 'src/Simplex_tree/test')
-rw-r--r--src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
index ad71fed3..df89008e 100644
--- a/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
+++ b/src/Simplex_tree/test/simplex_tree_remove_unit_test.cpp
@@ -169,6 +169,56 @@ BOOST_AUTO_TEST_CASE(auto_dimension_set) {
st.remove_maximal_simplex(st.find({0, 1, 3, 4}));
BOOST_CHECK(st.dimension() == 2);
+ std::cout << "st.insert_simplex_and_subfaces({1, 2, 3, 5})" << std::endl;
+ st.insert_simplex_and_subfaces({1, 2, 3, 5});
+ BOOST_CHECK(st.dimension() == 3);
+
+ std::cout << "st.insert_simplex_and_subfaces({1, 2, 3, 4})" << std::endl;
+ st.insert_simplex_and_subfaces({1, 2, 3, 4});
+ BOOST_CHECK(st.dimension() == 3);
+
+ // Check you can override the dimension
+ // This is a limit test case - shall not happen
+ st.set_dimension(1);
+ BOOST_CHECK(st.dimension() == 1);
+
+ // Here no siblings is erased - automatic dimension is not launched.
+ std::cout << "st.remove_maximal_simplex({1, 2, 3, 4})" << std::endl;
+ st.remove_maximal_simplex(st.find({1, 2, 3, 4}));
+ BOOST_CHECK(st.dimension() == 1);
+
+ // Here sibling is erased - automatic dimension is launched.
+ std::cout << "st.remove_maximal_simplex({1, 2, 3, 5})" << std::endl;
+ st.remove_maximal_simplex(st.find({1, 2, 3, 5}));
+ BOOST_CHECK(st.dimension() == 2);
+
+ std::cout << "st.insert_simplex_and_subfaces({1, 2, 3, 5})" << std::endl;
+ st.insert_simplex_and_subfaces({1, 2, 3, 5});
+ BOOST_CHECK(st.dimension() == 3);
+
+ std::cout << "st.insert_simplex_and_subfaces({1, 2, 3, 4})" << std::endl;
+ st.insert_simplex_and_subfaces({1, 2, 3, 4});
+ BOOST_CHECK(st.dimension() == 3);
+
+ // Check you can override the dimension
+ // This is a limit test case - shall not happen
+ st.set_dimension(6);
+ BOOST_CHECK(st.dimension() == 6);
+
+ // Here no siblings is erased - automatic dimension is not launched.
+ std::cout << "st.remove_maximal_simplex({1, 2, 3, 5})" << std::endl;
+ st.remove_maximal_simplex(st.find({1, 2, 3, 5}));
+ BOOST_CHECK(st.dimension() == 6);
+
+ // Here sibling is erased - automatic dimension is launched but dim is always than te one set.
+ std::cout << "st.remove_maximal_simplex({1, 2, 3, 4})" << std::endl;
+ st.remove_maximal_simplex(st.find({1, 2, 3, 4}));
+ BOOST_CHECK(st.dimension() == 6);
+
+ // Reset with the correct value
+ st.set_dimension(2);
+ BOOST_CHECK(st.dimension() == 2);
+
std::cout << "st.insert_simplex_and_subfaces({0, 1, 2, 3, 4, 5, 6})" << std::endl;
st.insert_simplex_and_subfaces({0, 1, 2, 3, 4, 5, 6});
BOOST_CHECK(st.dimension() == 6);