Skip to content

Commit 311d38b

Browse files
committed
Tests: RTOS: RtosTimer: Fix tests on debug profile
Redefine error() as noop to fix tests being aborted when compiled with -DMBED_TRAP_ERRORS_ENABLED=1.
1 parent 33e38cc commit 311d38b

File tree

1 file changed

+13
-0
lines changed
  • TESTS/mbedmicro-rtos-mbed/rtostimer

1 file changed

+13
-0
lines changed

TESTS/mbedmicro-rtos-mbed/rtostimer/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ void timer_callback(void const *arg)
3636
sem->release();
3737
}
3838

39+
/* In order to successfully run this test suite when compiled with --profile=debug
40+
* error() has to be redefined as noop.
41+
*
42+
* RtosTimer calls RTX API which uses Event Recorder functionality. When compiled
43+
* with MBED_TRAP_ERRORS_ENABLED=1 (set in debug profile) EvrRtxTimerError() calls error()
44+
* which aborts test program.
45+
*/
46+
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED
47+
void error(const char* format, ...) {
48+
(void) format;
49+
}
50+
#endif
51+
3952
/** Test one-shot not restarted when elapsed
4053
*
4154
* Given a one-shot timer

0 commit comments

Comments
 (0)