summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2019-02-12 12:20:25 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2019-02-12 12:20:25 +0000
commitb1843507262c7c0d9831ebbeb2f43f43093aa15d (patch)
treeb8c8baef4a0ee42b219e5395faeda9f7c3706983 /src/Bitmap_cubical_complex
parent7eda6217fddd1902b8dd9ef0b422f8380c50d041 (diff)
Add unitary test for inf value read
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cubical_complex_small_fix@4100 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5cdac452d9c79cf63c62ec1382de4140a719286f
Diffstat (limited to 'src/Bitmap_cubical_complex')
-rw-r--r--src/Bitmap_cubical_complex/test/Bitmap_test.cpp15
-rw-r--r--src/Bitmap_cubical_complex/test/CMakeLists.txt3
2 files changed, 18 insertions, 0 deletions
diff --git a/src/Bitmap_cubical_complex/test/Bitmap_test.cpp b/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
index ca7bd986..6a917c25 100644
--- a/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
+++ b/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
@@ -32,6 +32,7 @@
#include <iostream>
#include <sstream>
#include <vector>
+#include <limits>
typedef Gudhi::cubical_complex::Bitmap_cubical_complex_base<double> Bitmap_cubical_complex_base;
typedef Gudhi::cubical_complex::Bitmap_cubical_complex<Bitmap_cubical_complex_base> Bitmap_cubical_complex;
@@ -1576,3 +1577,17 @@ BOOST_AUTO_TEST_CASE(compute_incidence_between_cells_test_periodic_boundary_cond
}
}
}
+
+BOOST_AUTO_TEST_CASE(perseus_file_read) {
+ Bitmap_cubical_complex increasing("sinusoid.txt");
+
+ auto it = increasing.top_dimensional_cells_iterator_begin();
+ double value = increasing.get_cell_data(*it);
+ std::cout << "First value of sinusoid.txt is " << value << std::endl;
+ BOOST_CHECK(value == 10.);
+ // Next value
+ ++it;
+ value = increasing.get_cell_data(*it);
+ std::cout << "Second value of sinusoid.txt is " << value << std::endl;
+ BOOST_CHECK(value == std::numeric_limits<double>::infinity());
+}
diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt
index 8b43632a..d2f002a6 100644
--- a/src/Bitmap_cubical_complex/test/CMakeLists.txt
+++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt
@@ -2,6 +2,9 @@ project(Bitmap_cubical_complex_tests)
include(GUDHI_test_coverage)
+# Do not forget to copy test files in current binary dir
+file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/sinusoid.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
+
add_executable ( Bitmap_cubical_complex_test_unit Bitmap_test.cpp )
target_link_libraries(Bitmap_cubical_complex_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)