From 43014cf292c291b3ed76e6de50002aaa3bd0a44f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 16 Dec 2014 09:58:35 -0500 Subject: [PATCH] ifcfg-rh/tests: removed unused connection_from_file_test() args Don't pass &keyfile, &routefile, and &route6file if we aren't going to use the return value. Don't pass &unmanaged if we aren't going to check it. (And when we do check it, don't g_free() it if we've asserted that it's NULL.) (cherry picked from commit a564dafc35651f5b86d6a0ee53b687540c2dd878) --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 1188 +++-------------- 1 file changed, 199 insertions(+), 989 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 0647af5a13..6c43d9b89a 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -527,7 +527,6 @@ test_read_wired_static (const char *file, g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE); } - g_free (unmanaged); g_object_unref (connection); } @@ -584,9 +583,6 @@ test_read_wired_dhcp (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *mac; char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee }; @@ -598,9 +594,7 @@ test_read_wired_dhcp (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); @@ -720,10 +714,6 @@ test_read_wired_dhcp (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -890,9 +880,6 @@ test_read_wired_defroute_no (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no"; @@ -901,9 +888,7 @@ test_read_wired_defroute_no (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); @@ -987,10 +972,6 @@ test_read_wired_defroute_no (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_NEVER_DEFAULT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1006,9 +987,6 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-defroute-no-gatewaydev-yes"; @@ -1017,9 +995,7 @@ test_read_wired_defroute_no_gatewaydev_yes (void) TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-defroute-no-gatewaydev-yes-read", @@ -1111,10 +1087,6 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_NEVER_DEFAULT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1176,9 +1148,6 @@ test_read_wired_static_routes_legacy (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPRoute *ip4_route; @@ -1188,9 +1157,7 @@ test_read_wired_static_routes_legacy (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, @@ -1283,10 +1250,6 @@ test_read_wired_static_routes_legacy (void) g_assert_cmpstr (nm_ip_route_get_next_hop (ip4_route), ==, "7.7.7.7"); g_assert_cmpint (nm_ip_route_get_metric (ip4_route), ==, 3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1298,9 +1261,6 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; @@ -1309,9 +1269,7 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv4-manual-read", "failed to read %s: %s", file, error->message); @@ -1392,10 +1350,6 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) g_assert_cmpstr (nm_ip_address_get_address (ip4_addr), ==, "3.3.3.3"); g_assert_cmpint (nm_ip_address_get_prefix (ip4_addr), ==, 8); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1410,9 +1364,6 @@ test_read_wired_ipv6_manual (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-manual"; @@ -1425,9 +1376,7 @@ test_read_wired_ipv6_manual (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -1623,10 +1572,6 @@ test_read_wired_ipv6_manual (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS_SEARCH); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1641,9 +1586,6 @@ test_read_wired_ipv6_only (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ipv6-only"; @@ -1654,9 +1596,7 @@ test_read_wired_ipv6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); @@ -1759,10 +1699,6 @@ test_read_wired_ipv6_only (void) g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 1), ==, "ipsum.org"); g_assert_cmpstr (nm_setting_ip_config_get_dns_search (s_ip6, 2), ==, "dolor.edu"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1777,9 +1713,6 @@ test_read_wired_dhcp6_only (void) NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-dhcp6-only"; @@ -1789,9 +1722,7 @@ test_read_wired_dhcp6_only (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-dhcp6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); @@ -1862,10 +1793,6 @@ test_read_wired_dhcp6_only (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1877,18 +1804,13 @@ test_read_onboot_no (void) NMConnection *connection; NMSettingConnection *s_con; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_ONBOOT_NO, NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); @@ -1914,10 +1836,6 @@ test_read_onboot_no (void) NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_AUTOCONNECT); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1929,19 +1847,13 @@ test_read_noip (void) NMConnection *connection; NMSettingIPConfig *s_ip4; NMSettingIPConfig *s_ip6; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_NOIP, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -1957,10 +1869,6 @@ test_read_noip (void) g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE); g_assert (nm_setting_ip_config_get_never_default (s_ip6) == FALSE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -1976,9 +1884,6 @@ test_read_wired_8021x_peap_mschapv2 (void) NMSetting8021x *s_8021x; NMSetting8021x *tmp_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_identity = "David Smith"; @@ -1992,9 +1897,7 @@ test_read_wired_8021x_peap_mschapv2 (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); @@ -2154,10 +2057,6 @@ test_read_wired_8021x_peap_mschapv2 (void) g_object_unref (tmp_8021x); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2170,10 +2069,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags NMConnection *connection; NMSettingWired *s_wired; NMSetting8021x *s_8021x; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *expected_identity = "David Smith"; gboolean success = FALSE; @@ -2182,10 +2077,8 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags connection = connection_from_file_test (ifcfg, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -2218,10 +2111,6 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags g_free (dirname); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2350,10 +2239,6 @@ test_read_wired_aliases_good (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System aliasem0"; @@ -2366,10 +2251,8 @@ test_read_wired_aliases_good (void) connection = connection_from_file_test (TEST_IFCFG_ALIASES_GOOD, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "aliases-good-read", "failed to read %s: %s", TEST_IFCFG_ALIASES_GOOD, error->message); @@ -2459,9 +2342,6 @@ test_read_wired_aliases_good (void) expected_address[i]); } - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2471,10 +2351,6 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) NMConnection *connection; NMSettingConnection *s_con; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; NMIPAddress *ip4_addr; @@ -2482,10 +2358,8 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) connection = connection_from_file_test (base, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); ASSERT (connection != NULL, @@ -2547,9 +2421,6 @@ test_read_wired_aliases_bad (const char *base, const char *expected_id) /* Gateway */ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1"); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2583,10 +2454,6 @@ test_read_wifi_open (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4, *s_ip6; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2601,10 +2468,8 @@ test_read_wifi_open (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); @@ -2748,10 +2613,6 @@ test_read_wifi_open (void) g_assert( s_ip6); g_assert_cmpint (nm_setting_ip_config_get_route_metric (s_ip6), ==, 106); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2763,10 +2624,6 @@ test_read_wifi_open_auto (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-open-auto)"; @@ -2775,10 +2632,8 @@ test_read_wifi_open_auto (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_AUTO, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); @@ -2827,10 +2682,6 @@ test_read_wifi_open_auto (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2842,10 +2693,6 @@ test_read_wifi_open_ssid_hex (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2855,10 +2702,8 @@ test_read_wifi_open_ssid_hex (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_HEX, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); @@ -2913,10 +2758,6 @@ test_read_wifi_open_ssid_hex (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -2924,27 +2765,17 @@ static void test_read_wifi_open_ssid_bad (const char *file, const char *test) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (file, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); g_clear_error (&error); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } #define TEST_IFCFG_WIFI_OPEN_SSID_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-quoted" @@ -2955,10 +2786,6 @@ test_read_wifi_open_ssid_quoted (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingWireless *s_wireless; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -2968,10 +2795,8 @@ test_read_wifi_open_ssid_quoted (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); @@ -3026,10 +2851,6 @@ test_read_wifi_open_ssid_quoted (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3043,10 +2864,6 @@ test_read_wifi_wep (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3063,10 +2880,8 @@ test_read_wifi_wep (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message); @@ -3282,10 +3097,6 @@ test_read_wifi_wep (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3299,10 +3110,6 @@ test_read_wifi_wep_adhoc (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -3314,10 +3121,8 @@ test_read_wifi_wep_adhoc (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_ADHOC, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); @@ -3520,10 +3325,6 @@ test_read_wifi_wep_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3536,10 +3337,6 @@ test_read_wifi_wep_passphrase (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "foobar222blahblah"; @@ -3548,10 +3345,8 @@ test_read_wifi_wep_passphrase (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_PASSPHRASE, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-passphrase-read", "failed to read %s: %s", @@ -3643,10 +3438,6 @@ test_read_wifi_wep_passphrase (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3659,10 +3450,6 @@ test_read_wifi_wep_40_ascii (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "Lorem"; @@ -3671,10 +3458,8 @@ test_read_wifi_wep_40_ascii (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_40_ASCII, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); @@ -3764,10 +3549,6 @@ test_read_wifi_wep_40_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3780,10 +3561,6 @@ test_read_wifi_wep_104_ascii (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_wep_key0 = "LoremIpsumSit"; @@ -3792,10 +3569,8 @@ test_read_wifi_wep_104_ascii (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_104_ASCII, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); @@ -3885,10 +3660,6 @@ test_read_wifi_wep_104_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -3901,10 +3672,6 @@ test_read_wifi_leap (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-leap)"; @@ -3914,10 +3681,8 @@ test_read_wifi_leap (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_LEAP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); @@ -4008,10 +3773,6 @@ test_read_wifi_leap (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4024,10 +3785,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte NMConnection *connection; NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *expected_identity = "Bill Smith"; gboolean success; @@ -4035,10 +3792,8 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte connection = connection_from_file_test (file, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -4062,10 +3817,6 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte g_assert (nm_setting_wireless_security_get_leap_password_flags (s_wsec) == expected_flags); g_assert (nm_setting_wireless_security_get_leap_password (s_wsec) == NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4079,10 +3830,6 @@ test_read_wifi_wpa_psk (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4108,10 +3855,8 @@ test_read_wifi_wpa_psk (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); @@ -4361,10 +4106,6 @@ test_read_wifi_wpa_psk (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4377,10 +4118,6 @@ test_read_wifi_wpa_psk_2 (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System ipsum (test-wifi-wpa-psk-2)"; @@ -4389,10 +4126,8 @@ test_read_wifi_wpa_psk_2 (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_2, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-2-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_2, error->message); @@ -4450,10 +4185,6 @@ test_read_wifi_wpa_psk_2 (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4466,10 +4197,6 @@ test_read_wifi_wpa_psk_unquoted (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-unquoted)"; @@ -4478,10 +4205,8 @@ test_read_wifi_wpa_psk_unquoted (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); @@ -4539,10 +4264,6 @@ test_read_wifi_wpa_psk_unquoted (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4552,10 +4273,6 @@ static void test_read_wifi_wpa_psk_unquoted2 (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; /* Ensure a quoted 64-character WPA passphrase will fail since passphrases @@ -4565,19 +4282,13 @@ test_read_wifi_wpa_psk_unquoted2 (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection == NULL, "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); g_clear_error (&error); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } #define TEST_IFCFG_WIFI_WPA_PSK_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc" @@ -4590,10 +4301,6 @@ test_read_wifi_wpa_psk_adhoc (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System blahblah (test-wifi-wpa-psk-adhoc)"; @@ -4606,10 +4313,8 @@ test_read_wifi_wpa_psk_adhoc (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_ADHOC, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); @@ -4749,10 +4454,6 @@ test_read_wifi_wpa_psk_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4766,10 +4467,6 @@ test_read_wifi_wpa_psk_hex (void) NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; GBytes *ssid; @@ -4781,10 +4478,8 @@ test_read_wifi_wpa_psk_hex (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WPA_PSK_HEX, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); @@ -4889,10 +4584,6 @@ test_read_wifi_wpa_psk_hex (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -4909,9 +4600,6 @@ test_read_wifi_wpa_eap_tls (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Bill Smith"; @@ -4921,9 +4609,7 @@ test_read_wifi_wpa_eap_tls (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); @@ -5028,10 +4714,6 @@ test_read_wifi_wpa_eap_tls (void) expected_privkey_password, NM_SETTING_802_1X_PRIVATE_KEY); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5047,9 +4729,6 @@ test_read_wifi_wpa_eap_ttls_tls (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp, *password; const char *expected_identity = "Chuck Shumer"; @@ -5059,9 +4738,7 @@ test_read_wifi_wpa_eap_ttls_tls (void) NULL, TYPE_WIRELESS, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); @@ -5185,10 +4862,6 @@ test_read_wifi_wpa_eap_ttls_tls (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_IDENTITY); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5201,20 +4874,14 @@ test_read_wifi_dynamic_wep_leap (void) NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSetting8021x *s_8021x; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; gboolean success; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_WIFI_DYNAMIC_WEP_LEAP, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5256,10 +4923,6 @@ test_read_wifi_dynamic_wep_leap (void) g_assert_cmpstr (nm_setting_802_1x_get_identity (s_8021x), ==, "bill smith"); g_assert_cmpstr (nm_setting_802_1x_get_password (s_8021x), ==, "foobar baz"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5275,9 +4938,6 @@ test_read_wifi_wep_eap_ttls_chap (void) NMSettingIPConfig *s_ip4; NMSetting8021x *s_8021x; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_password = "foobar baz"; @@ -5288,9 +4948,7 @@ test_read_wifi_wep_eap_ttls_chap (void) NULL, TYPE_WIRELESS, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); @@ -5415,10 +5073,6 @@ test_read_wifi_wep_eap_ttls_chap (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_PASSWORD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5684,9 +5338,6 @@ test_read_wired_qeth_static (void) NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-qeth-static"; @@ -5700,9 +5351,7 @@ test_read_wired_qeth_static (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wired-qeth-static-read", "failed to read %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); @@ -5835,10 +5484,6 @@ test_read_wired_qeth_static (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5851,9 +5496,6 @@ test_read_wired_ctc_static (void) NMSettingConnection *s_con; NMSettingWired *s_wired; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System test-wired-ctc-static"; @@ -5866,9 +5508,7 @@ test_read_wired_ctc_static (void) NULL, TYPE_ETHERNET, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection); @@ -5905,10 +5545,6 @@ test_read_wired_ctc_static (void) g_assert (tmp != NULL); g_assert_cmpstr (tmp, ==, "0"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -5921,10 +5557,6 @@ test_read_wifi_wep_no_keys (void) NMSettingConnection *s_con; NMSettingWireless *s_wireless; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *tmp; const char *expected_id = "System foobar (test-wifi-wep-no-keys)"; @@ -5933,10 +5565,8 @@ test_read_wifi_wep_no_keys (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_NO_KEYS, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "wifi-wep-no-keys-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_NO_KEYS, error->message); @@ -6015,10 +5645,6 @@ test_read_wifi_wep_no_keys (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6029,10 +5655,6 @@ test_read_permissions (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; gboolean success; GError *error = NULL; guint32 num; @@ -6041,10 +5663,8 @@ test_read_permissions (void) connection = connection_from_file_test (TEST_IFCFG_PERMISSIONS, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "permissions-read", "failed to read %s: %s", TEST_IFCFG_PERMISSIONS, error->message); @@ -6087,10 +5707,6 @@ test_read_permissions (void) ASSERT (strcmp (tmp, "johnny5") == 0, "permissions-verify-permissions", "unexpected permission #3"); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6102,10 +5718,6 @@ test_read_wifi_wep_agent_keys (void) NMConnection *connection; NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMWepKeyType key_type; gboolean success; @@ -6114,10 +5726,8 @@ test_read_wifi_wep_agent_keys (void) connection = connection_from_file_test (TEST_IFCFG_WIFI_WEP_AGENT_KEYS, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -6149,10 +5759,6 @@ test_read_wifi_wep_agent_keys (void) flags = nm_setting_wireless_security_get_wep_key_flags (s_wsec); g_assert (flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -6182,9 +5788,6 @@ test_write_wired_static (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6308,9 +5911,9 @@ test_write_wired_static (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -6339,9 +5942,6 @@ test_write_wired_static (void) "wired-static-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -6360,10 +5960,6 @@ test_write_wired_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6428,10 +6024,8 @@ test_write_wired_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -6445,10 +6039,6 @@ test_write_wired_dhcp (void) "wired-dhcp-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -6581,9 +6171,6 @@ test_write_wired_static_ip6_only (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -6655,9 +6242,9 @@ test_write_wired_static_ip6_only (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -6672,9 +6259,6 @@ test_write_wired_static_ip6_only (void) "wired-static-ip6-only-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -6826,13 +6410,8 @@ test_read_write_static_routes_legacy (void) NMSettingConnection *s_con; NMSettingWired *s_wired; NMSettingIPConfig *s_ip4; - char *unmanaged = NULL; char *testfile = NULL; - char *keyfile = NULL; - char *keyfile2 = NULL; - char *routefile = NULL; char *routefile2 = NULL; - char *route6file = NULL; char *route6file2 = NULL; gboolean success; GError *error = NULL; @@ -6841,10 +6420,8 @@ test_read_write_static_routes_legacy (void) connection = connection_from_file_test (TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "read-write-static-routes-legacy-read", "failed to read %s: %s", @@ -6929,8 +6506,8 @@ test_read_write_static_routes_legacy (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile2, + NULL, + NULL, &routefile2, &route6file2, &error); @@ -6951,12 +6528,7 @@ test_read_write_static_routes_legacy (void) "read-write-static-routes-legacy-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (keyfile2); - g_free (routefile); g_free (routefile2); - g_free (route6file); g_free (route6file2); g_object_unref (connection); g_object_unref (reread); @@ -6983,10 +6555,7 @@ test_write_wired_static_routes (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -7080,10 +6649,10 @@ test_write_wired_static_routes (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, + NULL, + NULL, &routefile, - &route6file, + NULL, &error); unlink (testfile); @@ -7101,10 +6670,7 @@ test_write_wired_static_routes (void) "wired-static-routes-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7123,10 +6689,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -7209,10 +6772,10 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -7230,10 +6793,7 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) "wired-dhcp-8021x-peap-mschapv2write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7275,10 +6835,7 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; const char *pw; char *tmp; @@ -7391,10 +6948,10 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); g_assert (keyfile != NULL); @@ -7463,10 +7020,7 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, g_free (tmp); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7489,10 +7043,6 @@ test_write_wired_aliases (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; shvarFile *ifcfg; int i, j; @@ -7589,10 +7139,8 @@ test_write_wired_aliases (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); unlink (TEST_SCRATCH_ALIAS_BASE ":2"); @@ -7649,9 +7197,6 @@ test_write_wired_aliases (void) g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1"); g_free (testfile); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7798,10 +7343,6 @@ test_write_wifi_open (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; const char *bssid = "11:22:33:44:55:66"; @@ -7881,10 +7422,8 @@ test_write_wifi_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); @@ -7915,10 +7454,6 @@ test_write_wifi_open (void) "wifi-open-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7936,10 +7471,6 @@ test_write_wifi_open_hex_ssid (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -8009,10 +7540,8 @@ test_write_wifi_open_hex_ssid (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -8026,10 +7555,6 @@ test_write_wifi_open_hex_ssid (void) "wifi-open-hex-ssid-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8048,10 +7573,7 @@ test_write_wifi_wep (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8136,10 +7658,10 @@ test_write_wifi_wep (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8165,10 +7687,7 @@ test_write_wifi_wep (void) "wifi-wep-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8187,10 +7706,7 @@ test_write_wifi_wep_adhoc (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8281,10 +7797,10 @@ test_write_wifi_wep_adhoc (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8310,10 +7826,7 @@ test_write_wifi_wep_adhoc (void) "wifi-wep-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8332,10 +7845,7 @@ test_write_wifi_wep_passphrase (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8418,10 +7928,10 @@ test_write_wifi_wep_passphrase (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8447,10 +7957,7 @@ test_write_wifi_wep_passphrase (void) "wifi-wep-passphrase-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8469,10 +7976,7 @@ test_write_wifi_wep_40_ascii (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah40"; struct stat statbuf; @@ -8557,10 +8061,10 @@ test_write_wifi_wep_40_ascii (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8586,10 +8090,7 @@ test_write_wifi_wep_40_ascii (void) "wifi-wep-40-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8608,10 +8109,7 @@ test_write_wifi_wep_104_ascii (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah104"; struct stat statbuf; @@ -8696,10 +8194,10 @@ test_write_wifi_wep_104_ascii (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8725,10 +8223,7 @@ test_write_wifi_wep_104_ascii (void) "wifi-wep-104-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8747,10 +8242,7 @@ test_write_wifi_leap (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; struct stat statbuf; @@ -8832,10 +8324,10 @@ test_write_wifi_leap (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8861,10 +8353,7 @@ test_write_wifi_leap (void) "wifi-leap-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8883,10 +8372,7 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -8967,10 +8453,10 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -8993,10 +8479,7 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9020,10 +8503,7 @@ test_write_wifi_wpa_psk (const char *name, gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9119,10 +8599,10 @@ test_write_wifi_wpa_psk (const char *name, reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9142,10 +8622,7 @@ test_write_wifi_wpa_psk (const char *name, test_name, "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9164,10 +8641,7 @@ test_write_wifi_wpa_psk_adhoc (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; NMIPAddress *addr; @@ -9264,10 +8738,10 @@ test_write_wifi_wpa_psk_adhoc (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9285,10 +8759,7 @@ test_write_wifi_wpa_psk_adhoc (void) "wifi-wpa-psk-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9308,10 +8779,7 @@ test_write_wifi_wpa_eap_tls (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9426,10 +8894,10 @@ test_write_wifi_wpa_eap_tls (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9447,10 +8915,7 @@ test_write_wifi_wpa_eap_tls (void) "wifi-wpa-eap-tls-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9470,10 +8935,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9606,10 +9068,10 @@ test_write_wifi_wpa_eap_ttls_tls (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9627,10 +9089,7 @@ test_write_wifi_wpa_eap_ttls_tls (void) "wifi-wpa-eap-ttls-tls-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9650,10 +9109,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9758,10 +9214,10 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); @@ -9779,10 +9235,7 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) "wifi-wpa-eap-ttls-mschapv2-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9801,10 +9254,7 @@ test_write_wifi_wpa_then_open (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; @@ -9898,10 +9348,10 @@ test_write_wifi_wpa_then_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -9912,12 +9362,6 @@ test_write_wifi_wpa_then_open (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - g_free (unmanaged); - unmanaged = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; g_object_unref (reread); /* Now change the connection to open and recheck */ @@ -9943,10 +9387,10 @@ test_write_wifi_wpa_then_open (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); unlink (testfile); g_assert_no_error (error); @@ -9965,10 +9409,7 @@ test_write_wifi_wpa_then_open (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (reread); g_object_unref (connection); @@ -9988,10 +9429,7 @@ test_write_wifi_wpa_then_wep_with_perms (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; char **perms; const char *ssid_data = "SomeSSID"; @@ -10091,10 +9529,10 @@ test_write_wifi_wpa_then_wep_with_perms (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -10105,12 +9543,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); g_assert (success); - g_free (unmanaged); - unmanaged = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; g_object_unref (reread); /* Now change the connection to WEP and recheck */ @@ -10142,10 +9574,10 @@ test_write_wifi_wpa_then_wep_with_perms (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); @@ -10165,10 +9597,6 @@ test_write_wifi_wpa_then_wep_with_perms (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (reread); g_object_unref (connection); @@ -10189,10 +9617,7 @@ test_write_wifi_dynamic_wep_leap (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GBytes *ssid; const char *ssid_data = "blahblah"; shvarFile *ifcfg; @@ -10283,10 +9708,10 @@ test_write_wifi_dynamic_wep_leap (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, + NULL, &keyfile, - &routefile, - &route6file, + NULL, + NULL, &error); g_assert_no_error (error); g_assert (reread); @@ -10319,10 +9744,7 @@ test_write_wifi_dynamic_wep_leap (void) unlink (testfile); g_free (testfile); - g_free (unmanaged); g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -10341,9 +9763,6 @@ test_write_wired_qeth_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10418,9 +9837,9 @@ test_write_wired_qeth_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10435,9 +9854,6 @@ test_write_wired_qeth_dhcp (void) "wired-qeth-dhcp-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10457,9 +9873,6 @@ test_write_wired_ctc_dhcp (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; shvarFile *ifcfg; char *tmp; @@ -10547,9 +9960,9 @@ test_write_wired_ctc_dhcp (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10563,9 +9976,6 @@ test_write_wired_ctc_dhcp (void) g_assert (success); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10584,9 +9994,6 @@ test_write_permissions (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10653,9 +10060,9 @@ test_write_permissions (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10670,9 +10077,6 @@ test_write_permissions (void) "permissions-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -10694,9 +10098,6 @@ test_write_wifi_wep_agent_keys (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -10776,9 +10177,9 @@ test_write_wifi_wep_agent_keys (void) reread = connection_from_file_test (testfile, NULL, TYPE_WIRELESS, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -10805,9 +10206,6 @@ test_write_wifi_wep_agent_keys (void) g_assert (success); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -11036,19 +10434,13 @@ test_read_bridge_main (void) NMSettingBridge *s_bridge; const char *mac; char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BRIDGE_MAIN, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -11072,10 +10464,6 @@ test_read_bridge_main (void) g_assert (mac); g_assert (nm_utils_hwaddr_matches (mac, -1, expected_mac_address, ETH_ALEN)); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11094,10 +10482,6 @@ test_write_bridge_main (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); g_assert (connection); @@ -11168,10 +10552,8 @@ test_write_bridge_main (void) reread = connection_from_file_test (testfile, NULL, TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11181,10 +10563,6 @@ test_write_bridge_main (void) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11197,20 +10575,14 @@ test_read_bridge_component (void) NMConnection *connection; NMSettingConnection *s_con; NMSettingBridgePort *s_port; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; gboolean success; connection = connection_from_file_test (TEST_IFCFG_BRIDGE_COMPONENT, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); @@ -11229,10 +10601,6 @@ test_read_bridge_component (void) g_assert_cmpuint (nm_setting_bridge_port_get_priority (s_port), ==, 28); g_assert_cmpuint (nm_setting_bridge_port_get_path_cost (s_port), ==, 100); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11250,9 +10618,6 @@ test_write_bridge_component (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -11312,9 +10677,9 @@ test_write_bridge_component (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -11327,9 +10692,6 @@ test_write_bridge_component (void) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -11340,19 +10702,13 @@ test_read_bridge_missing_stp (void) { NMConnection *connection; NMSettingBridge *s_bridge; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-missing-stp", NULL, TYPE_BRIDGE, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection); g_assert (nm_connection_verify (connection, &error)); @@ -11366,10 +10722,6 @@ test_read_bridge_missing_stp (void) g_assert (s_bridge); g_assert (nm_setting_bridge_get_stp (s_bridge) == FALSE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11379,10 +10731,6 @@ static void test_read_vlan_interface (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; guint32 from = 0, to = 0; @@ -11390,18 +10738,12 @@ test_read_vlan_interface (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "vlan43"); @@ -11448,28 +10790,18 @@ static void test_read_vlan_only_vlan_id (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert (nm_connection_get_interface_name (connection) == NULL); @@ -11488,28 +10820,18 @@ static void test_read_vlan_only_device (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; NMSettingVlan *s_vlan; connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_DEVICE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_cmpstr (nm_connection_get_interface_name (connection), ==, "eth0.9"); @@ -11551,10 +10873,6 @@ static void test_write_vlan (void) { NMConnection *connection; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; char *written = NULL; GError *error = NULL; gboolean success = FALSE; @@ -11562,10 +10880,8 @@ test_write_vlan (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_INTERFACE, NULL, TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert (connection != NULL); @@ -11578,20 +10894,12 @@ test_write_vlan (void) unlink (written); g_free (written); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); } static void test_write_vlan_only_vlanid (void) { NMConnection *connection, *reread; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; char *written = NULL; GError *error = NULL; gboolean success = FALSE; @@ -11599,23 +10907,12 @@ test_write_vlan_only_vlanid (void) connection = connection_from_file_test (TEST_IFCFG_VLAN_ONLY_VLANID, NULL, TYPE_VLAN, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_assert_no_error (error); g_assert (connection != NULL); - g_free (unmanaged); - unmanaged = NULL; - g_free (keyfile); - keyfile = NULL; - g_free (routefile); - routefile = NULL; - g_free (route6file); - route6file = NULL; - success = writer_new_connection (connection, TEST_SCRATCH_DIR "/network-scripts/", &written, @@ -11629,17 +10926,11 @@ test_write_vlan_only_vlanid (void) reread = connection_from_file_test (written, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (written); g_free (written); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_assert_no_error (error); g_assert (reread != NULL); @@ -11668,10 +10959,6 @@ test_write_ethernet_missing_ipv6 (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); g_assert (connection); @@ -11735,10 +11022,8 @@ test_write_ethernet_missing_ipv6 (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11765,10 +11050,6 @@ test_write_ethernet_missing_ipv6 (void) "ethernet-missing-ipv6", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11793,19 +11074,13 @@ test_read_bond_main (void) { NMConnection *connection; NMSettingBond *s_bond; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_MAIN, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "bond-main-read", "unexpected failure reading %s", TEST_IFCFG_BOND_MAIN); @@ -11829,10 +11104,6 @@ test_read_bond_main (void) "bond-main", "failed to verify %s: miimon=%s does not match 100", TEST_IFCFG_BOND_MAIN, nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_MIIMON)); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -11851,10 +11122,6 @@ test_write_bond_main (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -11924,10 +11191,8 @@ test_write_bond_main (void) reread = connection_from_file_test (testfile, NULL, TYPE_BOND, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -11941,10 +11206,6 @@ test_write_bond_main (void) "bond-main-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -11956,19 +11217,13 @@ test_read_bond_slave (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages (); @@ -11991,10 +11246,6 @@ test_read_bond_slave (void) "bond-slave-read", "failed to verify %s: slave-type is not bond", TEST_IFCFG_BOND_SLAVE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12011,9 +11262,6 @@ test_write_bond_slave (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12065,9 +11313,9 @@ test_write_bond_slave (void) reread = connection_from_file_test (testfile, NULL, TYPE_ETHERNET, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -12082,9 +11330,6 @@ test_write_bond_slave (void) "bond-slave-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread); @@ -12098,9 +11343,6 @@ test_read_infiniband (void) NMConnection *connection; NMSettingInfiniband *s_infiniband; char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; const char *mac; char expected_mac_address[INFINIBAND_ALEN] = { 0x80, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22 }; @@ -12110,9 +11352,7 @@ test_read_infiniband (void) NULL, TYPE_INFINIBAND, &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, NULL, NULL, &error); ASSERT (connection != NULL, "infiniband-read", "failed to read %s: %s", TEST_IFCFG_INFINIBAND, error->message); @@ -12157,10 +11397,6 @@ test_read_infiniband (void) NM_SETTING_INFINIBAND_SETTING_NAME, NM_SETTING_INFINIBAND_TRANSPORT_MODE); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12180,10 +11416,6 @@ test_write_infiniband (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12256,10 +11488,8 @@ test_write_infiniband (void) reread = connection_from_file_test (testfile, NULL, TYPE_INFINIBAND, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); unlink (testfile); @@ -12273,10 +11503,6 @@ test_write_infiniband (void) "infiniband-write", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -12288,19 +11514,13 @@ test_read_bond_slave_ib (void) { NMConnection *connection; NMSettingConnection *s_con; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; - char *route6file = NULL; GError *error = NULL; connection = connection_from_file_test (TEST_IFCFG_BOND_SLAVE_IB, NULL, NULL, - &unmanaged, - &keyfile, - &routefile, - &route6file, + NULL, + NULL, NULL, NULL, &error); g_test_assert_expected_messages(); @@ -12323,10 +11543,6 @@ test_read_bond_slave_ib (void) "bond-slave-read-ib", "failed to verify %s: slave-type is not bond", TEST_IFCFG_BOND_SLAVE_IB); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); - g_free (route6file); g_object_unref (connection); } @@ -12342,9 +11558,6 @@ test_write_bond_slave_ib (void) gboolean success; GError *error = NULL; char *testfile = NULL; - char *unmanaged = NULL; - char *keyfile = NULL; - char *routefile = NULL; char *route6file = NULL; connection = nm_simple_connection_new (); @@ -12397,9 +11610,9 @@ test_write_bond_slave_ib (void) reread = connection_from_file_test (testfile, NULL, NULL, - &unmanaged, - &keyfile, - &routefile, + NULL, + NULL, + NULL, &route6file, &error); unlink (testfile); @@ -12414,9 +11627,6 @@ test_write_bond_slave_ib (void) "bond-slave-write-ib", "written and re-read connection weren't the same."); g_free (testfile); - g_free (unmanaged); - g_free (keyfile); - g_free (routefile); g_free (route6file); g_object_unref (connection); g_object_unref (reread);