Commit d432edba authored by Thomas Haller's avatar Thomas Haller

lldp: merge branch 'th/lldp-tests'

parents fd8c5642 4f852242
......@@ -669,7 +669,7 @@ typedef enum /*< flags >*/ {
#define NM_LLDP_ATTR_IEEE_802_1_PVID "ieee-802-1-pvid"
#define NM_LLDP_ATTR_IEEE_802_1_PPVID "ieee-802-1-ppvid"
#define NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS "ieee-802-1-ppvid-flags"
#define NM_LLDP_ATTR_IEEE_802_1_VID "ieee-802-1-pvid"
#define NM_LLDP_ATTR_IEEE_802_1_VID "ieee-802-1-vid"
#define NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME "ieee-802-1-vlan-name"
#define NM_LLDP_DEST_NEAREST_BRIDGE "nearest-bridge"
......
......@@ -853,6 +853,18 @@ nmtst_main_loop_run (GMainLoop *loop, int timeout_ms)
return loopx != NULL;
}
inline static void
_nmtst_main_loop_quit_on_notify (GObject *object, GParamSpec *pspec, gpointer user_data)
{
GMainLoop *loop = user_data;
g_assert (G_IS_OBJECT (object));
g_assert (loop);
g_main_loop_quit (loop);
}
#define nmtst_main_loop_quit_on_notify ((GCallback) _nmtst_main_loop_quit_on_notify)
/*****************************************************************************/
inline static const char *
......@@ -1774,6 +1786,34 @@ nmtst_create_connection_from_keyfile (const char *keyfile_str, const char *keyfi
#ifdef __NM_CONNECTION_H__
#define nmtst_assert_variant_is_of_type(variant, type) \
G_STMT_START { \
GVariant *_variantx = (variant); \
\
g_assert (_variantx); \
g_assert (g_variant_is_of_type (_variantx, (type))); \
} G_STMT_END
#define nmtst_assert_variant_uint32(variant, val) \
G_STMT_START { \
GVariant *_variant = (variant); \
\
nmtst_assert_variant_is_of_type (_variant, G_VARIANT_TYPE_UINT32); \
g_assert_cmpint (g_variant_get_uint32 (_variant), ==, (val)); \
} G_STMT_END
#define nmtst_assert_variant_string(variant, str) \
G_STMT_START { \
gsize _l; \
GVariant *_variant = (variant); \
const char *_str = (str); \
\
nmtst_assert_variant_is_of_type (_variant, G_VARIANT_TYPE_STRING); \
g_assert (_str); \
g_assert_cmpstr (g_variant_get_string (_variant, &_l), ==, _str); \
g_assert_cmpint (_l, ==, strlen (_str)); \
} G_STMT_END
typedef enum {
NMTST_VARIANT_EDITOR_CONNECTION,
NMTST_VARIANT_EDITOR_SETTING,
......
......@@ -538,6 +538,8 @@ nm_lldp_listener_get_neighbors (NMLldpListener *self)
LLDPNeighbor *neigh;
char *dest_str = NULL;
g_return_val_if_fail (NM_IS_LLDP_LISTENER (self), FALSE);
priv = NM_LLDP_LISTENER_GET_PRIVATE (self);
if (priv->variant)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment