From: Paolo Bonzini Date: Wed, 18 May 2016 09:11:55 +0000 (+0200) Subject: coccinelle: add g_assert_cmp* to macro file X-Git-Tag: v2.7.0-rc0~173^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ad978e9f40d3edfd9f4a86b4a60e3523eff08fe;p=thirdparty%2Fqemu.git coccinelle: add g_assert_cmp* to macro file This helps applying semantic patches to unit tests. Signed-off-by: Paolo Bonzini --- diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index eceb4be73fc..9f2e72e7e15 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -117,3 +117,9 @@ struct { \ type *tqe_next; /* next element */ \ type **tqe_prev; /* address of previous next element */ \ } + +/* From glib */ +#define g_assert_cmpint(a, op, b) g_assert(a op b) +#define g_assert_cmpuint(a, op, b) g_assert(a op b) +#define g_assert_cmphex(a, op, b) g_assert(a op b) +#define g_assert_cmpstr(a, op, b) g_assert(strcmp(a, b) op 0)