Skip to content

Allow unit tests to be compiled with -fno-exception #15214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions platform/tests/UNITTESTS/doubles/mbed_assert_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down