mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 02:04:21 +01:00
Adds reporting of file/line no. in failed tests
Tests in tests/suites will now report the file and line number of failed test assertions.
This commit is contained in:
parent
43dba3d94e
commit
31a6c49139
@ -57,7 +57,7 @@ typedef UINT32 uint32_t;
|
|||||||
do { \
|
do { \
|
||||||
if( ! (TEST) ) \
|
if( ! (TEST) ) \
|
||||||
{ \
|
{ \
|
||||||
test_fail( #TEST ); \
|
test_fail( #TEST, __LINE__, __FILE__ ); \
|
||||||
goto exit; \
|
goto exit; \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
@ -348,11 +348,11 @@ static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_fail( const char *test )
|
static void test_fail( const char *test, int line_no, char* filename )
|
||||||
{
|
{
|
||||||
test_errors++;
|
test_errors++;
|
||||||
if( test_errors == 1 )
|
if( test_errors == 1 )
|
||||||
mbedtls_printf( "FAILED\n" );
|
mbedtls_printf( "FAILED\n" );
|
||||||
mbedtls_printf( " %s\n", test );
|
mbedtls_printf( " %s\n at line %d, %s\n", test, line_no, filename );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user