summaryrefslogtreecommitdiff
path: root/tests/pke-test-types.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pke-test-types.h')
-rw-r--r--tests/pke-test-types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/pke-test-types.h b/tests/pke-test-types.h
index 5a9ee24..097d42f 100644
--- a/tests/pke-test-types.h
+++ b/tests/pke-test-types.h
@@ -3,6 +3,7 @@
#include <setjmp.h>
#include <stdint.h>
+#include <cmath>
struct pke_test_long_jump {
uint8_t expected_exit;
@@ -38,4 +39,9 @@ struct pke_test_group {
#define PKE_TEST_ASSERT(condition, index) if (!(condition)) { return ++index; } else { ++index; }
+template<typename T>
+inline bool flt_equal(T a, T b, T epsilon) {
+ return std::abs(a - b) < epsilon;
+}
+
#endif /* PKE_PKE_TEST_TYPES_H */