Prefer TEST_EQUAL over TEST_ASSERT in test suites

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2022-04-15 06:51:56 -04:00
parent 6dd489cb15
commit ee9488d3f0

View file

@ -4572,23 +4572,23 @@ void raw_key_agreement_fail( int bad_server_ecdhe_key )
* the raw key agreement. Flipping one bit with a Weierstrass * the raw key agreement. Flipping one bit with a Weierstrass
* curve (as opposed to a Montgomery curve) has a high chance of * curve (as opposed to a Montgomery curve) has a high chance of
* making it invalid. */ * making it invalid. */
TEST_ASSERT( mbedtls_endpoint_init( &client, MBEDTLS_SSL_IS_CLIENT, TEST_EQUAL( mbedtls_endpoint_init( &client, MBEDTLS_SSL_IS_CLIENT,
MBEDTLS_PK_ECDSA, NULL, NULL, MBEDTLS_PK_ECDSA, NULL, NULL,
NULL, curve_list ) == 0 ); NULL, curve_list ), 0 );
/* Server side */ /* Server side */
TEST_ASSERT( mbedtls_endpoint_init( &server, MBEDTLS_SSL_IS_SERVER, TEST_EQUAL( mbedtls_endpoint_init( &server, MBEDTLS_SSL_IS_SERVER,
MBEDTLS_PK_ECDSA, NULL, NULL, MBEDTLS_PK_ECDSA, NULL, NULL,
NULL, NULL ) == 0 ); NULL, NULL ), 0 );
TEST_ASSERT( mbedtls_mock_socket_connect( &(client.socket), TEST_EQUAL( mbedtls_mock_socket_connect( &(client.socket),
&(server.socket), &(server.socket),
BUFFSIZE ) == 0 ); BUFFSIZE ), 0 );
TEST_ASSERT( mbedtls_move_handshake_to_state( &(client.ssl), TEST_EQUAL( mbedtls_move_handshake_to_state( &(client.ssl),
&(server.ssl), &(server.ssl),
MBEDTLS_SSL_CLIENT_KEY_EXCHANGE ) MBEDTLS_SSL_CLIENT_KEY_EXCHANGE )
== 0 ); , 0 );
mbedtls_psa_get_stats( &stats ); mbedtls_psa_get_stats( &stats );
/* Save the number of slots in use up to this point. /* Save the number of slots in use up to this point.