mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-09-01 05:01:58 +03:00
If ASSERT_ALLOC_WEAK fails, mark the test as skipped, not passed
This was the intended behavior of ASSERT_ALLOC_WEAK all along, but skipping was not implemented yet when ASSERT_ALLOC_WEAK was introduced.
This commit is contained in:
@@ -158,11 +158,10 @@ typedef enum
|
|||||||
} \
|
} \
|
||||||
while( 0 )
|
while( 0 )
|
||||||
|
|
||||||
/** Allocate memory dynamically. Exit the test if this fails, but do
|
/** Allocate memory dynamically. If the allocation fails, skip the test case.
|
||||||
* not mark the test as failed.
|
|
||||||
*
|
*
|
||||||
* This macro behaves like #ASSERT_ALLOC, except that if the allocation
|
* This macro behaves like #ASSERT_ALLOC, except that if the allocation
|
||||||
* fails, it jumps to the \c exit label without calling test_fail().
|
* fails, it marks the test as skipped rather than failed.
|
||||||
*/
|
*/
|
||||||
#define ASSERT_ALLOC_WEAK( pointer, length ) \
|
#define ASSERT_ALLOC_WEAK( pointer, length ) \
|
||||||
do \
|
do \
|
||||||
@@ -172,8 +171,7 @@ typedef enum
|
|||||||
{ \
|
{ \
|
||||||
( pointer ) = mbedtls_calloc( sizeof( *( pointer ) ), \
|
( pointer ) = mbedtls_calloc( sizeof( *( pointer ) ), \
|
||||||
( length ) ); \
|
( length ) ); \
|
||||||
if( ( pointer ) == NULL ) \
|
TEST_ASSUME( ( pointer ) != NULL ); \
|
||||||
goto exit; \
|
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
while( 0 )
|
while( 0 )
|
||||||
|
Reference in New Issue
Block a user