1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

For tests, rename ASSERT_ALLOC_WEAK() to TEST_CALLOC_OR_SKIP()

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove
2023-09-04 11:09:08 +01:00
parent 1357502bca
commit 20e27de0bb
4 changed files with 14 additions and 14 deletions

View File

@ -161,18 +161,18 @@
* This macro behaves like #TEST_CALLOC_OR_FAIL, except that if the allocation
* fails, it marks the test as skipped rather than failed.
*/
#define ASSERT_ALLOC_WEAK(pointer, length) \
do \
{ \
TEST_ASSERT((pointer) == NULL); \
if ((length) != 0) \
{ \
(pointer) = mbedtls_calloc(sizeof(*(pointer)), \
#define TEST_CALLOC_OR_SKIP(pointer, length) \
do { \
TEST_ASSERT((pointer) == NULL); \
if ((length) != 0) { \
(pointer) = mbedtls_calloc(sizeof(*(pointer)), \
(length)); \
TEST_ASSUME((pointer) != NULL); \
} \
} \
while (0)
TEST_ASSUME((pointer) != NULL); \
} \
} while (0)
/* For backwards compatibility */
#define ASSERT_ALLOC_WEAK(pointer, length) TEST_CALLOC_OR_SKIP(pointer, length)
/** Compare two buffers and fail the test case if they differ.
*