Merge branch 'collectd-5.5'
[collectd.git] / src / testing.h
index 5df1b83..4056311 100644 (file)
@@ -54,6 +54,15 @@ static int check_count__ = 0;
   printf ("ok %i - %s evaluates to \"%s\"\n", ++check_count__, #actual, expect); \
 } while (0)
 
+#define DBLEQ(expect, actual) do { \
+  if ((isnan (expect) && !isnan (actual)) || ((expect) != (actual))) {\
+    printf ("not ok %i - %s incorrect: expected %.15g, got %.15g\n", \
+        ++check_count__, #actual, expect, actual); \
+    return (-1); \
+  } \
+  printf ("ok %i - %s evaluates to %.15g\n", ++check_count__, #actual, expect); \
+} while (0)
+
 #define CHECK_NOT_NULL(expr) do { \
   void *ptr_; \
   ptr_ = (expr); \