aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-07 23:40:55 +0100
committerMattias Andrée <maandree@kth.se>2023-01-07 23:40:55 +0100
commit4a7c500000af251d55919b7462599a67fc76c5bc (patch)
tree467c177dd2db091bd2789845859d9e8837c977a6 /common.h
parentAdd textual descriptions of subpixel layouts (diff)
downloadlibfonts-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 'common.h')
-rw-r--r--common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/common.h b/common.h
index f39090e..a940151 100644
--- a/common.h
+++ b/common.h
@@ -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