1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Merge pull request #4006 from chris-jones-arm/development

Add macro to check error code additions/combinations
This commit is contained in:
Gilles Peskine
2021-04-28 16:47:29 +02:00
committed by GitHub
20 changed files with 447 additions and 298 deletions

View File

@ -278,4 +278,20 @@ void mbedtls_test_mutex_usage_init( void );
void mbedtls_test_mutex_usage_check( void );
#endif /* MBEDTLS_TEST_MUTEX_USAGE */
#if defined(MBEDTLS_TEST_HOOKS)
/**
* \brief Check that only a pure high-level error code is being combined with
* a pure low-level error code as otherwise the resultant error code
* would be corrupted.
*
* \note Both high-level and low-level error codes cannot be greater than
* zero however can be zero. If one error code is zero then the
* other error code is returned even if both codes are zero.
*
* \note If the check fails, fail the test currently being run.
*/
void mbedtls_test_err_add_check( int high, int low,
const char *file, int line);
#endif
#endif /* TEST_HELPERS_H */