From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2xlq-00086q-U5 for qemu-devel@nongnu.org; Wed, 18 May 2016 05:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2xlm-0007lV-If for qemu-devel@nongnu.org; Wed, 18 May 2016 05:28:01 -0400 Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 18 May 2016 11:27:53 +0200 Message-Id: <1463563673-671-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] coccinelle: add g_assert_cmp* to macro file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, armbru@redhat.com This helps applying semantic patches to unit tests. Signed-off-by: Paolo Bonzini --- scripts/cocci-macro-file.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index eceb4be..9f2e72e 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) -- 2.5.5