keyfile/tests: refactor tests to use nmtst_assert_connection_equals() function

Needed in the next commit when we have to normalize the connection
before comparing.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2014-07-08 13:38:23 +02:00
parent 5f26a9c11f
commit 7d924d725a

View File

@@ -1376,8 +1376,7 @@ test_write_string_ssid (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL); reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
"connection-write", "written and re-read connection weren't the same");
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -1501,8 +1500,7 @@ test_write_intlist_ssid (void)
g_assert_no_error (error); g_assert_no_error (error);
g_assert (reread); g_assert (reread);
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_assert (success);
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -1653,8 +1651,7 @@ test_write_intlike_ssid (void)
g_assert_no_error (error); g_assert_no_error (error);
g_assert (reread); g_assert (reread);
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_assert (success);
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -1741,8 +1738,7 @@ test_write_intlike_ssid_2 (void)
g_assert_no_error (error); g_assert_no_error (error);
g_assert (reread); g_assert (reread);
success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT); nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_assert (success);
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -1996,8 +1992,7 @@ test_write_bt_dun_connection (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL); reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
"connection-write", "written and re-read connection weren't the same");
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -2230,8 +2225,7 @@ test_write_gsm_connection (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL); reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
"connection-write", "written and re-read connection weren't the same");
g_clear_error (&error); g_clear_error (&error);
unlink (testfile); unlink (testfile);
@@ -3224,7 +3218,7 @@ test_write_new_wired_group_name (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, &error); reread = nm_keyfile_plugin_connection_from_file (testfile, &error);
g_assert_no_error (error); g_assert_no_error (error);
g_assert (reread); g_assert (reread);
g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
/* Look at the keyfile itself to ensure we wrote out the new group names and type */ /* Look at the keyfile itself to ensure we wrote out the new group names and type */
kf = g_key_file_new (); kf = g_key_file_new ();
@@ -3354,7 +3348,7 @@ test_write_new_wireless_group_names (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, &error); reread = nm_keyfile_plugin_connection_from_file (testfile, &error);
g_assert_no_error (error); g_assert_no_error (error);
g_assert (reread); g_assert (reread);
g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
/* Look at the keyfile itself to ensure we wrote out the new group names and type */ /* Look at the keyfile itself to ensure we wrote out the new group names and type */
kf = g_key_file_new (); kf = g_key_file_new ();