1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

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

@@ -32,7 +32,7 @@ void printf_int(char *format, /* any format expecting one int argument, e.g. "%d
const size_t n = strlen(result);
/* Nominal case: buffer just large enough */
ASSERT_ALLOC(output, n + 1);
TEST_CALLOC_OR_FAIL(output, n + 1);
TEST_EQUAL(n, mbedtls_snprintf(output, n + 1, format, x));
TEST_BUFFERS_EQUAL(result, n + 1, output, n + 1);
mbedtls_free(output);
@@ -53,11 +53,11 @@ void printf_long_max(const char *format, /* "%lx" or longer type */
const size_t n = sizeof(value) * 2;
/* We assume that long has no padding bits! */
ASSERT_ALLOC(expected, n + 1);
TEST_CALLOC_OR_FAIL(expected, n + 1);
expected[0] = '7';
memset(expected + 1, 'f', sizeof(value) * 2 - 1);
ASSERT_ALLOC(output, n + 1);
TEST_CALLOC_OR_FAIL(output, n + 1);
TEST_EQUAL(n, mbedtls_snprintf(output, n + 1, format, value));
TEST_BUFFERS_EQUAL(expected, n + 1, output, n + 1);
mbedtls_free(output);
@@ -77,7 +77,7 @@ void printf_char2(char *format, /* "%c%c" */
const size_t n = strlen(result);
/* Nominal case: buffer just large enough */
ASSERT_ALLOC(output, n + 1);
TEST_CALLOC_OR_FAIL(output, n + 1);
TEST_EQUAL(n, mbedtls_snprintf(output, n + 1, format, arg1, arg2));
TEST_BUFFERS_EQUAL(result, n + 1, output, n + 1);
mbedtls_free(output);