Merge pull request #3627 from gilles-peskine-arm/test-fail-report-first-2.7

Backport 2.7: Report the first unit test failure, not the last one
This commit is contained in:
Gilles Peskine 2020-09-05 11:16:08 +02:00 committed by GitHub
commit 75ffb27577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -211,6 +211,12 @@ test_info;
void test_fail( const char *test, int line_no, const char* filename ) void test_fail( const char *test, int line_no, const char* filename )
{ {
if( test_info.failed )
{
/* We've already recorded the test as having failed. Don't
* overwrite any previous information about the failure. */
return;
}
test_info.failed = 1; test_info.failed = 1;
test_info.test = test; test_info.test = test;
test_info.line_no = line_no; test_info.line_no = line_no;

View file

@ -337,7 +337,7 @@ void mbedtls_mpi_lt_mpi_ct( int size_X, char * input_X,
int size_Y, char * input_Y, int size_Y, char * input_Y,
int input_ret, int input_err ) int input_ret, int input_err )
{ {
unsigned ret; unsigned ret = -1;
unsigned input_uret = input_ret; unsigned input_uret = input_ret;
mbedtls_mpi X, Y; mbedtls_mpi X, Y;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );