6#define FW_ASSERT_DFL_MSG_LEN 256
8#if FW_ASSERT_LEVEL == FW_NO_ASSERT
12#if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
13#define fileIdFs "Assert file ID 0x%08" PRIx32 ": Line: %" PRI_PlatformUIntType
15#define fileIdFs "Assert file \"%s\": Line: %" PRI_PlatformUIntType
20 void defaultPrintAssert(
const CHAR* msg) {
21 (void)fprintf(stderr,
"%s\n", msg);
41 (void) snprintf(destBuffer, buffSize, fileIdFs, file, lineNo);
82 arg1, arg2, arg3, arg4);
93 arg1, arg2, arg3, arg4, arg5
105 arg1, arg2, arg3, arg4, arg5, arg6
113 destBuffer[buffSize-1] = 0;
117 void AssertHook::printAssert(
const CHAR* msg) {
118 defaultPrintAssert(msg);
121 void AssertHook::reportAssert
150 this->printAssert(destBuffer);
153 void AssertHook::doAssert() {
157 STATIC AssertHook* s_assertHook =
nullptr;
159 void AssertHook::registerHook() {
160 this->previousHook = s_assertHook;
164 void AssertHook::deregisterHook() {
165 s_assertHook = this->previousHook;
169 if (
nullptr == s_assertHook) {
176 assertMsg,
sizeof(assertMsg));
178 defaultPrintAssert(assertMsg);
182 s_assertHook->reportAssert(
187 s_assertHook->doAssert();
194 if (
nullptr == s_assertHook) {
201 assertMsg,
sizeof(assertMsg));
203 defaultPrintAssert(assertMsg);
207 s_assertHook->reportAssert(
212 s_assertHook->doAssert();
220 if (
nullptr == s_assertHook) {
227 assertMsg,
sizeof(assertMsg));
228 defaultPrintAssert(assertMsg);
232 s_assertHook->reportAssert(
237 s_assertHook->doAssert();
246 if (
nullptr == s_assertHook) {
252 arg1,arg2,arg3,0,0,0,
253 assertMsg,
sizeof(assertMsg));
254 defaultPrintAssert(assertMsg);
258 s_assertHook->reportAssert(
262 arg1,arg2,arg3,0,0,0);
263 s_assertHook->doAssert();
273 if (
nullptr == s_assertHook) {
279 arg1,arg2,arg3,arg4,0,0,
280 assertMsg,
sizeof(assertMsg));
281 defaultPrintAssert(assertMsg);
285 s_assertHook->reportAssert(
289 arg1,arg2,arg3,arg4,0,0);
290 s_assertHook->doAssert();
301 if (
nullptr == s_assertHook) {
307 arg1,arg2,arg3,arg4,arg5,0,
308 assertMsg,
sizeof(assertMsg));
309 defaultPrintAssert(assertMsg);
313 s_assertHook->reportAssert(
317 arg1,arg2,arg3,arg4,arg5,0);
318 s_assertHook->doAssert();
330 if (
nullptr == s_assertHook) {
336 arg1,arg2,arg3,arg4,arg5,arg6,
337 assertMsg,
sizeof(assertMsg));
338 defaultPrintAssert(assertMsg);
342 s_assertHook->reportAssert(
346 arg1,arg2,arg3,arg4,arg5,arg6);
347 s_assertHook->doAssert();
359 if (
nullptr == Fw::s_assertHook) {
366 assertMsg,
sizeof(assertMsg));
369 Fw::s_assertHook->reportAssert(
374 Fw::s_assertHook->doAssert();
#define FW_ASSERT_DFL_MSG_LEN
#define STATIC
static for non unit-test code
PlatformIntType NATIVE_INT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
PlatformAssertArgType FwAssertArgType
#define PRI_FwAssertArgType
#define FW_ASSERT_DFL_MSG_LEN
Maximum assert message length when using the default assert handler.
C++-compatible configuration header for fprime configuration.
void defaultReportAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo, NATIVE_UINT_TYPE numArgs, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, FwAssertArgType arg6, CHAR *destBuffer, NATIVE_INT_TYPE buffSize)