diff options
| author | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
| commit | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch) | |
| tree | 3469f17ea9af91f7ff169b890633bda68b0cf76e /src/core/tests/config | |
| parent | bfe522304da217296e2a61040f58e35ec5d6f3f2 (diff) | |
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'src/core/tests/config')
| -rw-r--r-- | src/core/tests/config/test-config.c | 100 |
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); \ |