From b6bb688199abc342a6e85f80859c8cbb5a41b58a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 23 Jan 2023 20:34:03 +0100 Subject: Add some tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 6566fd0..2252215 100644 --- a/common.h +++ b/common.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -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 -- cgit v1.2.3-70-g09d2