about summary refs log tree commit diff
path: root/src/core/tests/config
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-10-01 23:06:08 +0200
committerMichael Biebl <biebl@debian.org>2021-10-01 23:06:08 +0200
commita3349a04ac4c38885cddefec8515c979d03f9327 (patch)
treed3bbee695aa048cb4ec252e7d63515c8376f9006 /src/core/tests/config
parent2d5b58e374d67f60880c7689e80c7745aeef3f62 (diff)
parente74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff)
Update upstream source from tag 'upstream/1.32.12'
Update to upstream version '1.32.12'
with Debian dir 6fabefa95c7dcf83371a78eb2c47013a81ff8d86
Diffstat (limited to 'src/core/tests/config')
-rw-r--r--src/core/tests/config/test-config.c100
1 files changed, 46 insertions, 54 deletions
diff --git a/src/core/tests/config/test-config.c b/src/core/tests/config/test-config.c
index 3bb14815..6794fbf6 100644
--- a/src/core/tests/config/test-config.c
+++ b/src/core/tests/config/test-config.c
@@ -151,6 +151,7 @@ test_config_simple(void)
     gs_unref_object NMConfig *config  = NULL;
     gs_strfreev char **       plugins = NULL;
     char *                    value;
+    const char *              cvalue;
     gs_unref_object NMDevice *dev50 = nm_test_device_new("00:00:00:00:00:50");
     gs_unref_object NMDevice *dev51 = nm_test_device_new("00:00:00:00:00:51");
     gs_unref_object NMDevice *dev52 = nm_test_device_new("00:00:00:00:00:52");
@@ -206,59 +207,50 @@ test_config_simple(void)
     g_assert_cmpstr(value, ==, "51");
     g_free(value);
 
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv6.route-metric",
-                                                  NULL);
-    g_assert_cmpstr(value, ==, NULL);
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.route-metric",
-                                                  NULL);
-    g_assert_cmpstr(value, ==, "50");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.route-metric",
-                                                  dev50);
-    g_assert_cmpstr(value, ==, "50");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.route-metric",
-                                                  dev51);
-    g_assert_cmpstr(value, ==, "51");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.route-metric",
-                                                  dev52);
-    g_assert_cmpstr(value, ==, "52");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ethernet.mtu",
-                                                  dev51);
-    g_assert_cmpstr(value, ==, "9000");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ethernet.mtu",
-                                                  dev50);
-    g_assert_cmpstr(value, ==, "1400");
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.dns-priority",
-                                                  dev51);
-    g_assert_cmpstr(value, ==, NULL);
-    g_free(value);
-
-    value = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
-                                                  "ipv4.dns-priority",
-                                                  dev50);
-    g_assert_cmpstr(value, ==, "60");
-    g_free(value);
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv6.route-metric",
+                                                   NULL);
+    g_assert_cmpstr(cvalue, ==, NULL);
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.route-metric",
+                                                   NULL);
+    g_assert_cmpstr(cvalue, ==, "50");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.route-metric",
+                                                   dev50);
+    g_assert_cmpstr(cvalue, ==, "50");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.route-metric",
+                                                   dev51);
+    g_assert_cmpstr(cvalue, ==, "51");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.route-metric",
+                                                   dev52);
+    g_assert_cmpstr(cvalue, ==, "52");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ethernet.mtu",
+                                                   dev51);
+    g_assert_cmpstr(cvalue, ==, "9000");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ethernet.mtu",
+                                                   dev50);
+    g_assert_cmpstr(cvalue, ==, "1400");
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.dns-priority",
+                                                   dev51);
+    g_assert_cmpstr(cvalue, ==, NULL);
+
+    cvalue = nm_config_data_get_connection_default(nm_config_get_data_orig(config),
+                                                   "ipv4.dns-priority",
+                                                   dev50);
+    g_assert_cmpstr(cvalue, ==, "60");
 }
 
 static void
@@ -616,7 +608,7 @@ test_config_confdir(void)
 #define ASSERT_GET_CONN_DEFAULT(xconfig, xname, xvalue)                             \
     G_STMT_START                                                                    \
     {                                                                               \
-        gs_free char *_value =                                                      \
+        const char *_value =                                                        \
             nm_config_data_get_connection_default(nm_config_get_data_orig(xconfig), \
                                                   (xname),                          \
                                                   NULL);                            \