summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-12-01 14:41:31 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2021-12-01 14:41:31 +0900
commitbff9ed54285b9a332382589d89e317da987b5b38 (patch)
tree98b8015e0793ca0c50a1d26afb4b0134fd6a7154 /tests
parentc8d2b0069e3cc97138c4e09224a84bb6ccf1b6b5 (diff)
downloadlibgcrypt-bff9ed54285b9a332382589d89e317da987b5b38.tar.gz
tests: Fix basic.c to show useful information on error.
* tests/basic.c (check_ctr_cipher): Assign return value to ERR. (check_siv_cipher, check_ccm_cipher): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/basic.c b/tests/basic.c
index ace9c1d1..34b06de1 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -2166,7 +2166,7 @@ check_ctr_cipher (void)
if (!tv[i].algo)
continue;
- if (gcry_cipher_test_algo (tv[i].algo))
+ if ((err = gcry_cipher_test_algo (tv[i].algo)))
{
if (in_fips_mode && (tv[i].flags & FLAG_NOFIPS))
{
@@ -5065,7 +5065,7 @@ check_siv_cipher (void)
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
{
/* The AES algorithm is allowed in FIPS mode */
- if (gcry_cipher_test_algo (tv[i].algo))
+ if ((err = gcry_cipher_test_algo (tv[i].algo)))
{
fail ("aes-siv, gcry_cipher_test_algo failed: %s\n", gpg_strerror (err));
continue;
@@ -7269,7 +7269,7 @@ check_ccm_cipher (void)
for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
{
- if (gcry_cipher_test_algo (tv[i].algo))
+ if ((err = gcry_cipher_test_algo (tv[i].algo)))
{
if (in_fips_mode && (tv[i].flags & FLAG_NOFIPS))
{
@@ -15770,7 +15770,7 @@ do_check_one_pubkey (int n, gcry_sexp_t skey, gcry_sexp_t pkey,
static void
check_one_pubkey (int n, test_spec_pubkey_t spec)
{
- gcry_error_t err = GPG_ERR_NO_ERROR;
+ gcry_error_t err = 0;
gcry_sexp_t skey, pkey;
err = gcry_sexp_sscan (&skey, NULL, spec.key.secret,
@@ -16205,7 +16205,7 @@ check_pubkey (void)
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" }
}
};
- gcry_error_t err = GPG_ERR_NO_ERROR;
+ gcry_error_t err = 0;
int i;
if (verbose)