Use ASSERT_COMPARE instead of TEST_ASSERT( memcmp( ... ) == 0 )
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
parent
f376cee8b4
commit
fb08096b9b
1 changed files with 22 additions and 18 deletions
|
@ -3692,7 +3692,8 @@ void ssl_tls1_3_hkdf_expand_label( int hash_alg,
|
||||||
ctx->x, ctx->len,
|
ctx->x, ctx->len,
|
||||||
dst, desired_length ) == 0 );
|
dst, desired_length ) == 0 );
|
||||||
|
|
||||||
TEST_ASSERT( memcmp( dst, expected->x, desired_length ) == 0 );
|
ASSERT_COMPARE( dst, (size_t) desired_length,
|
||||||
|
expected->x, (size_t) expected->len );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
@ -3724,21 +3725,22 @@ void ssl_tls1_3_traffic_key_generation( int hash_alg,
|
||||||
desired_key_len, desired_iv_len,
|
desired_key_len, desired_iv_len,
|
||||||
&keys ) == 0 );
|
&keys ) == 0 );
|
||||||
|
|
||||||
TEST_ASSERT( keys.keyLen == (size_t) desired_key_len );
|
ASSERT_COMPARE( keys.client_write_key,
|
||||||
TEST_ASSERT( keys.ivLen == (size_t) desired_iv_len );
|
keys.keyLen,
|
||||||
|
|
||||||
TEST_ASSERT( memcmp( keys.client_write_key,
|
|
||||||
expected_client_write_key->x,
|
expected_client_write_key->x,
|
||||||
desired_key_len ) == 0 );
|
(size_t) desired_key_len );
|
||||||
TEST_ASSERT( memcmp( keys.server_write_key,
|
ASSERT_COMPARE( keys.server_write_key,
|
||||||
|
keys.keyLen,
|
||||||
expected_server_write_key->x,
|
expected_server_write_key->x,
|
||||||
desired_key_len ) == 0 );
|
(size_t) desired_key_len );
|
||||||
TEST_ASSERT( memcmp( keys.client_write_iv,
|
ASSERT_COMPARE( keys.client_write_iv,
|
||||||
|
keys.ivLen,
|
||||||
expected_client_write_iv->x,
|
expected_client_write_iv->x,
|
||||||
desired_iv_len ) == 0 );
|
(size_t) desired_iv_len );
|
||||||
TEST_ASSERT( memcmp( keys.server_write_iv,
|
ASSERT_COMPARE( keys.server_write_iv,
|
||||||
|
keys.ivLen,
|
||||||
expected_server_write_iv->x,
|
expected_server_write_iv->x,
|
||||||
desired_iv_len ) == 0 );
|
(size_t) desired_iv_len );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
@ -3765,7 +3767,8 @@ void ssl_tls1_3_derive_secret( int hash_alg,
|
||||||
already_hashed,
|
already_hashed,
|
||||||
dst, desired_length ) == 0 );
|
dst, desired_length ) == 0 );
|
||||||
|
|
||||||
TEST_ASSERT( memcmp( dst, expected->x, desired_length ) == 0 );
|
ASSERT_COMPARE( dst, desired_length,
|
||||||
|
expected->x, desired_length );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
@ -3783,7 +3786,8 @@ void ssl_tls1_3_key_evolution( int hash_alg,
|
||||||
input->len ? input->x : NULL, input->len,
|
input->len ? input->x : NULL, input->len,
|
||||||
secret_new ) == 0 );
|
secret_new ) == 0 );
|
||||||
|
|
||||||
TEST_ASSERT( memcmp( secret_new, expected->x, expected->len ) == 0 );
|
ASSERT_COMPARE( secret_new, (size_t) expected->len,
|
||||||
|
expected->x, (size_t) expected->len );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue