all/tests: fix messages for ASSERT() macro

These places pass an invalid arguments for the given
format string. Fix them, by dropping the overly verbose
ASSERT() macro.
This commit is contained in:
Thomas Haller 2016-02-03 12:37:25 +01:00
parent 0f4ddf7882
commit c510323368
4 changed files with 8 additions and 25 deletions

View file

@ -47,9 +47,7 @@ compare_blob_data (const char *test,
ASSERT (len > 0, test, "blob key file invalid (size 0)");
ASSERT (len == g_bytes_get_size (key),
test, "blob key file (%d) and setting key data (%d) lengths don't match",
len, g_bytes_get_size (key));
g_assert_cmpint (len, ==, g_bytes_get_size (key));
ASSERT (memcmp (contents, g_bytes_get_data (key, NULL), len) == 0,
test, "blob key file and blob key data don't match");

View file

@ -47,9 +47,7 @@ compare_blob_data (const char *test,
ASSERT (len > 0, test, "blob key file invalid (size 0)");
ASSERT (len == key->len,
test, "blob key file (%d) and setting key data (%d) lengths don't match",
len, key->len);
g_assert_cmpint (len, ==, key->len);
ASSERT (memcmp (contents, key->data, len) == 0,
test, "blob key file and blob key data don't match");

View file

@ -1905,17 +1905,10 @@ test_read_wired_8021x_peap_mschapv2 (void)
NM_SETTING_802_1X_CK_SCHEME_PATH,
NULL,
&error);
ASSERT (success == TRUE,
"wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: could not load CA certificate",
TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2,
NM_SETTING_802_1X_SETTING_NAME,
NM_SETTING_802_1X_CA_CERT);
g_assert (success == TRUE);
expected_ca_cert_path = nm_setting_802_1x_get_ca_cert_path (tmp_8021x);
ASSERT (expected_ca_cert_path != NULL,
"wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: failed to get CA certificate",
TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2,
NM_SETTING_802_1X_SETTING_NAME,
NM_SETTING_802_1X_CA_CERT);
g_assert (expected_ca_cert_path);
read_ca_cert_path = nm_setting_802_1x_get_ca_cert_path (s_8021x);
ASSERT (read_ca_cert_path != NULL,
@ -7399,12 +7392,8 @@ test_write_wired_aliases (void)
ip[j] = NULL;
}
for (i = 0; i < num_addresses; i++) {
ASSERT (ip[i] == 0,
"wired-aliases-write-verify-ip4", "failed to verify %s: did not find IP4 address 0x%08x",
testfile,
ip[i]);
}
for (i = 0; i < num_addresses; i++)
g_assert (!ip[i]);
/* Gateway */
g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "1.1.1.1");

View file

@ -628,9 +628,7 @@ test18_read_static_ipv6 (const char *path)
connection = nm_simple_connection_new();
ifupdown_update_connection_from_if_block(connection, block, &error);
ASSERT (connection != NULL,
TEST18_NAME
"failed to read %s: %s", file, error->message);
g_assert (connection != NULL);
ASSERT (nm_connection_verify (connection, &error),
TEST18_NAME,