summaryrefslogtreecommitdiff
path: root/libnm-glib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-12-21 10:22:33 +0100
committerThomas Haller <thaller@redhat.com>2015-12-24 11:42:37 +0100
commitbc06dd9332f557fb1848b3c50a102e0d35ad9205 (patch)
treeed47c2fef46e0fb613fc810ee9f311e16ad206d4 /libnm-glib
parentfa3093e16721b1617b6e5fcb2cd36c5eff13e2eb (diff)
downloadNetworkManager-bc06dd9332f557fb1848b3c50a102e0d35ad9205.tar.gz
libnm/tests: rename test functions to follow common pattern
Like the test utility functions in nm-test-utils.h and platform's common.h, rename the helper functions to have a nmtst(c) prefix.
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/tests/test-nm-client.c25
-rw-r--r--libnm-glib/tests/test-remote-settings-client.c21
2 files changed, 21 insertions, 25 deletions
diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c
index 417eca79f9..42248947b7 100644
--- a/libnm-glib/tests/test-nm-client.c
+++ b/libnm-glib/tests/test-nm-client.c
@@ -27,19 +27,16 @@
#include <sys/types.h>
#include <signal.h>
-#include <NetworkManager.h>
#include "nm-default.h"
#include "nm-client.h"
#include "nm-device-wifi.h"
#include "nm-device-ethernet.h"
#include "nm-device-wimax.h"
-#include "nm-test-utils.h"
-
#include "nm-test-libnm-utils.h"
static GMainLoop *loop = NULL;
-static NMTestServiceInfo *sinfo;
+static NMTstcServiceInfo *sinfo;
/*******************************************************************/
@@ -184,7 +181,7 @@ test_device_added (void)
NMDevice *device;
DeviceAddedInfo info = { loop, FALSE, FALSE, 0, 0 };
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
client = test_client_new ();
devices = nm_client_get_devices (client);
@@ -224,7 +221,7 @@ test_device_added (void)
g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0");
g_object_unref (client);
- g_clear_pointer (&sinfo, nm_test_service_cleanup);
+ g_clear_pointer (&sinfo, nmtstc_service_cleanup);
}
/*******************************************************************/
@@ -341,7 +338,7 @@ test_wifi_ap_added_removed (void)
GError *error = NULL;
char *expected_path = NULL;
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
client = test_client_new ();
/*************************************/
@@ -447,7 +444,7 @@ test_wifi_ap_added_removed (void)
g_free (expected_path);
g_object_unref (client);
- g_clear_pointer (&sinfo, nm_test_service_cleanup);
+ g_clear_pointer (&sinfo, nmtstc_service_cleanup);
}
/*******************************************************************/
@@ -564,7 +561,7 @@ test_wimax_nsp_added_removed (void)
GError *error = NULL;
char *expected_path = NULL;
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
client = test_client_new ();
/*************************************/
@@ -670,7 +667,7 @@ test_wimax_nsp_added_removed (void)
g_free (expected_path);
g_object_unref (client);
- g_clear_pointer (&sinfo, nm_test_service_cleanup);
+ g_clear_pointer (&sinfo, nmtstc_service_cleanup);
}
/*******************************************************************/
@@ -749,7 +746,7 @@ test_devices_array (void)
GError *error = NULL;
GVariant *ret;
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
client = test_client_new ();
/*************************************/
@@ -833,7 +830,7 @@ test_devices_array (void)
g_free (paths[2]);
g_object_unref (client);
- g_clear_pointer (&sinfo, nm_test_service_cleanup);
+ g_clear_pointer (&sinfo, nmtstc_service_cleanup);
}
static void
@@ -871,7 +868,7 @@ test_client_manager_running (void)
g_clear_error (&error);
/* Now start the test service. */
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
client2 = test_client_new ();
/* client2 should know that NM is running, but the previously-created
@@ -889,7 +886,7 @@ test_client_manager_running (void)
g_source_remove (quit_id);
/* And kill it */
- g_clear_pointer (&sinfo, nm_test_service_cleanup);
+ g_clear_pointer (&sinfo, nmtstc_service_cleanup);
g_assert (nm_client_get_manager_running (client1));
diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c
index 99d326f43b..fbeb558e1e 100644
--- a/libnm-glib/tests/test-remote-settings-client.c
+++ b/libnm-glib/tests/test-remote-settings-client.c
@@ -27,19 +27,18 @@
#include <sys/types.h>
#include <signal.h>
-#include <NetworkManager.h>
+#include "NetworkManager.h"
-#include <nm-setting-connection.h>
-#include <nm-setting-wired.h>
-#include <nm-utils.h>
+#include "nm-setting-connection.h"
+#include "nm-setting-wired.h"
+#include "nm-utils.h"
#include "nm-default.h"
#include "nm-remote-settings.h"
-#include "nm-test-libnm-utils.h"
-#include "nm-test-utils.h"
+#include "nm-test-libnm-utils.h"
-static NMTestServiceInfo *sinfo;
+static NMTstcServiceInfo *sinfo;
static NMRemoteSettings *settings = NULL;
DBusGConnection *bus = NULL;
NMRemoteConnection *remote = NULL;
@@ -377,7 +376,7 @@ test_service_running (void)
g_assert (running == TRUE);
/* Now kill the test service. */
- nm_test_service_cleanup (sinfo);
+ nmtstc_service_cleanup (sinfo);
settings2 = nm_remote_settings_new (bus);
@@ -406,7 +405,7 @@ test_service_running (void)
g_assert (running == FALSE);
/* Now restart it */
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
quit_id = g_timeout_add_seconds (5, loop_quit, loop);
g_main_loop_run (loop);
@@ -436,7 +435,7 @@ main (int argc, char **argv)
bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
g_assert_no_error (error);
- sinfo = nm_test_service_init ();
+ sinfo = nmtstc_service_init ();
settings = nm_remote_settings_new (bus);
g_assert (settings != NULL);
@@ -452,7 +451,7 @@ main (int argc, char **argv)
ret = g_test_run ();
- nm_test_service_cleanup (sinfo);
+ nmtstc_service_cleanup (sinfo);
g_object_unref (settings);
dbus_g_connection_unref (bus);