mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 03:20:18 +01:00
platform/tests: print details about test failure for test_platform_ip_address_pretty_sort_cmp()
When the test is about to fail, print the wrong data to help debugging
the test failure.
(cherry picked from commit 3576f54100)
This commit is contained in:
parent
07868a535f
commit
36ccbcc550
1 changed files with 13 additions and 0 deletions
|
|
@ -715,6 +715,19 @@ test_platform_ip_address_pretty_sort_cmp(gconstpointer test_data)
|
|||
NULL,
|
||||
0,
|
||||
&bin_len);
|
||||
|
||||
if (bin_len != ELM_SIZE * N_ADDRESSES || memcmp(addresses, bin_arr, bin_len) != 0) {
|
||||
char *addresses_str = nm_utils_bin2hexstr(addresses, ELM_SIZE * N_ADDRESSES, -1);
|
||||
|
||||
g_error(">>> test_platform_ip_address_pretty_sort_cmp() will fail:\n"
|
||||
">>> addresses[%zu]: %s\n"
|
||||
">>> expected [%zu]: %s\n",
|
||||
ELM_SIZE * N_ADDRESSES,
|
||||
addresses_str,
|
||||
bin_len,
|
||||
EXPECTED_BUFFER[TEST_DATA_I]);
|
||||
}
|
||||
|
||||
g_assert_cmpmem(addresses, ELM_SIZE * N_ADDRESSES, bin_arr, bin_len);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue