summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-07-08 13:38:23 +0200
committerThomas Haller <thaller@redhat.com>2014-08-22 15:24:30 +0200
commit7d924d725a70622dffe023fa8dcb96d16fcdafd1 (patch)
tree07220e5b6c9457e695e8ba72f87286e48ff71f7f
parent5f26a9c11ff44474bbaff97a811f1eb636d888b2 (diff)
downloadNetworkManager-7d924d725a70622dffe023fa8dcb96d16fcdafd1.tar.gz
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>
-rw-r--r--src/settings/plugins/keyfile/tests/test-keyfile.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/settings/plugins/keyfile/tests/test-keyfile.c b/src/settings/plugins/keyfile/tests/test-keyfile.c
index acbf86dd9d..ba763175ad 100644
--- a/src/settings/plugins/keyfile/tests/test-keyfile.c
+++ b/src/settings/plugins/keyfile/tests/test-keyfile.c
@@ -1376,8 +1376,7 @@ test_write_string_ssid (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
- ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
- "connection-write", "written and re-read connection weren't the same");
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -1501,8 +1500,7 @@ test_write_intlist_ssid (void)
g_assert_no_error (error);
g_assert (reread);
- success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
- g_assert (success);
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -1653,8 +1651,7 @@ test_write_intlike_ssid (void)
g_assert_no_error (error);
g_assert (reread);
- success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
- g_assert (success);
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -1741,8 +1738,7 @@ test_write_intlike_ssid_2 (void)
g_assert_no_error (error);
g_assert (reread);
- success = nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT);
- g_assert (success);
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -1996,8 +1992,7 @@ test_write_bt_dun_connection (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
- ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
- "connection-write", "written and re-read connection weren't the same");
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -2230,8 +2225,7 @@ test_write_gsm_connection (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, NULL);
ASSERT (reread != NULL, "connection-write", "failed to re-read test connection");
- ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE,
- "connection-write", "written and re-read connection weren't the same");
+ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE);
g_clear_error (&error);
unlink (testfile);
@@ -3224,7 +3218,7 @@ test_write_new_wired_group_name (void)
reread = nm_keyfile_plugin_connection_from_file (testfile, &error);
g_assert_no_error (error);
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 */
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);
g_assert_no_error (error);
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 */
kf = g_key_file_new ();