diff --git a/library/platform_util.c b/library/platform_util.c index 4e97e4d1b8..3d5cb5baa4 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -131,3 +131,8 @@ struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt, #endif /* _WIN32 && !EFIX64 && !EFI32 */ } #endif /* MBEDTLS_HAVE_TIME_DATE && MBEDTLS_PLATFORM_GMTIME_R_ALT */ + +#if defined(MBEDTLS_TEST_HOOKS) +void (*mbedtls_test_hook_test_fail)( const char *, int, const char *); +#endif /* MBEDTLS_TEST_HOOKS */ + diff --git a/scripts/data_files/error.fmt b/scripts/data_files/error.fmt index fd491b858b..3be94bd2c4 100644 --- a/scripts/data_files/error.fmt +++ b/scripts/data_files/error.fmt @@ -164,7 +164,6 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen ) #if defined(MBEDTLS_TEST_HOOKS) void (*mbedtls_test_hook_error_add)( int, int, const char *, int ); -void (*mbedtls_test_hook_test_fail)( const char *, int, const char *); #endif #endif /* MBEDTLS_ERROR_C || MBEDTLS_ERROR_STRERROR_DUMMY */ diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index 3044bed35e..80c730b8a2 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -237,12 +237,11 @@ $platform_code */ int main( int argc, const char *argv[] ) { -#if defined(MBEDTLS_TEST_HOOKS) && defined (MBEDTLS_ERROR_C) - mbedtls_test_hook_error_add = &mbedtls_test_err_add_check; -#endif - #if defined(MBEDTLS_TEST_HOOKS) mbedtls_test_hook_test_fail = &mbedtls_test_fail; +#if defined(MBEDTLS_ERROR_C) + mbedtls_test_hook_error_add = &mbedtls_test_err_add_check; +#endif #endif int ret = mbedtls_test_platform_setup();