static int uuid_equal_display_error(const LargestIntegralType actual,
const LargestIntegralType expected)
{
- if (uuid_cmp((const sd_id128_t *)actual, (const sd_id128_t *)expected))
+ const sd_id128_t *act = (const sd_id128_t *)cast_to_pointer_integral_type(actual);
+ const sd_id128_t *exp = (const sd_id128_t *)cast_to_pointer_integral_type(actual);
+
+ if (uuid_cmp(act, exp))
return 1;
+
fprintf(stderr, SD_ID128_FORMAT_STR " != " SD_ID128_FORMAT_STR "\n",
- SD_ID128_FORMAT_VAL(*(const sd_id128_t *)actual),
- SD_ID128_FORMAT_VAL(*(const sd_id128_t *)expected));
+ SD_ID128_FORMAT_VAL(*act),
+ SD_ID128_FORMAT_VAL(*exp));
return 0;
}
sd_id128_t generate_uuid()
{
- return SD_ID128_MAKE(bb, 21, cd, 23, bd, 6c, 43, d6, 51, e4, e5, 7d, ab, 03, 09, 07);
+ sd_id128_t uuid;
+
+ assert_int_equal(sd_id128_randomize(&uuid), 0);
+ return uuid;
}
faultd_oid_t generate_oid()
{
faultd_oid_t oid;
+ memset(&oid, 0, sizeof(oid));
oid.uuid = generate_uuid();
return oid;
}