aboutsummaryrefslogtreecommitdiff
path: root/unittest/t_helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'unittest/t_helpers.c')
-rw-r--r--unittest/t_helpers.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/unittest/t_helpers.c b/unittest/t_helpers.c
new file mode 100644
index 0000000..4f20743
--- /dev/null
+++ b/unittest/t_helpers.c
@@ -0,0 +1,38 @@
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "t_helpers.h"
+
+void test(char * tfn)
+{
+ fn = tfn;
+ printf("========================================\n");
+ printf("test function: %s\n", fn);
+ printf("========================================\n");
+}
+
+void test_failed()
+{
+ printf("Failed to calculate %s.\n", fn);
+ exit(1);
+}
+
+void test_failed_s(char * expected, char * res)
+{
+
+ printf("Failed to calculate %s.\n", fn);
+
+ printf("expected: %s\ngot: %s\n", expected, res);
+ exit(1);
+}
+
+void test_failed_f(float expected, float res)
+{
+
+ printf("Failed to calculate %s.\n", fn);
+ printf("expected: %f\ngot: %f\n", expected, res);
+ exit(1);
+}
+