mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 02:10:32 +01:00
tests: add nmtst_gbytes_from_arr(), nmtst_gbytes_from_str() helpers
This commit is contained in:
parent
0d9435d5d9
commit
a30fd66a85
1 changed files with 16 additions and 0 deletions
|
|
@ -2854,4 +2854,20 @@ nmtst_ip_address_new(int addr_family, const char *str)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define nmtst_gbytes_from_arr(...) \
|
||||
({ \
|
||||
const guint8 _arr[] = {__VA_ARGS__}; \
|
||||
\
|
||||
g_bytes_new(_arr, sizeof(_arr)); \
|
||||
})
|
||||
|
||||
#define nmtst_gbytes_from_str(str) \
|
||||
({ \
|
||||
const char *const _str = (str); \
|
||||
\
|
||||
g_bytes_new(_str, strlen(_str)); \
|
||||
})
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif /* __NM_TEST_UTILS_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue