diff options
author | Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> | 2017-12-25 19:31:05 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-01-16 16:10:00 +0300 |
commit | f73cd6de167b16bae0256fee65c77d11ee18699e (patch) | |
tree | 43c1ddbf30dc0398d252bbf355cb6f6fabdde265 | |
parent | 1e2435a49ca5380143546f33aebc32e0b935bc54 (diff) |
validation: crypto: fail if no tests were executed
Fail the test if we were not able to match any test vectors to
capabilities.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | test/validation/api/crypto/odp_crypto_test_inp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index ddbad3097..8d1489ae6 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -437,6 +437,8 @@ static void check_alg(odp_crypto_op_t op, int rc, cipher_num, auth_num, i; odp_bool_t cipher_tested[MAX_ALG_CAPA]; odp_bool_t auth_tested[MAX_ALG_CAPA]; + odp_bool_t cipher_ok = false; + odp_bool_t auth_ok = false; size_t idx; rc = odp_crypto_capability(&capa); @@ -555,21 +557,29 @@ static void check_alg(odp_crypto_op_t op, auth_tested[auth_idx] = true; } - for (i = 0; i < cipher_num; i++) + for (i = 0; i < cipher_num; i++) { + cipher_ok |= cipher_tested[i]; if (!cipher_tested[i]) printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " "iv_len=%" PRIu32 "\n", cipher_alg_name(cipher_alg), cipher_capa[i].key_len, cipher_capa[i].iv_len); + } - for (i = 0; i < auth_num; i++) + for (i = 0; i < auth_num; i++) { + auth_ok |= auth_tested[i]; if (!auth_tested[i]) printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " "digest_len=%" PRIu32 "\n", auth_alg_name(auth_alg), auth_capa[i].key_len, auth_capa[i].digest_len); + } + + /* Verify that we were able to run at least several tests */ + CU_ASSERT(cipher_ok); + CU_ASSERT(auth_ok); } /** |