From 3de040f62d470dc44af1085b04c2a0c4ee0fe718 Mon Sep 17 00:00:00 2001 From: Ryan Everett Date: Thu, 14 Mar 2024 17:50:06 +0000 Subject: [PATCH] Use TEST_FAIL in threaded tests Signed-off-by: Ryan Everett --- tests/suites/test_suite_psa_crypto.function | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 30d34264aa..7a242fd73d 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -1370,7 +1370,7 @@ void *thread_import_key(void *ctx) if (skc->key_loaded) { mbedtls_mutex_unlock(&skc->key_loaded_mutex); /* More than one thread has succeeded, report a failure. */ - TEST_EQUAL(skc->key_loaded, 0); + TEST_FAIL("The same key has been loaded into the key store multiple times."); } skc->key_loaded = 1; mbedtls_mutex_unlock(&skc->key_loaded_mutex); @@ -1445,8 +1445,7 @@ void *thread_use_and_destroy_key(void *ctx) /* Ensure that we are the only thread to succeed. */ if (skc->key_loaded != 1) { mbedtls_mutex_unlock(&skc->key_loaded_mutex); - //Will always fail - TEST_EQUAL(skc->key_loaded, 1); + TEST_FAIL("The same key has been destroyed multiple times."); } skc->key_loaded = 0; mbedtls_mutex_unlock(&skc->key_loaded_mutex);