summaryrefslogtreecommitdiffstats
path: root/scripts/cocci-macro-file.h
diff options
context:
space:
mode:
authorPaolo Bonzini2016-05-18 11:11:55 +0200
committerPaolo Bonzini2016-05-23 16:53:46 +0200
commit6ad978e9f40d3edfd9f4a86b4a60e3523eff08fe (patch)
tree9b6b290589d6d2818b29a3875738ce419843aa06 /scripts/cocci-macro-file.h
parentiscsi: pass SCSI status back for SG_IO (diff)
downloadqemu-6ad978e9f40d3edfd9f4a86b4a60e3523eff08fe.tar.gz
qemu-6ad978e9f40d3edfd9f4a86b4a60e3523eff08fe.tar.xz
qemu-6ad978e9f40d3edfd9f4a86b4a60e3523eff08fe.zip
coccinelle: add g_assert_cmp* to macro file
This helps applying semantic patches to unit tests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/cocci-macro-file.h')
-rw-r--r--scripts/cocci-macro-file.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h
index eceb4be73f..9f2e72e7e1 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)