Current API can't force crypto operation to be strictly sync or async.
Hence test should handle synchronous operation even if 'pref_mode' is
set to ODP_CRYPTO_ASYNC.

Signed-off-by: Taras Kondratiuk <taras.kondrat...@linaro.org>
---
 test/validation/crypto/odp_crypto_test_async_inp.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c 
b/test/validation/crypto/odp_crypto_test_async_inp.c
index 9e4e9f1..494a68e 100644
--- a/test/validation/crypto/odp_crypto_test_async_inp.c
+++ b/test/validation/crypto/odp_crypto_test_async_inp.c
@@ -90,21 +90,22 @@ static void alg_test(enum odp_crypto_op op,
                CU_FAIL("%s : not implemented for combined alg mode\n");
        }
 
-       rc = odp_crypto_operation(&op_params, &posted, NULL);
+       rc = odp_crypto_operation(&op_params, &posted, &result);
        if (rc < 0) {
                CU_FAIL("Failed odp_crypto_operation()");
                goto cleanup;
        }
-       CU_ASSERT(posted);
 
-       /* Poll completion queue for results */
-       do {
-               event = odp_queue_deq(compl_queue);
-       } while (event == ODP_EVENT_INVALID);
+       if (posted) {
+               /* Poll completion queue for results */
+               do {
+                       event = odp_queue_deq(suite_context.queue);
+               } while (event == ODP_EVENT_INVALID);
 
-       compl_event = odp_crypto_compl_from_event(event);
-       odp_crypto_compl_result(compl_event, &result);
-       odp_crypto_compl_free(compl_event);
+               compl_event = odp_crypto_compl_from_event(event);
+               odp_crypto_compl_result(compl_event, &result);
+               odp_crypto_compl_free(compl_event);
+       }
 
        CU_ASSERT(result.ok);
        CU_ASSERT(result.pkt == pkt);
-- 
1.9.1


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to