mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 04:40:20 +01:00
nmtst: add function nmtst_assert_str_has_substr()
This commit is contained in:
parent
55c3f70ec8
commit
aefea43380
1 changed files with 11 additions and 0 deletions
|
|
@ -634,6 +634,17 @@ __define_nmtst_static(03, 1024)
|
|||
memcpy(&x, __nmtst_swap_temp, sizeof(x)); \
|
||||
} G_STMT_END
|
||||
|
||||
#define nmtst_assert_str_has_substr(str, substr) \
|
||||
G_STMT_START { \
|
||||
const char *__str = (str); \
|
||||
const char *__substr = (substr); \
|
||||
\
|
||||
g_assert (__str); \
|
||||
g_assert (__substr); \
|
||||
if (strstr (__str, __substr) == NULL) \
|
||||
g_error ("%s:%d: Expects \"%s\" but got \"%s\"", __FILE__, __LINE__, __substr, __str); \
|
||||
} G_STMT_END
|
||||
|
||||
inline static guint32
|
||||
nmtst_inet4_from_string (const char *str)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue