From a051d57ab3b03585b02f342a5a52a846443ee072 Mon Sep 17 00:00:00 2001 From: derselbst Date: Thu, 12 Apr 2018 17:29:59 +0200 Subject: [PATCH] avoid preprocessor stringification to expand to special '%' character in fprintf() call --- test/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.h b/test/test.h index 2c720a63..74c4bc59 100644 --- a/test/test.h +++ b/test/test.h @@ -4,7 +4,7 @@ #include #include -#define TEST_ASSERT(COND) if (!(COND)) { fprintf(stderr, __FILE__ ":%d assertion ("#COND") failed\n", __LINE__); exit(-1); } +#define TEST_ASSERT(COND) do { if (!(COND)) { fprintf(stderr, __FILE__ ":%d assertion (%s) failed\n", __LINE__, #COND); exit(-1); } } while (0) /* macro to test whether a fluidsynth function succeeded or not */ #define TEST_SUCCESS(FLUID_FUNCT) TEST_ASSERT((FLUID_FUNCT) != FLUID_FAILED)