Lines Matching refs:pointer
107 * You must set \p pointer to \c NULL before calling this macro and
108 * put `mbedtls_free(pointer)` in the test's cleanup code.
110 * If \p item_count is zero, the resulting \p pointer will be \c NULL.
117 * \param pointer An lvalue where the address of the allocated buffer
124 #define TEST_CALLOC(pointer, item_count) \
126 TEST_ASSERT((pointer) == NULL); \
128 (pointer) = mbedtls_calloc((item_count), \
129 sizeof(*(pointer))); \
130 TEST_ASSERT((pointer) != NULL); \
137 * You must set \p pointer to \c NULL before calling this macro and
138 * put `mbedtls_free(pointer)` in the test's cleanup code.
140 * If \p item_count is zero, the resulting \p pointer will not be \c NULL.
145 * \param pointer An lvalue where the address of the allocated buffer
153 * non-NULL pointer.
155 #define TEST_CALLOC_NONNULL(pointer, item_count) \
157 TEST_ASSERT((pointer) == NULL); \
158 (pointer) = mbedtls_calloc((item_count), \
159 sizeof(*(pointer))); \
160 if (((pointer) == NULL) && ((item_count) == 0)) { \
161 (pointer) = mbedtls_calloc(1, 1); \
163 TEST_ASSERT((pointer) != NULL); \
167 #define ASSERT_ALLOC(pointer, item_count) TEST_CALLOC(pointer, item_count)
174 #define TEST_CALLOC_OR_SKIP(pointer, item_count) \
176 TEST_ASSERT((pointer) == NULL); \
178 (pointer) = mbedtls_calloc((item_count), \
179 sizeof(*(pointer))); \
180 TEST_ASSUME((pointer) != NULL); \
185 #define ASSERT_ALLOC_WEAK(pointer, item_count) TEST_CALLOC_OR_SKIP(pointer, item_count)