[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/18] crypto: use &error_fatal in crypto tests
From: |
Eric Blake |
Subject: |
Re: [PATCH 04/18] crypto: use &error_fatal in crypto tests |
Date: |
Thu, 8 Jul 2021 13:33:07 -0500 |
User-agent: |
NeoMutt/20210205-556-f84451-dirty |
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é <berrange@redhat.com>
> ---
> 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 <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH 03/18] crypto: skip essiv ivgen tests if AES+ECB isn't available, (continued)
- [PATCH 09/18] crypto: delete built-in DES implementation, Daniel P . Berrangé, 2021/07/06
- [PATCH 06/18] crypto: drop gcrypt thread initialization code, Daniel P . Berrangé, 2021/07/06
- [PATCH 08/18] crypto: add crypto tests for single block DES-ECB and DES-CBC, Daniel P . Berrangé, 2021/07/06
- [PATCH 07/18] crypto: drop custom XTS support in gcrypt driver, Daniel P . Berrangé, 2021/07/06
- [PATCH 04/18] crypto: use &error_fatal in crypto tests, Daniel P . Berrangé, 2021/07/06
- Re: [PATCH 04/18] crypto: use &error_fatal in crypto tests,
Eric Blake <=
- [PATCH 10/18] crypto: delete built-in XTS cipher mode support, Daniel P . Berrangé, 2021/07/06
- [PATCH 12/18] crypto: flip priority of backends to prefer gcrypt, Daniel P . Berrangé, 2021/07/06
- [PATCH 13/18] crypto: introduce build system for gnutls crypto backend, Daniel P . Berrangé, 2021/07/06
- [PATCH 11/18] crypto: rename des-rfb cipher to just des, Daniel P . Berrangé, 2021/07/06