qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] coccinelle: add g_assert_cmp* to macro file
@ 2016-05-18  9:27 Paolo Bonzini
  2016-05-18 14:22 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-05-18  9:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, armbru

This helps applying semantic patches to unit tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-18 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18  9:27 [Qemu-devel] [PATCH] coccinelle: add g_assert_cmp* to macro file Paolo Bonzini
2016-05-18 14:22 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).