mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 04:15:43 +01:00
Report the first failure, not the last one
If test_fail is called multiple times in the same test case, report the location of the first failure, not the last one. With this change, you no longer need to take care in tests that use auxiliary functions not to fail in the main function if the auxiliary function has failed. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
934fe1ef18
commit
d4c9fd1e0a
@ -165,6 +165,12 @@ test_info;
|
||||
|
||||
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.test = test;
|
||||
test_info.line_no = line_no;
|
||||
|
Loading…
Reference in New Issue
Block a user