Skip to content

Commit 6722d8c

Browse files
author
Seppo Takalo
authored
Merge pull request #11132 from kivaisan/fix_mbed_assert_for_unittests
Fix MBED_ASSERT for UTs
2 parents 417a9fe + 882c21b commit 6722d8c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

UNITTESTS/target_h/platform/mbed_assert.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ extern "C" {
3939
* @param file File where assertation failed.
4040
* @param line Failing assertation line number.
4141
*/
42-
MBED_NORETURN void mbed_assert_internal(const char *expr, const char *file, int line);
42+
// mbed_assert_internal UT stub only prints an assert trace and returns, so therefore
43+
// MBED_NORETURN must not be defined for UTs.
44+
#ifndef UNITTEST
45+
MBED_NORETURN
46+
#endif
47+
void mbed_assert_internal(const char *expr, const char *file, int line);
4348

4449
#ifdef __cplusplus
4550
}
@@ -132,4 +137,3 @@ do { \
132137
/**@}*/
133138

134139
/**@}*/
135-

0 commit comments

Comments
 (0)