summary refs log tree commit diff
path: root/src/libnm-client-impl/tests
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
committerMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
commit8bdf070ff046f482f6eb5e2b15ebc216f5d1e3da (patch)
treef706478d189d54c6532e8863d4b0d5ff5575af60 /src/libnm-client-impl/tests
parent818258cf34b83fbc754633295e1052d4752d7b15 (diff)
New upstream version 1.51.90 upstream/1.51.90
Diffstat (limited to 'src/libnm-client-impl/tests')
-rw-r--r--src/libnm-client-impl/tests/test-libnm.c15
-rw-r--r--src/libnm-client-impl/tests/test-nm-client.c14
-rw-r--r--src/libnm-client-impl/tests/test-secret-agent.c2
3 files changed, 22 insertions, 9 deletions
diff --git a/src/libnm-client-impl/tests/test-libnm.c b/src/libnm-client-impl/tests/test-libnm.c
index f6bf1567..f56521a4 100644
--- a/src/libnm-client-impl/tests/test-libnm.c
+++ b/src/libnm-client-impl/tests/test-libnm.c
@@ -2285,7 +2285,7 @@ typedef struct {
     const char *val;
 } ReadVpnDetailData;
 
-#define READ_VPN_DETAIL_DATA(...) ((ReadVpnDetailData[]){__VA_ARGS__})
+#define READ_VPN_DETAIL_DATA(...) ((ReadVpnDetailData[]) {__VA_ARGS__})
 
 static gboolean
 _do_read_vpn_details_impl1(const char              *file,
@@ -2693,6 +2693,7 @@ test_types(void)
         G(nm_device_hsr_get_type),
         G(nm_device_infiniband_get_type),
         G(nm_device_ip_tunnel_get_type),
+        G(nm_device_ipvlan_get_type),
         G(nm_device_macsec_get_type),
         G(nm_device_macvlan_get_type),
         G(nm_device_modem_capabilities_get_type),
@@ -2771,6 +2772,8 @@ test_types(void)
         G(nm_setting_ip6_config_privacy_get_type),
         G(nm_setting_ip_config_get_type),
         G(nm_setting_ip_tunnel_get_type),
+        G(nm_setting_ipvlan_get_type),
+        G(nm_setting_ipvlan_mode_get_type),
         G(nm_setting_mac_randomization_get_type),
         G(nm_setting_macsec_get_type),
         G(nm_setting_macsec_mode_get_type),
@@ -3001,8 +3004,13 @@ test_nml_dbus_meta(void)
                             g_assert(NM_IS_OBJECT_CLASS(p->klass));
                             g_assert(g_type_is_a(gtype, G_TYPE_FROM_CLASS(p->klass)));
                             if (ii == 0)
+                                /* If there is more than one NMLDBusPropertyO needed in the struct
+                                 * associated to the DBus object, they must be all in the same struct field
+                                 * as an array. This is later used on nm-object.c to perform operations on
+                                 * all the object properties at once. */
                                 g_assert(p->klass->property_o_info == p);
                             else
+                                /* Same check than above if branch but for NMLDBusPropertyAO. */
                                 g_assert(p->klass->property_ao_info == p);
                             g_assert_cmpint(p->klass->priv_ptr_offset, >, 0);
                             if (p_prev) {
@@ -3401,6 +3409,11 @@ test_dbus_meta_types(void)
             NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_30,
         },
         {
+            NM_DBUS_INTERFACE_DEVICE_IPVLAN,
+            NM_TYPE_DEVICE_IPVLAN,
+            NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_30,
+        },
+        {
             NM_DBUS_INTERFACE_DEVICE_MACSEC,
             NM_TYPE_DEVICE_MACSEC,
             NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_30,
diff --git a/src/libnm-client-impl/tests/test-nm-client.c b/src/libnm-client-impl/tests/test-nm-client.c
index 3d527324..39831509 100644
--- a/src/libnm-client-impl/tests/test-nm-client.c
+++ b/src/libnm-client-impl/tests/test-nm-client.c
@@ -1099,7 +1099,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 3);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2}),
                                      3,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1134,7 +1134,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1166,7 +1166,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1202,7 +1202,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1232,7 +1232,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1279,7 +1279,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
@@ -1326,7 +1326,7 @@ test_connection_invalid(void)
     g_assert_cmpint(connections->len, ==, 4);
     n_found = nmtst_find_all_indexes(connections->pdata,
                                      connections->len,
-                                     (gpointer *) ((const char *[]){path0, path1, path2, path3}),
+                                     (gpointer *) ((const char *[]) {path0, path1, path2, path3}),
                                      4,
                                      _test_connection_invalid_find_connections,
                                      NULL,
diff --git a/src/libnm-client-impl/tests/test-secret-agent.c b/src/libnm-client-impl/tests/test-secret-agent.c
index 1fffb556..9871b1a4 100644
--- a/src/libnm-client-impl/tests/test-secret-agent.c
+++ b/src/libnm-client-impl/tests/test-secret-agent.c
@@ -344,7 +344,7 @@ test_cleanup(TestSecretAgentData *sadata, gconstpointer test_data)
     g_free(sadata->ifname);
     g_free(sadata->con_id);
 
-    *sadata = (TestSecretAgentData){};
+    *sadata = (TestSecretAgentData) {};
 
     nmtst_context_busy_watcher_wait(&watcher_data);