summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test.c b/test.c
index 01a6dd5..5a009fc 100644
--- a/test.c
+++ b/test.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdarg.h>
+#include <float.h>
unsigned int total_passed = 0;
unsigned int total_failed = 0;
@@ -87,6 +88,12 @@ void test_int_equals_imp(const char *expression, int result, int expected)
print_result(result == expected, "%s == %d", expression, expected);
}
+void test_double_imp(const char *expression, double result, double expected)
+{
+ int success = (result - expected < DBL_EPSILON);
+ print_result(success, "%s == %d", expression, (int)expected);
+}
+
void test_void_imp(const char *expression)
{
putchar('?');