summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-09-28 12:30:12 +0200
committerThomas Haller <thaller@redhat.com>2022-10-03 17:57:49 +0200
commitd527181e1f559837068071aa70adfa4308cd5cc3 (patch)
tree372a6a09d38d695c0b253ed915643a40242def37
parent871c82fd5f6e7376f9f1a0f331d1e68803c51c0c (diff)
libnm-core/tests: drop duplicate tests _check_uuid_v3()
As the unit test shows, the behavior is the same.
-rw-r--r--src/libnm-core-impl/tests/test-general.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c
index 46f2df36da..f29fa39927 100644
--- a/src/libnm-core-impl/tests/test-general.c
+++ b/src/libnm-core-impl/tests/test-general.c
@@ -7946,42 +7946,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,
const char *expected_uuid,
@@ -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)
{