From d0c701237a2c8d1938677a80d40fc9bd3fc6794b Mon Sep 17 00:00:00 2001 From: Raef Coles Date: Wed, 12 Oct 2022 14:19:52 +0100 Subject: [PATCH] Replace TEST_ASSERT with TEST_EQUAL in LMS tests Signed-off-by: Raef Coles --- tests/suites/test_suite_lms.function | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/suites/test_suite_lms.function b/tests/suites/test_suite_lms.function index 709db8ce2b..4e525c452e 100644 --- a/tests/suites/test_suite_lms.function +++ b/tests/suites/test_suite_lms.function @@ -27,16 +27,16 @@ void lms_sign_verify_test ( data_t *msg, data_t *seed ) mbedtls_test_rnd_std_rand, NULL, seed->x, seed->len ); TEST_ASSUME( rc != MBEDTLS_ERR_LMS_ALLOC_FAILED ); - TEST_ASSERT( rc == 0 ); + TEST_EQUAL( rc, 0 ); - TEST_ASSERT( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ) == 0 ); + TEST_EQUAL( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ), 0 ); - TEST_ASSERT( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL, + TEST_EQUAL( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL, msg->x, msg->len, sig, sizeof( sig ), - NULL ) == 0 ); + NULL ), 0 ); - TEST_ASSERT( mbedtls_lms_verify( &pub_ctx, msg->x, msg->len, sig, - sizeof( sig ) ) == 0 ); + TEST_EQUAL( mbedtls_lms_verify( &pub_ctx, msg->x, msg->len, sig, + sizeof( sig ) ), 0 ); exit: mbedtls_lms_public_free( &pub_ctx ); @@ -63,16 +63,16 @@ void lms_sign_verify_null_msg_test( data_t *seed ) mbedtls_test_rnd_std_rand, NULL, seed->x, seed->len ); TEST_ASSUME( rc != MBEDTLS_ERR_LMS_ALLOC_FAILED ); - TEST_ASSERT( rc == 0 ); + TEST_EQUAL( rc, 0 ); - TEST_ASSERT( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ) == 0 ); + TEST_EQUAL( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ), 0 ); - TEST_ASSERT( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL, + TEST_EQUAL( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL, NULL, 0, sig, sizeof( sig ), - NULL ) == 0 ); + NULL ), 0 ); - TEST_ASSERT( mbedtls_lms_verify( &pub_ctx, NULL, 0, sig, - sizeof( sig ) ) == 0 ); + TEST_EQUAL( mbedtls_lms_verify( &pub_ctx, NULL, 0, sig, + sizeof( sig ) ), 0 ); exit: mbedtls_lms_public_free( &pub_ctx );