diff --git a/src/testing.h b/src/testing.h
index 805449f7b933dad837f42b56137b613263e00fb8..84a1242953284309fe015df0ee6c43d95e6ba434 100644 (file)
--- a/src/testing.h
+++ b/src/testing.h
static int fail_count__ = 0;
static int check_count__ = 0;
+#ifndef DBL_PRECISION
+# define DBL_PRECISION 1e-12
+#endif
+
#define DEF_TEST(func) static int test_##func ()
#define RUN_TEST(func) do { \
printf ("not ok %i - %s incorrect: expected %.15g, got %.15g\n", \
++check_count__, #actual, e, a); \
return (-1); \
- } else if (!isnan (e) && (((e-a) < -1e-12) || ((e-a) > 1e-12))) { \
+ } else if (!isnan (e) && (((e-a) < -DBL_PRECISION) || ((e-a) > DBL_PRECISION))) { \
printf ("not ok %i - %s incorrect: expected %.15g, got %.15g\n", \
++check_count__, #actual, e, a); \
return (-1); \