mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
libnm-core/tests: drop duplicate tests _check_uuid_v3()
As the unit test shows, the behavior is the same.
This commit is contained in:
parent
871c82fd5f
commit
d527181e1f
|
@ -7945,42 +7945,6 @@ test_nm_utils_uuid_generate_from_string(void)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_check_uuid_v3(const char *expected_uuid, const char *str, gssize slen, char *uuid_test)
|
||||
{
|
||||
g_assert(uuid_test);
|
||||
g_assert(nm_uuid_is_normalized(uuid_test));
|
||||
|
||||
if (strcmp(uuid_test, expected_uuid)) {
|
||||
g_error("UUID test failed (1): text=%s, len=%lld, expected=%s, uuid_test=%s",
|
||||
str,
|
||||
(long long) slen,
|
||||
expected_uuid,
|
||||
uuid_test);
|
||||
}
|
||||
g_free(uuid_test);
|
||||
|
||||
uuid_test = nm_uuid_generate_from_string_str(str, slen, NM_UUID_TYPE_VERSION3, &nm_uuid_ns_1);
|
||||
|
||||
g_assert(uuid_test);
|
||||
g_assert(nm_utils_is_uuid(uuid_test));
|
||||
|
||||
if (strcmp(uuid_test, expected_uuid)) {
|
||||
g_error("UUID test failed (2): text=%s; len=%lld, expected=%s, uuid2=%s",
|
||||
str,
|
||||
(long long) slen,
|
||||
expected_uuid,
|
||||
uuid_test);
|
||||
}
|
||||
g_free(uuid_test);
|
||||
}
|
||||
|
||||
#define check_uuid_v3(expected_uuid, str, ...) \
|
||||
_check_uuid_v3(expected_uuid, \
|
||||
str, \
|
||||
NM_STRLEN(str), \
|
||||
nm_uuid_generate_from_strings_v3(__VA_ARGS__, NULL))
|
||||
|
||||
static void
|
||||
_check_uuid(NMUuidType uuid_type,
|
||||
const NMUuid *type_arg,
|
||||
|
@ -8047,6 +8011,9 @@ _check_uuid(NMUuidType uuid_type,
|
|||
nm_uuid_generate_from_strings_v3(__VA_ARGS__, NULL)); \
|
||||
})
|
||||
|
||||
#define check_uuid_v3(expected_uuid, str, ...) \
|
||||
check_uuid(NM_UUID_TYPE_VERSION3, &nm_uuid_ns_1, expected_uuid, str, __VA_ARGS__)
|
||||
|
||||
static void
|
||||
test_nm_utils_uuid_generate_from_strings(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue