From 5edd265c0b43440c8c9d2dafa1dcf3861be45a76 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 22 Dec 2015 14:05:22 +0100 Subject: [PATCH] libnm/tests: add nmtstc_nm_remote_settings_new() --- shared/nm-test-libnm-utils.h | 2 ++ shared/nm-test-utils-impl.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/shared/nm-test-libnm-utils.h b/shared/nm-test-libnm-utils.h index e1aad3633b..dad5638f9f 100644 --- a/shared/nm-test-libnm-utils.h +++ b/shared/nm-test-libnm-utils.h @@ -67,8 +67,10 @@ NMDevice * nmtstc_service_add_wired_device (NMTstcServiceInfo *sinfo, #if ((NETWORKMANAGER_COMPILATION) == NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY) #include "nm-client.h" +#include "nm-remote-settings.h" NMClient *nmtstc_nm_client_new (void); +NMRemoteSettings *nmtstc_nm_remote_settings_new (void); #endif /* NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */ diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c index 1f73cb35a9..91bf8b3c0c 100644 --- a/shared/nm-test-utils-impl.c +++ b/shared/nm-test-utils-impl.c @@ -268,6 +268,25 @@ nmtstc_nm_client_new (void) return client; } +NMRemoteSettings * +nmtstc_nm_remote_settings_new (void) +{ + NMRemoteSettings *settings; + DBusGConnection *bus; + GError *error = NULL; + + bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + g_assert_no_error (error); + g_assert (bus); + + settings = nm_remote_settings_new (bus); + g_assert (settings); + + dbus_g_connection_unref (bus); + + return settings; +} + #endif /* NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */ /*****************************************************************************/