summaryrefslogtreecommitdiff
path: root/libnm-glib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-12-22 13:53:28 +0100
committerThomas Haller <thaller@redhat.com>2015-12-26 16:43:49 +0100
commitd90525ebfcfcd4325a063edd31dd3a578b97f39d (patch)
treebd038c36433e32427c4e2efa2a873330494fe34e /libnm-glib
parent56880fbe692f52463e06298f1fe8a2e017e8d6bb (diff)
downloadNetworkManager-d90525ebfcfcd4325a063edd31dd3a578b97f39d.tar.gz
libnm/tests: use nmtstc_nm_client_new()
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/tests/test-nm-client.c40
1 files changed, 6 insertions, 34 deletions
diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c
index 42248947b7..b9b36bf69b 100644
--- a/libnm-glib/tests/test-nm-client.c
+++ b/libnm-glib/tests/test-nm-client.c
@@ -40,34 +40,6 @@ static NMTstcServiceInfo *sinfo;
/*******************************************************************/
-static NMClient *
-test_client_new (void)
-{
- NMClient *client;
- DBusGConnection *bus;
- GError *error = NULL;
- gboolean success;
-
- bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
- g_assert_no_error (error);
-
- client = g_object_new (NM_TYPE_CLIENT,
- NM_OBJECT_DBUS_CONNECTION, bus,
- NM_OBJECT_DBUS_PATH, NM_DBUS_PATH,
- NULL);
- g_assert (client != NULL);
-
- dbus_g_connection_unref (bus);
-
- success = g_initable_init (G_INITABLE (client), NULL, &error);
- g_assert_no_error (error);
- g_assert (success == TRUE);
-
- return client;
-}
-
-/*******************************************************************/
-
static gboolean
loop_quit (gpointer user_data)
{
@@ -182,7 +154,7 @@ test_device_added (void)
DeviceAddedInfo info = { loop, FALSE, FALSE, 0, 0 };
sinfo = nmtstc_service_init ();
- client = test_client_new ();
+ client = nmtstc_nm_client_new ();
devices = nm_client_get_devices (client);
g_assert (devices == NULL);
@@ -339,7 +311,7 @@ test_wifi_ap_added_removed (void)
char *expected_path = NULL;
sinfo = nmtstc_service_init ();
- client = test_client_new ();
+ client = nmtstc_nm_client_new ();
/*************************************/
/* Add the wifi device */
@@ -562,7 +534,7 @@ test_wimax_nsp_added_removed (void)
char *expected_path = NULL;
sinfo = nmtstc_service_init ();
- client = test_client_new ();
+ client = nmtstc_nm_client_new ();
/*************************************/
/* Add the wimax device */
@@ -747,7 +719,7 @@ test_devices_array (void)
GVariant *ret;
sinfo = nmtstc_service_init ();
- client = test_client_new ();
+ client = nmtstc_nm_client_new ();
/*************************************/
/* Add some devices */
@@ -852,7 +824,7 @@ test_client_manager_running (void)
int running_changed = 0;
GError *error = NULL;
- client1 = test_client_new ();
+ client1 = nmtstc_nm_client_new ();
g_assert (!nm_client_get_manager_running (client1));
g_assert_cmpstr (nm_client_get_version (client1), ==, NULL);
@@ -869,7 +841,7 @@ test_client_manager_running (void)
/* Now start the test service. */
sinfo = nmtstc_service_init ();
- client2 = test_client_new ();
+ client2 = nmtstc_nm_client_new ();
/* client2 should know that NM is running, but the previously-created
* client1 hasn't gotten the news yet.