diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 8747660391..41d7009296 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -10381,12 +10381,8 @@ void copy_input(int src_len, int dst_len, psa_status_t exp_status) uint8_t *dst_buffer = NULL; psa_status_t status; - /* Special case, when src_len or dst_len is 0, we want to test on a real - * buffer. Calling TEST_CALLOC with 0 will return NULL. */ - size_t src_calloc_len = (src_len == 0 ? 1 : src_len); - size_t dst_calloc_len = (dst_len == 0 ? 1 : dst_len); - TEST_CALLOC(src_buffer, src_calloc_len); - TEST_CALLOC(dst_buffer, dst_calloc_len); + TEST_CALLOC_NONNULL(src_buffer, src_len); + TEST_CALLOC_NONNULL(dst_buffer, dst_len); fill_buffer_pattern(src_buffer, src_len); @@ -10411,12 +10407,8 @@ void copy_output(int src_len, int dst_len, psa_status_t exp_status) uint8_t *dst_buffer = NULL; psa_status_t status; - /* Special case, when src_len or dst_len is 0, we want to test on a real - * buffer. Calling TEST_CALLOC with 0 will return NULL. */ - size_t src_calloc_len = (src_len == 0 ? 1 : src_len); - size_t dst_calloc_len = (dst_len == 0 ? 1 : dst_len); - TEST_CALLOC(src_buffer, src_calloc_len); - TEST_CALLOC(dst_buffer, dst_calloc_len); + TEST_CALLOC_NONNULL(src_buffer, src_len); + TEST_CALLOC_NONNULL(dst_buffer, dst_len); fill_buffer_pattern(src_buffer, src_len);