From 664b4dcbeb549e89128802b2402d60cb6d28268d Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 20 Sep 2017 13:49:41 +0000 Subject: 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 --- .../test/simplex_tree_remove_unit_test.cpp | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src') 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); -- cgit v1.2.3