summaryrefslogtreecommitdiffstats
path: root/test/test_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_helpers.h')
-rw-r--r--test/test_helpers.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/test_helpers.h b/test/test_helpers.h
index 8a8669c624..6ca3cd99b3 100644
--- a/test/test_helpers.h
+++ b/test/test_helpers.h
@@ -1,13 +1,24 @@
#ifndef MP_TESTS_H
#define MP_TESTS_H
-#include <stdarg.h>
-#include <stddef.h>
-#include <setjmp.h>
-#include <cmocka.h>
-
-#include <stdio.h>
#include <math.h>
#include <float.h>
+#include "common/common.h"
+
+#define assert_true(x) assert(x)
+#define assert_false(x) assert(!(x))
+#define assert_int_equal(a, b) \
+ assert_int_equal_impl(__FILE__, __LINE__, (a), (b))
+#define assert_string_equal(a, b) \
+ assert_string_equal_impl(__FILE__, __LINE__, (a), (b))
+#define assert_float_equal(a, b, tolerance) \
+ assert_float_equal_impl(__FILE__, __LINE__, (a), (b), (tolerance))
+
+void assert_int_equal_impl(const char *file, int line, int64_t a, int64_t b);
+void assert_string_equal_impl(const char *file, int line,
+ const char *a, const char *b);
+void assert_float_equal_impl(const char *file, int line,
+ double a, double b, double tolerance);
+
#endif