summaryrefslogtreecommitdiff
path: root/src/Persistent_cohomology/test
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-06 14:25:38 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-02-06 14:25:38 +0000
commit8802dc5353020c75012f6ae8c26afefb4c78b161 (patch)
treec264b84d49f442205afb34d88c8cfaab0e54361f /src/Persistent_cohomology/test
parent2d4979f6e6b9e502b1c5051d5a35935c4a65ac8c (diff)
Add of persistence computation from a simple simplex tree - Fix of infinite persistent (1.#INF under windows) UT
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@462 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: f08233c68f60962fa6caa5603b3a8b4a16b2bb76
Diffstat (limited to 'src/Persistent_cohomology/test')
-rw-r--r--src/Persistent_cohomology/test/CMakeLists.txt2
-rw-r--r--src/Persistent_cohomology/test/README11
-rw-r--r--src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp5
-rw-r--r--src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp2
4 files changed, 15 insertions, 5 deletions
diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt
index 5c811bfa..9dc19251 100644
--- a/src/Persistent_cohomology/test/CMakeLists.txt
+++ b/src/Persistent_cohomology/test/CMakeLists.txt
@@ -18,7 +18,7 @@ if(GMPXX_FOUND AND GMP_FOUND)
target_link_libraries(persistent_cohomology_unit_test_multi_field ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES})
# Unitary tests
- add_test(persistent_cohomology_unit_test_multi_field ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test_multi_field ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test_multi_field.txt)
+ add_test(persistent_cohomology_unit_test_multi_field ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test_multi_field ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt)
endif()
if (LCOV_PATH)
diff --git a/src/Persistent_cohomology/test/README b/src/Persistent_cohomology/test/README
index 56474fa0..ddceac63 100644
--- a/src/Persistent_cohomology/test/README
+++ b/src/Persistent_cohomology/test/README
@@ -7,6 +7,15 @@ make
To launch with details:
***********************
-./persistent_cohomology_unit_test --report_level=detailed --log_level=all
+SINGLE FIELD
+------------
+./persistent_cohomology_unit_test simplex_tree_file_for_unit_test.txt --report_level=detailed --log_level=all
==> echo $? returns 0 in case of success (non-zero otherwise)
+
+MULTI FIELD
+-----------
+./persistent_cohomology_unit_test_multi_field simplex_tree_file_for_multi_field_unit_test.txt --report_level=detailed --log_level=all
+
+ ==> echo $? returns 0 in case of success (non-zero otherwise)
+
diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp
index 2e059b09..1e7a74a7 100644
--- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp
+++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp
@@ -23,7 +23,7 @@ typedef Simplex_tree<> typeST;
std::string test_rips_persistence(int coefficient, int min_persistence) {
// Check file name is given as parameter from CMakeLists.txt
- BOOST_CHECK(framework::master_test_suite().argc == 2);
+ BOOST_CHECK(framework::master_test_suite().argc >= 2);
const std::string inputFile(framework::master_test_suite().argv[1]);
std::ifstream simplex_tree_stream;
@@ -84,7 +84,8 @@ void test_rips_persistence_in_dimension(int dimension) {
std::cout << "TEST OF RIPS_PERSISTENT_COHOMOLOGY_SINGLE_FIELD DIM=" << dimension << " MIN_PERS=0" << std::endl;
std::string str_rips_persistence = test_rips_persistence(dimension, 0);
-
+ std::cout << str_rips_persistence << std::endl;
+
BOOST_CHECK(str_rips_persistence.find(value0) != std::string::npos); // Check found
BOOST_CHECK(str_rips_persistence.find(value1) != std::string::npos); // Check found
BOOST_CHECK(str_rips_persistence.find(value2) != std::string::npos); // Check found
diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp
index 196461e2..e88add3a 100644
--- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp
+++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp
@@ -24,7 +24,7 @@ typedef Simplex_tree<> typeST;
std::string test_rips_persistence(int min_coefficient, int max_coefficient, int min_persistence) {
// Check file name is given as parameter from CMakeLists.txt
- BOOST_CHECK(framework::master_test_suite().argc == 2);
+ BOOST_CHECK(framework::master_test_suite().argc >= 2);
const std::string inputFile(framework::master_test_suite().argv[1]);
std::ifstream simplex_tree_stream;