diff options
author | Mattias Andrée <maandree@kth.se> | 2023-01-07 23:40:55 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-01-07 23:40:55 +0100 |
commit | 4a7c500000af251d55919b7462599a67fc76c5bc (patch) | |
tree | 467c177dd2db091bd2789845859d9e8837c977a6 /common.h | |
parent | Add textual descriptions of subpixel layouts (diff) | |
download | libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.gz libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.bz2 libfonts-4a7c500000af251d55919b7462599a67fc76c5bc.tar.xz |
Add 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
@@ -29,3 +29,16 @@ eq(double a, double b) { return b - DOUBLE_TOLERANCE <= a && a <= b + DOUBLE_TOLERANCE; } + + +#ifdef TEST + +# define ASSERT(ASSERTION)\ + do {\ + if (!(ASSERTION)) {\ + fprintf(stderr, "Failed assertion at line %u: %s\n", __LINE__, #ASSERTION);\ + exit(1);\ + }\ + } while (0) + +#endif |