Skip to content

Commit 83e6b39

Browse files
Don't define calloc_self_test if it wouldn't be used
1 parent 983afa7 commit 83e6b39

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

programs/test/selftest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#endif
8080

8181

82+
#if defined MBEDTLS_SELF_TEST
8283
/* Sanity check for malloc. This is not expected to fail, and is rather
8384
* intended to display potentially useful information about the platform,
8485
* in particular the behavior of malloc(0). */
@@ -175,6 +176,7 @@ static int calloc_self_test( int verbose )
175176
mbedtls_free( overflow );
176177
return( failures );
177178
}
179+
#endif /* MBEDTLS_SELF_TEST */
178180

179181
static int test_snprintf( size_t n, const char ref_buf[10], int ref_ret )
180182
{

0 commit comments

Comments
 (0)