On Tue, Jul 06, 2021 at 10:59:10AM +0100, Daniel P. Berrangé wrote:
> Using error_fatal provides better diagnostics when tests
> failed, than using asserts, because we see the text of
> the error message.
>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
> tests/unit/test-crypto-hash.c | 12 ++++++------
> tests/unit/test-crypto-hmac.c | 28 ++++++++--------------------
> 2 files changed, 14 insertions(+), 26 deletions(-)
>
> diff --git a/tests/unit/test-crypto-hash.c b/tests/unit/test-crypto-hash.c
> index ce7d0ab9b5..b50e28f212 100644
> --- a/tests/unit/test-crypto-hash.c
> @@ -243,7 +243,7 @@ static void test_hash_base64(void)
>
> int main(int argc, char **argv)
> {
> - g_assert(qcrypto_init(NULL) == 0);
> + g_assert(qcrypto_init(&error_fatal) == 0);
This is a side effect inside a g_assert(). It might be worth cleaning
it up while you are touching here. But since it is pre-existing, it
doesn't affect my:
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org