aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-23 20:34:03 +0100
committerMattias Andrée <maandree@kth.se>2023-01-23 20:34:03 +0100
commitb6bb688199abc342a6e85f80859c8cbb5a41b58a (patch)
tree46d953c3689f5f75210c7667c3a4f1c4d1386aab /common.h
parentAdd libglitter_reorder_rasters (diff)
downloadlibglitter-b6bb688199abc342a6e85f80859c8cbb5a41b58a.tar.gz
libglitter-b6bb688199abc342a6e85f80859c8cbb5a41b58a.tar.bz2
libglitter-b6bb688199abc342a6e85f80859c8cbb5a41b58a.tar.xz
Add some tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/common.h b/common.h
index 6566fd0..2252215 100644
--- a/common.h
+++ b/common.h
@@ -6,6 +6,7 @@
#include <alloca.h>
#include <math.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -30,4 +31,16 @@ struct libglitter_render_context {
};
+#ifdef TEST
+
+# define ASSERT(ASSERTION)\
+ do {\
+ if (!(ASSERTION)) {\
+ fprintf(stderr, "Failed assertion at line %i: %s\n", __LINE__, #ASSERTION);\
+ exit(1);\
+ }\
+ } while (0)
+
+#endif
+
#endif