Skip to content

Commit

Permalink
coccinelle: add g_assert_cmp* to macro file
Browse files Browse the repository at this point in the history
This helps applying semantic patches to unit tests.

Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed May 23, 2016
1 parent 644c686 commit 6ad978e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/cocci-macro-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 6ad978e

Please sign in to comment.