Disable strerror in test programs

This commit disables printing strerror messages in test programs. This
is due to moving the functions back to Mbed TLS and wanting to keep
dependencies of programs small. The code has not been removed but simply
commented out for when these functions are reimplemented.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit is contained in:
Harry Ramsey 2024-10-16 14:08:19 +01:00
parent 8b4b15269a
commit 9c66405098
8 changed files with 24 additions and 16 deletions

View File

@ -453,8 +453,9 @@ exit:
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" - %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" - %s\n", buf); */
#else
mbedtls_printf("\n");
#endif

View File

@ -347,8 +347,9 @@ cleanup:
#if defined(MBEDTLS_ERROR_C)
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf); */
}
#endif

View File

@ -469,8 +469,9 @@ exit:
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" - %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, buf, sizeof(buf));
mbedtls_printf(" - %s\n", buf); */
#else
mbedtls_printf("\n");
#endif

View File

@ -142,8 +142,9 @@ exit:
#if defined(MBEDTLS_ERROR_C)
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf); */
}
#endif

View File

@ -143,8 +143,9 @@ exit:
#if defined(MBEDTLS_ERROR_C)
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf); */
}
#endif

View File

@ -143,8 +143,9 @@ exit:
#if defined(MBEDTLS_ERROR_C)
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf); */
}
#endif

View File

@ -117,8 +117,9 @@ exit:
#if defined(MBEDTLS_ERROR_C)
if (exit_code != MBEDTLS_EXIT_SUCCESS) {
mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, (char *) buf, sizeof(buf));
mbedtls_printf(" ! Last error was: %s\n", buf); */
}
#endif

View File

@ -117,8 +117,9 @@ static unsigned long mbedtls_timing_hardclock(void);
#if defined(MBEDTLS_ERROR_C)
#define PRINT_ERROR \
mbedtls_strerror(ret, (char *) tmp, sizeof(tmp)); \
mbedtls_printf("FAILED: %s\n", tmp);
mbedtls_printf("Error code: %d", ret);
/* mbedtls_strerror(ret, (char *) tmp, sizeof(tmp)); \
mbedtls_printf("FAILED: %s\n", tmp); */
#else
#define PRINT_ERROR \
mbedtls_printf("FAILED: -0x%04x\n", (unsigned int) -ret);