mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 11:48:06 +02:00
keyfile/tests: use cleanup attribute for keyfile
This commit is contained in:
parent
f25cd2b844
commit
9f9e4b0c35
1 changed files with 5 additions and 14 deletions
|
|
@ -790,7 +790,7 @@ test_write_string_ssid (void)
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
pid_t owner_grp;
|
pid_t owner_grp;
|
||||||
uid_t owner_uid;
|
uid_t owner_uid;
|
||||||
GKeyFile *keyfile;
|
gs_unref_keyfile GKeyFile *keyfile = NULL;
|
||||||
|
|
||||||
connection = nm_simple_connection_new ();
|
connection = nm_simple_connection_new ();
|
||||||
|
|
||||||
|
|
@ -840,7 +840,6 @@ test_write_string_ssid (void)
|
||||||
g_assert (tmp);
|
g_assert (tmp);
|
||||||
g_assert_cmpmem (tmp, strlen (tmp), tmpssid, sizeof (tmpssid));
|
g_assert_cmpmem (tmp, strlen (tmp), tmpssid, sizeof (tmpssid));
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
g_key_file_free (keyfile);
|
|
||||||
|
|
||||||
assert_reread_and_unlink (connection, TRUE, testfile);
|
assert_reread_and_unlink (connection, TRUE, testfile);
|
||||||
}
|
}
|
||||||
|
|
@ -890,7 +889,7 @@ test_write_intlist_ssid (void)
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
pid_t owner_grp;
|
pid_t owner_grp;
|
||||||
uid_t owner_uid;
|
uid_t owner_uid;
|
||||||
GKeyFile *keyfile;
|
gs_unref_keyfile GKeyFile *keyfile = NULL;
|
||||||
gint *intlist;
|
gint *intlist;
|
||||||
gsize len = 0, i;
|
gsize len = 0, i;
|
||||||
|
|
||||||
|
|
@ -949,8 +948,6 @@ test_write_intlist_ssid (void)
|
||||||
g_assert_cmpint (intlist[i], ==, tmpssid[i]);
|
g_assert_cmpint (intlist[i], ==, tmpssid[i]);
|
||||||
g_free (intlist);
|
g_free (intlist);
|
||||||
|
|
||||||
g_key_file_free (keyfile);
|
|
||||||
|
|
||||||
assert_reread_and_unlink (connection, TRUE, testfile);
|
assert_reread_and_unlink (connection, TRUE, testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1031,11 +1028,10 @@ test_write_intlike_ssid (void)
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
pid_t owner_grp;
|
pid_t owner_grp;
|
||||||
uid_t owner_uid;
|
uid_t owner_uid;
|
||||||
GKeyFile *keyfile;
|
gs_unref_keyfile GKeyFile *keyfile = NULL;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
connection = nm_simple_connection_new ();
|
connection = nm_simple_connection_new ();
|
||||||
g_assert (connection);
|
|
||||||
|
|
||||||
/* Connection setting */
|
/* Connection setting */
|
||||||
|
|
||||||
|
|
@ -1086,8 +1082,6 @@ test_write_intlike_ssid (void)
|
||||||
g_assert_cmpstr (tmp, ==, "101");
|
g_assert_cmpstr (tmp, ==, "101");
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
g_key_file_free (keyfile);
|
|
||||||
|
|
||||||
assert_reread_and_unlink (connection, TRUE, testfile);
|
assert_reread_and_unlink (connection, TRUE, testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1106,7 +1100,7 @@ test_write_intlike_ssid_2 (void)
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
pid_t owner_grp;
|
pid_t owner_grp;
|
||||||
uid_t owner_uid;
|
uid_t owner_uid;
|
||||||
GKeyFile *keyfile;
|
gs_unref_keyfile GKeyFile *keyfile = NULL;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
connection = nm_simple_connection_new ();
|
connection = nm_simple_connection_new ();
|
||||||
|
|
@ -1161,8 +1155,6 @@ test_write_intlike_ssid_2 (void)
|
||||||
g_assert_cmpstr (tmp, ==, "11\\;12\\;13\\;");
|
g_assert_cmpstr (tmp, ==, "11\\;12\\;13\\;");
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
g_key_file_free (keyfile);
|
|
||||||
|
|
||||||
assert_reread_and_unlink (connection, TRUE, testfile);
|
assert_reread_and_unlink (connection, TRUE, testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1714,7 +1706,7 @@ test_write_wired_8021x_tls_connection_path (void)
|
||||||
gboolean success;
|
gboolean success;
|
||||||
gs_free char *testfile = NULL;
|
gs_free char *testfile = NULL;
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
GKeyFile *keyfile;
|
gs_unref_keyfile GKeyFile *keyfile = NULL;
|
||||||
gboolean relative = FALSE;
|
gboolean relative = FALSE;
|
||||||
|
|
||||||
connection = create_wired_tls_connection (NM_SETTING_802_1X_CK_SCHEME_PATH);
|
connection = create_wired_tls_connection (NM_SETTING_802_1X_CK_SCHEME_PATH);
|
||||||
|
|
@ -1792,7 +1784,6 @@ test_write_wired_8021x_tls_connection_path (void)
|
||||||
g_free (tmp2);
|
g_free (tmp2);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
g_key_file_free (keyfile);
|
|
||||||
unlink (testfile);
|
unlink (testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue