mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-23 18:40:24 +01:00
tests: add nmtst_connection_assert_setting() helper
This commit is contained in:
parent
a30fd66a85
commit
f30def0e00
1 changed files with 22 additions and 0 deletions
|
|
@ -1982,6 +1982,28 @@ nmtst_assert_route_attribute_boolean(NMIPRoute *route, const char *name, gboolea
|
|||
#if (defined(__NM_SIMPLE_CONNECTION_H__) && defined(__NM_SETTING_CONNECTION_H__)) \
|
||||
|| (defined(NM_CONNECTION_H))
|
||||
|
||||
#define nmtst_connection_assert_setting(connection, gtype) \
|
||||
({ \
|
||||
const GType _gtype = (gtype); \
|
||||
gpointer _ptr; \
|
||||
\
|
||||
_ptr = nm_connection_get_setting((connection), (_gtype)); \
|
||||
g_assert(NM_IS_SETTING(_ptr)); \
|
||||
g_assert(G_OBJECT_TYPE(_ptr) == _gtype); \
|
||||
_ptr; \
|
||||
})
|
||||
|
||||
#define nmtst_connection_assert_no_setting(connection, gtype) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
const GType _gtype = (gtype); \
|
||||
gpointer _ptr; \
|
||||
\
|
||||
_ptr = nm_connection_get_setting((connection), (_gtype)); \
|
||||
g_assert(!_ptr); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
static inline NMConnection *
|
||||
nmtst_clone_connection(NMConnection *connection)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue