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

* Re: [Qemu-devel] [PATCH] coccinelle: add g_assert_cmp* to macro file
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2016-05-18 14:22 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial, armbru

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

On 05/18/2016 03:27 AM, Paolo Bonzini wrote:
> 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(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> 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)

Odd indentation, compared to the other lines.

> +#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)
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[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).