diff options
author | Gilles Peskine <Gilles.Peskine@arm.com> | 2020-08-26 11:16:50 +0200 |
---|---|---|
committer | Gilles Peskine <Gilles.Peskine@arm.com> | 2020-08-26 11:16:50 +0200 |
commit | ed9fbc6443caf4b357145d362075321082be1641 (patch) | |
tree | ce684b52c242c4b3260dd49969be142df0754d2a | |
parent | 6c75152b9f1a5dac1d92b793cb0c1d93b161c690 (diff) | |
download | mbed-tls-ed9fbc6443caf4b357145d362075321082be1641.tar.gz |
Clearer function name for parity check
Return a name that more clearly returns nonzero=true=good, 0=bad. We'd
normally expect check_xxx to return 0=pass, nonzero=fail so
check_parity was a bad name.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
-rw-r--r-- | tests/suites/test_suite_psa_crypto_metadata.function | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/suites/test_suite_psa_crypto_metadata.function b/tests/suites/test_suite_psa_crypto_metadata.function index abee922e7..2c069835a 100644 --- a/tests/suites/test_suite_psa_crypto_metadata.function +++ b/tests/suites/test_suite_psa_crypto_metadata.function @@ -68,7 +68,7 @@ * The expected parity is even so that 0 is considered a valid encoding. * * Return 0 if value has even parity and a nonzero value otherwise. */ -int check_parity( uint32_t value ) +int has_even_parity( uint32_t value ) { value ^= value >> 16; value ^= value >> 8; @@ -76,7 +76,7 @@ int check_parity( uint32_t value ) return( 0x9669 & 1 << ( value & 0xf ) ); } #define TEST_PARITY( value ) \ - TEST_ASSERT( check_parity( value ) ) + TEST_ASSERT( has_even_parity( value ) ) void algorithm_classification( psa_algorithm_t alg, unsigned flags ) { |