mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 03:10:16 +01:00
glib-aux/tests: add nmtst_assert_strv() helper macro
This commit is contained in:
parent
c810fe24fe
commit
f924b4382e
1 changed files with 17 additions and 0 deletions
|
|
@ -182,6 +182,23 @@
|
|||
} \
|
||||
G_STMT_END
|
||||
|
||||
#define nmtst_assert_strv(strv, ...) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
const char *const *const _strv = (strv); \
|
||||
const char *const _exp[] = {__VA_ARGS__, NULL}; \
|
||||
const gsize _n = G_N_ELEMENTS(_exp) - 1; \
|
||||
gsize _i; \
|
||||
\
|
||||
g_assert(_n == NM_NARG(__VA_ARGS__)); \
|
||||
g_assert(_strv); \
|
||||
for (_i = 0; _i < _n; _i++) { \
|
||||
g_assert(_exp[_i]); \
|
||||
g_assert_cmpstr(_strv[_i], ==, _exp[_i]); \
|
||||
} \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Our nm-error error numbers use negative values to signal failure.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue