For tests, rename ASSERT_ALLOC() to TEST_CALLOC_OR_FAIL()

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove 2023-07-20 16:48:18 +01:00
parent 65cd8519f7
commit f9ffd11e7a
40 changed files with 347 additions and 347 deletions

View file

@ -123,18 +123,18 @@
* This expression may be evaluated multiple times.
*
*/
#define ASSERT_ALLOC(pointer, length) \
do \
{ \
TEST_ASSERT((pointer) == NULL); \
if ((length) != 0) \
{ \
(pointer) = mbedtls_calloc(sizeof(*(pointer)), \
#define TEST_CALLOC_OR_FAIL(pointer, length) \
do { \
TEST_ASSERT((pointer) == NULL); \
if ((length) != 0) { \
(pointer) = mbedtls_calloc(sizeof(*(pointer)), \
(length)); \
TEST_ASSERT((pointer) != NULL); \
} \
} \
while (0)
TEST_ASSERT((pointer) != NULL); \
} \
} while (0)
/* For backwards compatibility */
#define ASSERT_ALLOC(pointer, length) TEST_CALLOC_OR_FAIL(pointer, length)
/** Allocate memory dynamically. If the allocation fails, skip the test case.
*