aboutsummaryrefslogtreecommitdiff
path: root/tests/suites/helpers.function
diff options
context:
space:
mode:
authorGilles Peskine <Gilles.Peskine@arm.com>2020-01-21 16:20:04 +0100
committerGilles Peskine <Gilles.Peskine@arm.com>2020-01-21 16:20:04 +0100
commit292672eb1246f3d0a93b456b2ed6090ff13d4020 (patch)
tree8cc3357a7c57e1e2574788c52f10967d10aabd51 /tests/suites/helpers.function
parent42a1acfd0e100035f71e7112935a115136d6b90c (diff)
downloadmbedtls-292672eb1246f3d0a93b456b2ed6090ff13d4020.zip
mbedtls-292672eb1246f3d0a93b456b2ed6090ff13d4020.tar.gz
mbedtls-292672eb1246f3d0a93b456b2ed6090ff13d4020.tar.bz2
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.
Diffstat (limited to 'tests/suites/helpers.function')
-rw-r--r--tests/suites/helpers.function8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function
index 0cce463..3e68c06 100644
--- a/tests/suites/helpers.function
+++ b/tests/suites/helpers.function
@@ -158,11 +158,10 @@ typedef enum
} \
while( 0 )
-/** Allocate memory dynamically. Exit the test if this fails, but do
- * not mark the test as failed.
+/** Allocate memory dynamically. If the allocation fails, skip the test case.
*
* 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 ) \
do \
@@ -172,8 +171,7 @@ typedef enum
{ \
( pointer ) = mbedtls_calloc( sizeof( *( pointer ) ), \
( length ) ); \
- if( ( pointer ) == NULL ) \
- goto exit; \
+ TEST_ASSUME( ( pointer ) != NULL ); \
} \
} \
while( 0 )