Allow unit tests to be compiled with -fno-exception

pull/15214/head
Ladislas de Toldi 2022-01-28 10:33:38 +01:00
parent 4095c65e31
commit 568ffbf22a
No known key found for this signature in database
GPG Key ID: C5241848279CD797
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,