Skip to content

Commit

Permalink
Fix #780, Hex output for return checking ASSERTs
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Jan 22, 2021
1 parent c7363c8 commit c7e81b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fsw/cfe-core/unit-test/ut_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,21 +710,21 @@ void UT_AddSubTest(void (*Test)(void), void (*Setup)(void), void (*Teardown)(voi

void UT_SETUP_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet)
{
UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TSF, FileName, LineNum, "%s - Setup - %s returned %ld",
UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TSF, FileName, LineNum, "%s - Setup - %s returned 0x%lx",
TestName, FnName, (long int)FnRet);
}

void UT_ASSERT_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet)
{
UtAssertEx(FnRet == CFE_SUCCESS, UtAssert_GetContext(), FileName, LineNum, "%s - %s returned %ld, expected CFE_SUCCESS",
UtAssertEx(FnRet == CFE_SUCCESS, UtAssert_GetContext(), FileName, LineNum, "%s - %s returned 0x%lx, expected CFE_SUCCESS",
TestName, FnName, (long int)FnRet);
}

void UT_ASSERT_EQ_impl(const char *FileName, int LineNum,
const char *FnName, int32 FnRet, const char *ExpName, int32 Exp)
{
UtAssertEx(FnRet == Exp, UtAssert_GetContext(), FileName, LineNum, "%s - value %ld, expected %s[%ld]",
FnName, (long)FnRet, ExpName, (long)Exp);
UtAssertEx(FnRet == Exp, UtAssert_GetContext(), FileName, LineNum, "%s - value %ld 0x%lx, expected %s[%ld 0x%lx]",
FnName, (long)FnRet, (long)FnRet, ExpName, (long)Exp, (long)Exp);
}

void UT_ASSERT_TRUE_impl(const char *FileName, int LineNum, const char *TestName,
Expand All @@ -750,7 +750,7 @@ void UT_EVTSENT_impl(const char *FileName, int LineNum, const char *TestName, co

void UT_TEARDOWN_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet)
{
UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TTF, FileName, LineNum, "%s - Teardown failed (%s returned %ld)",
UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TTF, FileName, LineNum, "%s - Teardown failed (%s returned 0x%lx)",
TestName, FnName, (long int)FnRet);
}

0 comments on commit c7e81b4

Please sign in to comment.