about summary refs log tree commit diff stats
path: root/test/src/test-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/test-common.h')
-rw-r--r--test/src/test-common.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/src/test-common.h b/test/src/test-common.h
new file mode 100644
index 0000000..10e40a2
--- /dev/null
+++ b/test/src/test-common.h
@@ -0,0 +1,22 @@
+#ifndef TEST_SRC_TEST_COMMON_H_
+#define TEST_SRC_TEST_COMMON_H_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include "uv.h"
+#include "uv_link.h"
+
+#include "test-list.h"
+
+#define CHECK(VALUE, MESSAGE)                                                \
+    do {                                                                     \
+      if ((VALUE)) break;                                                    \
+      fprintf(stderr, "Assertion failure: " #MESSAGE "\n");                  \
+    } while (0);
+
+#define CHECK_EQ(A, B, MESSAGE) CHECK((A) == (B), MESSAGE)
+#define CHECK_NE(A, B, MESSAGE) CHECK((A) != (B), MESSAGE)
+
+#endif  /* TEST_SRC_TEST_COMMON_H_ */