diff options
author | Mattias Andrée <maandree@kth.se> | 2023-01-23 20:34:03 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-01-23 20:34:03 +0100 |
commit | b6bb688199abc342a6e85f80859c8cbb5a41b58a (patch) | |
tree | 46d953c3689f5f75210c7667c3a4f1c4d1386aab /common.h | |
parent | Add libglitter_reorder_rasters (diff) | |
download | libglitter-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.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |