diff options
author | Thomas Haller <thaller@redhat.com> | 2015-12-23 14:07:36 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-12-26 16:43:49 +0100 |
commit | 570d24b88ca82332d472dcb562f5e0d825d63cf2 (patch) | |
tree | fb55710cfe343b3fa4a32d1666e4fe41e0f1e5f6 /shared/nm-test-utils-impl.c | |
parent | c0af56ac7a1466f36a579adba524b69e799689af (diff) | |
download | NetworkManager-570d24b88ca82332d472dcb562f5e0d825d63cf2.tar.gz |
libnm/tests: add dbus-glib support to "nm-test-libnm-utils"
Diffstat (limited to 'shared/nm-test-utils-impl.c')
-rw-r--r-- | shared/nm-test-utils-impl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c index 91bf8b3c0c..fc6d6c2af8 100644 --- a/shared/nm-test-utils-impl.c +++ b/shared/nm-test-utils-impl.c @@ -26,8 +26,14 @@ #include "NetworkManager.h" #include "nm-dbus-compat.h" +#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY) +#include "nm-dbus-glib-types.h" +#endif + #include "nm-test-libnm-utils.h" +/*****************************************************************************/ + static gboolean name_exists (GDBusConnection *c, const char *name) { @@ -94,6 +100,11 @@ nmtstc_service_init (void) NULL, &error); g_assert_no_error (error); +#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY) + info->libdbus.bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + g_assert_no_error (error); + g_assert (info->libdbus.bus); +#endif return info; } @@ -116,6 +127,10 @@ nmtstc_service_cleanup (NMTstcServiceInfo *info) g_object_unref (info->bus); close (info->keepalive_fd); +#if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY) + g_clear_pointer (&info->libdbus.bus, dbus_g_connection_unref); +#endif + memset (info, 0, sizeof (*info)); g_free (info); } |