From c15b89b79449dc9f2ac11548f851644173f65d0d Mon Sep 17 00:00:00 2001 From: Simone Morettini Date: Sat, 13 May 2023 16:11:41 +0000 Subject: [PATCH 1/2] Made assert clickable (#1847) --- Fw/Logger/LogAssert.cpp | 2 +- Fw/Test/UnitTestAssert.cpp | 2 +- Fw/Types/Assert.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Fw/Logger/LogAssert.cpp b/Fw/Logger/LogAssert.cpp index 4eca41f9b0..c748a29db2 100644 --- a/Fw/Logger/LogAssert.cpp +++ b/Fw/Logger/LogAssert.cpp @@ -18,7 +18,7 @@ #define fileIdFs "Assert file ID %d: Line: %d " #define ASSERT_CAST static_cast #else -#define fileIdFs "Assert file \"%s\": Line: %d " +#define fileIdFs "Assert: \"%s:%d\"" #define ASSERT_CAST reinterpret_cast #endif diff --git a/Fw/Test/UnitTestAssert.cpp b/Fw/Test/UnitTestAssert.cpp index 77a0da89f4..e63021678b 100644 --- a/Fw/Test/UnitTestAssert.cpp +++ b/Fw/Test/UnitTestAssert.cpp @@ -45,7 +45,7 @@ namespace Test { #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT (void)fprintf(stderr,"Assert File: 0x%" PRIx32 ", Line: %" PRI_PlatformUIntType "\n", this->m_file, this->m_lineNo); #else - (void)fprintf(stderr,"Assert File: %s, Line: %" PRI_PlatformUIntType "\n", this->m_file.toChar(), this->m_lineNo); + (void)fprintf(stderr,"Assert: %s:%" PRI_PlatformUIntType "\n", this->m_file.toChar(), this->m_lineNo); #endif } diff --git a/Fw/Types/Assert.cpp b/Fw/Types/Assert.cpp index a9133ff793..f3577f71f4 100644 --- a/Fw/Types/Assert.cpp +++ b/Fw/Types/Assert.cpp @@ -12,7 +12,7 @@ #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT #define fileIdFs "Assert file ID 0x%08" PRIx32 ": Line: %" PRI_PlatformUIntType #else -#define fileIdFs "Assert file \"%s\": Line: %" PRI_PlatformUIntType +#define fileIdFs "Assert: \"%s:%" PRI_PlatformUIntType "\"" #endif namespace Fw { From 485c16a9676dd59ce2d835a81491f9766cd05637 Mon Sep 17 00:00:00 2001 From: Simone Morettini Date: Fri, 19 May 2023 13:20:06 +0000 Subject: [PATCH 2/2] Update asserts with file id --- Fw/Logger/LogAssert.cpp | 2 +- Fw/Test/UnitTestAssert.cpp | 2 +- Fw/Types/Assert.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Fw/Logger/LogAssert.cpp b/Fw/Logger/LogAssert.cpp index c748a29db2..b7ea746d97 100644 --- a/Fw/Logger/LogAssert.cpp +++ b/Fw/Logger/LogAssert.cpp @@ -15,7 +15,7 @@ #else #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT -#define fileIdFs "Assert file ID %d: Line: %d " +#define fileIdFs "Assert: %d:%d" #define ASSERT_CAST static_cast #else #define fileIdFs "Assert: \"%s:%d\"" diff --git a/Fw/Test/UnitTestAssert.cpp b/Fw/Test/UnitTestAssert.cpp index e63021678b..3e651f8ad6 100644 --- a/Fw/Test/UnitTestAssert.cpp +++ b/Fw/Test/UnitTestAssert.cpp @@ -43,7 +43,7 @@ namespace Test { void UnitTestAssert::doAssert() { this->m_assertFailed = true; #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT - (void)fprintf(stderr,"Assert File: 0x%" PRIx32 ", Line: %" PRI_PlatformUIntType "\n", this->m_file, this->m_lineNo); + (void)fprintf(stderr,"Assert: 0x%" PRIx32 ":%" PRI_PlatformUIntType "\n", this->m_file, this->m_lineNo); #else (void)fprintf(stderr,"Assert: %s:%" PRI_PlatformUIntType "\n", this->m_file.toChar(), this->m_lineNo); #endif diff --git a/Fw/Types/Assert.cpp b/Fw/Types/Assert.cpp index f3577f71f4..68cd74454a 100644 --- a/Fw/Types/Assert.cpp +++ b/Fw/Types/Assert.cpp @@ -10,7 +10,7 @@ #else #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT -#define fileIdFs "Assert file ID 0x%08" PRIx32 ": Line: %" PRI_PlatformUIntType +#define fileIdFs "Assert: 0x%08" PRIx32 ":%" PRI_PlatformUIntType #else #define fileIdFs "Assert: \"%s:%" PRI_PlatformUIntType "\"" #endif