Merge pull request #15214 from ladislas/ladislas/bugfix/mbed_assert_no_throw

Allow unit tests to be compiled with -fno-exception
pull/15219/head
Martin Kojtal 2022-01-31 10:24:51 +01:00 committed by GitHub
commit 9e2c9498cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -26,7 +26,11 @@ extern "C" void mbed_assert_internal(const char *expr, const char *file, int lin
{
fprintf(stderr, "mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
if (mbed_assert_throw_errors) {
#ifdef __EXCEPTIONS
throw 1;
#else
FAIL();
#endif
}
/* Ensure we fail the unit test if the Mbed assertion fails. Without this,