summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-01-08 13:34:18 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-01-08 13:34:18 +0000
commit8ce961c5d86845613a196e2a5b1e3ea724698d88 (patch)
tree2bf3b92950a6e1fedc9aa44a24e096cf96bcf821 /src/common
parent7cf0599b211bc6cd5e8a64a75550cdf40b3fbb14 (diff)
parent22ab936a67cdf649091599526f239bdb263100f9 (diff)
Merge of branch persistence_representation_integration_cmake_improvement
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3117 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 673143bd16e06d990aeb104a506cfd71f91a8717
Diffstat (limited to 'src/common')
-rw-r--r--src/common/include/gudhi/Debug_utils.h2
-rw-r--r--src/common/include/gudhi/Unitary_tests_utils.h39
2 files changed, 40 insertions, 1 deletions
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index e8bd7660..90d3cf47 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 INRIA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/common/include/gudhi/Unitary_tests_utils.h b/src/common/include/gudhi/Unitary_tests_utils.h
new file mode 100644
index 00000000..7ae5d356
--- /dev/null
+++ b/src/common/include/gudhi/Unitary_tests_utils.h
@@ -0,0 +1,39 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Vincent Rouvreau
+ *
+ * Copyright (C) 2017 INRIA
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef UNITARY_TESTS_UTILS_H_
+#define UNITARY_TESTS_UTILS_H_
+
+#include <boost/test/unit_test.hpp>
+
+#include <iostream>
+
+template<typename FloatingType >
+void GUDHI_TEST_FLOAT_EQUALITY_CHECK(FloatingType a, FloatingType b,
+ FloatingType epsilon = std::numeric_limits<FloatingType>::epsilon()) {
+#ifdef DEBUG_TRACES
+ std::cout << "GUDHI_TEST_FLOAT_EQUALITY_CHECK - " << a << " versus " << b
+ << " | diff = " << std::fabs(a - b) << " - epsilon = " << epsilon << std::endl;
+#endif
+ BOOST_CHECK(std::fabs(a - b) < epsilon);
+}
+
+#endif // UNITARY_TESTS_UTILS_H_