diff options
| author | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
| commit | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (patch) | |
| tree | 71f32df6617802270e8a78574bd8e1637dc532f4 /src/libnm-client-impl/tests | |
| parent | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff) | |
New upstream version 1.34.0 upstream/1.34.0
Diffstat (limited to 'src/libnm-client-impl/tests')
| -rw-r--r-- | src/libnm-client-impl/tests/test-libnm.c | 13 | ||||
| -rw-r--r-- | src/libnm-client-impl/tests/test-nm-client.c | 20 |
2 files changed, 19 insertions, 14 deletions
diff --git a/src/libnm-client-impl/tests/test-libnm.c b/src/libnm-client-impl/tests/test-libnm.c index e470c63e..29ffde97 100644 --- a/src/libnm-client-impl/tests/test-libnm.c +++ b/src/libnm-client-impl/tests/test-libnm.c @@ -6,7 +6,7 @@ #include "libnm-client-impl/nm-default-libnm.h" #if defined(HAVE_DECL_MEMFD_CREATE) && HAVE_DECL_MEMFD_CREATE - #include <linux/memfd.h> +#include <linux/memfd.h> #endif #include <sys/mman.h> @@ -2758,7 +2758,7 @@ test_types(void) for (i_type = 0; i_type < G_N_ELEMENTS(get_type_fcns); i_type++) { nm_auto_unref_gtypeclass GObjectClass *klass_unref = NULL; - GType gtype = (get_type_fcns[i_type]) (); + GType gtype = (get_type_fcns[i_type])(); GObjectClass * klass; g_assert(g_str_has_prefix(g_type_name(gtype), "NM")); @@ -2837,6 +2837,11 @@ test_nml_dbus_meta(void) g_assert((mif->n_dbus_properties > 0) == (!!mif->dbus_properties)); + if (nm_streq(mif->dbus_iface_name, "org.freedesktop.NetworkManager.Device")) + g_assert(nm_streq( + mif->dbus_properties[_NML_DEVICE_META_PROPERTY_INDEX_PORTS].dbus_property_name, + "Ports")); + if (mif->interface_prio == NML_DBUS_META_INTERFACE_PRIO_NONE) { g_assert(!mif->get_type_fcn); g_assert(!mif->obj_properties); @@ -3068,7 +3073,7 @@ check_dbus_properties: pspec = mif->obj_properties[mpr->obj_properties_idx]; } - if (mpr->use_notify_update_prop) { + if (mpr->notify_update_prop) { g_assert(mpr->notify_update_prop); } else { if (klass) @@ -3129,7 +3134,7 @@ check_dbus_properties: g_assert_cmpstr(expected_property_name, ==, pspec->name); - if (!mpr->use_notify_update_prop) { + if (!mpr->notify_update_prop) { for (p_expected_type_2 = &expected_types[0]; p_expected_type_2 < &expected_types[G_N_ELEMENTS(expected_types)]; p_expected_type_2++) { diff --git a/src/libnm-client-impl/tests/test-nm-client.c b/src/libnm-client-impl/tests/test-nm-client.c index 55b886a0..a3fc5847 100644 --- a/src/libnm-client-impl/tests/test-nm-client.c +++ b/src/libnm-client-impl/tests/test-nm-client.c @@ -62,7 +62,7 @@ test_device_added(void) devices = nm_client_get_devices(client); g_assert(devices->len == 0); - g_signal_connect(client, "notify::devices", (GCallback) devices_notify_cb, ¬ified); + g_signal_connect(client, "notify::devices", G_CALLBACK(devices_notify_cb), ¬ified); /* Tell the test service to add a new device */ nmtstc_service_add_device(sinfo, client, "AddWiredDevice", "eth0"); @@ -149,11 +149,11 @@ test_device_added_signal_after_init(void) devices = nm_client_get_devices(client); g_assert(devices->len == 0); - g_signal_connect(client, NM_CLIENT_DEVICE_ADDED, (GCallback) device_sai_added_cb, &result); + g_signal_connect(client, NM_CLIENT_DEVICE_ADDED, G_CALLBACK(device_sai_added_cb), &result); g_signal_connect(client, "notify::" NM_CLIENT_DEVICES, - (GCallback) devices_sai_notify_cb, + G_CALLBACK(devices_sai_notify_cb), &result); /* Tell the test service to add a new device */ @@ -307,10 +307,10 @@ test_wifi_ap_added_removed(void) g_variant_get(ret, "(o)", &expected_path); g_variant_unref(ret); - g_signal_connect(wifi, "access-point-added", (GCallback) wifi_ap_added_cb, &info); + g_signal_connect(wifi, "access-point-added", G_CALLBACK(wifi_ap_added_cb), &info); info.quit_count = 1; - g_signal_connect(wifi, "notify::access-points", (GCallback) wifi_ap_add_notify_cb, &info); + g_signal_connect(wifi, "notify::access-points", G_CALLBACK(wifi_ap_add_notify_cb), &info); info.quit_count++; /* Wait for libnm to find the AP */ @@ -340,10 +340,10 @@ test_wifi_ap_added_removed(void) g_assert_no_error(error); nm_clear_pointer(&ret, g_variant_unref); - g_signal_connect(wifi, "access-point-removed", (GCallback) wifi_ap_removed_cb, &info); + g_signal_connect(wifi, "access-point-removed", G_CALLBACK(wifi_ap_removed_cb), &info); info.quit_count = 1; - g_signal_connect(wifi, "notify::access-points", (GCallback) wifi_ap_remove_notify_cb, &info); + g_signal_connect(wifi, "notify::access-points", G_CALLBACK(wifi_ap_remove_notify_cb), &info); info.quit_count++; /* Wait for libnm to find the AP */ @@ -463,9 +463,9 @@ test_devices_array(void) g_assert(ret); g_variant_unref(ret); - g_signal_connect(client, "device-removed", (GCallback) da_device_removed_cb, &info); + g_signal_connect(client, "device-removed", G_CALLBACK(da_device_removed_cb), &info); - g_signal_connect(client, "notify::devices", (GCallback) da_devices_notify_cb, &info); + g_signal_connect(client, "notify::devices", G_CALLBACK(da_devices_notify_cb), &info); info.quit_count = 2; /* Wait for libnm to notice the changes */ @@ -948,7 +948,7 @@ _test_connection_invalid_find_connections(gpointer element, gpointer needle, gpo static void test_connection_invalid(void) { - NMTSTC_SERVICE_INFO_SETUP(my_sinfo) + NMTSTC_SERVICE_INFO_SETUP(my_sinfo); gs_unref_object NMConnection *connection = NULL; NMSettingConnection * s_con; gs_unref_object NMClient *client = NULL; |