diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 06e97b54a..4890a3a7e 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -507,6 +507,25 @@ bool UT_EventIsInHistory(uint16 EventIDToSearchFor); ******************************************************************************/ uint32 UT_SyslogIsInHistory(const char *LogMsgToSearchFor); +/*****************************************************************************/ +/** +** \brief Checks if the code under test invoked CFE_ES_WriteToSysLog with the specified format string +** +** \par Description +** Confirms that the code followed a path which invoked a specific syslog call +** +** \par Assumptions, External Events, and Notes: +** SysLog messages are typically not relevant to requirements/correctness, but this +** is potentially useful to confirm a specific code path was followed. +** +******************************************************************************/ +#define CFE_UtAssert_SyslogIsInHistory(str) \ + do \ + { \ + const char *format = str; \ + UtAssert_True(UT_SyslogIsInHistory(format), "%s syslog generated (%s)", #str, format); \ + } while (0) + /*****************************************************************************/ /** ** \brief Search the printf history for a specified message template @@ -522,6 +541,25 @@ uint32 UT_SyslogIsInHistory(const char *LogMsgToSearchFor); ******************************************************************************/ uint32 UT_PrintfIsInHistory(const char *MsgToSearchFor); +/*****************************************************************************/ +/** +** \brief Checks if the code under test invoked OS_printf with the specified format string +** +** \par Description +** Confirms that the code followed a path which invoked a specific OS_printf call +** +** \par Assumptions, External Events, and Notes: +** OS_printf messages are typically not relevant to requirements/correctness, but this +** is potentially useful to confirm a specific code path was followed. +** +******************************************************************************/ +#define CFE_UtAssert_PrintfIsInHistory(str) \ + do \ + { \ + const char *format = str; \ + UtAssert_True(UT_PrintfIsInHistory(format), "%s printf generated (%s)", #str, format); \ + } while (0) + /*****************************************************************************/ /** ** \brief Return number of events issued @@ -596,9 +634,6 @@ CFE_ES_ResetData_t *UT_GetResetDataPtr(void); void UT_AddSubTest(void (*Test)(void), void (*Setup)(void), void (*Teardown)(void), const char *GroupName, const char *TestName); -/** \brief Function to be called by the SETUP() macro */ -void UT_SETUP_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet); - /*****************************************************************************/ /** ** \brief Checks the successful execution of a setup function. @@ -609,15 +644,19 @@ void UT_SETUP_impl(const char *FileName, int LineNum, const char *TestName, cons ** result in a text message and the test being considered failed. ** ** \par Assumptions, External Events, and Notes: -** None -** -** \sa #START, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT, #TEARDOWN +** To keep logs clean, this only generates a log message if it fails ** ******************************************************************************/ -#define SETUP(FN) (UT_SETUP_impl(__FILE__, __LINE__, __func__, (#FN), (FN))) - -/** \brief Function to be called by the ASSERT() macro */ -void UT_ASSERT_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet); +#define CFE_UtAssert_SETUP(FN) \ + do \ + { \ + CFE_Status_t Status = FN; \ + if (Status < CFE_SUCCESS) \ + { \ + UtAssertEx(false, UTASSERT_CASETYPE_TSF, __FILE__, __LINE__, "%s - Setup failed, returned 0x%lx", #FN, \ + (long int)Status); \ + } \ + } while (0) /*****************************************************************************/ /** @@ -631,110 +670,138 @@ void UT_ASSERT_impl(const char *FileName, int LineNum, const char *TestName, con ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT_EQ, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT, #TEARDOWN -** ******************************************************************************/ -#define ASSERT(FN) (UT_ASSERT_impl(__FILE__, __LINE__, __func__, (#FN), (FN))) - -/** \brief Function to be called by the ASSERT_EQ() macro */ -void UT_ASSERT_EQ_impl(const char *FileName, int LineNum, const char *FnName, int32 FnRet, const char *ExpName, - int32 Exp); +#define CFE_UtAssert_SUCCESS(FN) UtAssert_INT32_EQ(FN, CFE_SUCCESS) /*****************************************************************************/ /** -** \brief Asserts the expected execution of the function being tested. +** \brief Ensures that the test generated the expected number of events. ** ** \par Description -** The core of each unit test is the execution of the function being tested. -** This function and macro should be used to test the execution of the function -** and comparing the return status against the expected return status specified, -** when the return status expected is not CFE_SUCCESS. +** Most tests will generate a number of events, and the number generated +** should be checked via this macro. If the number of events is different, +** the test is considered to have failed and an error is reported. ** ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT, #TEARDOWN -** ******************************************************************************/ -#define ASSERT_EQ(FN, EXP) (UT_ASSERT_EQ_impl(__FILE__, __LINE__, (#FN), (FN), (#EXP), (EXP))) - -/** \brief Function to be called by the ASSERT_EQ() macro */ -void UT_ASSERT_TRUE_impl(const char *FileName, int LineNum, const char *TestName, const char *ExpName, bool Exp); +#define CFE_UtAssert_EventCount(EXP) \ + do \ + { \ + unsigned int Actual = UT_GetNumEventsSent(); \ + unsigned int Expected = EXP; \ + UtAssertEx(Actual == Expected, UtAssert_GetContext(), __FILE__, __LINE__, \ + "%s - event count (sent %u, expected %u)", __func__, Actual, Expected); \ + } while (0) /*****************************************************************************/ /** -** \brief Asserts the expected execution of the function being tested. +** \brief Ensures that the code under test generated an expected event. ** ** \par Description -** The core of each unit test is the execution of the function being tested. -** This function and macro should be used to test the execution of the function -** and comparing the return status against the expected return status specified, -** when the return status expected is not CFE_SUCCESS. +** Most tests will generate a number of events, and this function and macro check whether an +** event was generated. If not, the test is considered to have failed and an error is reported. ** ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT, #TEARDOWN +** \sa #CFE_UtAssert_EventIsNotInHistory ** ******************************************************************************/ -#define ASSERT_TRUE(EXP) (UT_ASSERT_TRUE_impl(__FILE__, __LINE__, __func__, (#EXP), (EXP))) - -/** \brief Function to be called by the EVTCNT() macro */ -void UT_EVTCNT_impl(const char *FileName, int LineNum, const char *TestName, int32 CntExp); +#define CFE_UtAssert_EventIsInHistory(EVT) \ + do \ + { \ + unsigned int EventId = EVT; \ + UtAssertEx(UT_EventIsInHistory(EventId) != 0, UtAssert_GetContext(), __FILE__, __LINE__, \ + "%s - sent event %s [%u]", __func__, #EVT, EventId); \ + } while (0) /*****************************************************************************/ /** -** \brief Ensures that the test generated the expected number of events. +** \brief Ensures that the code under test did not generate an unexpected event. ** ** \par Description -** Most tests will generate a number of events, and the number generated -** should be checked via this macro. If the number of events is different, -** the test is considered to have failed and an error is reported. +** Most tests will generate a number of events, and this function and macro check whether an +** event was generated. This is the inverse of #CFE_UtAssert_EventIsInHistory, and asserts that the +** code under test did NOT generate the given event ID. ** ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTSENT, #REPORT, #TEARDOWN +** \sa #CFE_UtAssert_EventIsInHistory ** ******************************************************************************/ -#define EVTCNT(EXP) (UT_EVTCNT_impl(__FILE__, __LINE__, __func__, (EXP))) - -/** \brief Function to be called by the EVTSENT() macro */ -void UT_EVTSENT_impl(const char *FileName, int LineNum, const char *TestName, const char *EvtName, int32 EvtId); +#define CFE_UtAssert_EventIsNotInHistory(EVT) \ + do \ + { \ + unsigned int EventId = EVT; \ + UtAssertEx(UT_EventIsInHistory(EventId) == 0, UtAssert_GetContext(), __FILE__, __LINE__, \ + "%s - did not send event %s [%u]", __func__, #EVT, EventId); \ + } while (0) /*****************************************************************************/ /** -** \brief Ensures that the test generated the expected event. +** \brief Checks the successful execution of a teardown function. ** ** \par Description -** Most tests will generate a number of events, and this function and macro check whether an -** event was generated. If not, the test is considered to have failed and an error is reported. +** Many tests require a number of steps of setup to configure CFE such that the actual test +** can be performed, and undoing that configuration is the role of the teardown steps. Failure +** of any teardown steps result in a text message and the test being considered failed. ** ** \par Assumptions, External Events, and Notes: -** None -** -** \sa #START, #SETUP, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTCNT, #REPORT, #TEARDOWN +** To keep logs clean, this only generates a log message if it fails ** ******************************************************************************/ -#define EVTSENT(EVT) (UT_EVTSENT_impl(__FILE__, __LINE__, __func__, (#EVT), (EVT))) +#define CFE_UtAssert_TEARDOWN(FN) \ + do \ + { \ + CFE_Status_t Status = FN; \ + if (Status < CFE_SUCCESS) \ + { \ + UtAssertEx(false, UTASSERT_CASETYPE_TTF, __FILE__, __LINE__, "%s - Teardown failed, returned 0x%lx", #FN, \ + (long int)Status); \ + } \ + } while (0) -/** \brief Function to be called by the TEARDOWN() macro */ -void UT_TEARDOWN_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet); /*****************************************************************************/ /** -** \brief Checks the successful execution of a teardown function. +** \brief Macro for logging calls to a "void" function ** ** \par Description -** Many tests require a number of steps of setup to configure CFE such that the actual test -** can be performed, and undoing that configuration is the role of the teardown steps. Failure -** of any teardown steps result in a text message and the test being considered failed. +** A macro that invokes a function with no return value. This should be used when +** no actual condition/result to check for/assert on, but the call should still be +** logged to the output to record the fact that the function was invoked. ** ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT +******************************************************************************/ +#define CFE_UtAssert_VOIDCALL(func) \ + do \ + { \ + func; \ + UtAssert(true, #func, __FILE__, __LINE__); \ + } while (0) + +/*****************************************************************************/ +/** +** \brief Macro to check CFE resource ID for equality +** +** \par Description +** A macro that checks two resource ID values for equality. +** +** \par Assumptions, External Events, and Notes: +** The generic #UtAssert_UINT32_EQ check should not be used, as ID values +** and integers may not be interchangable with strict type checking. ** ******************************************************************************/ -#define TEARDOWN(FN) (UT_TEARDOWN_impl(__FILE__, __LINE__, __func__, (#FN), (FN))) +#define CFE_UtAssert_ResourceId_EQ(id1, id2) \ + do \ + { \ + unsigned long temp1 = CFE_RESOURCEID_TO_ULONG(id1); \ + unsigned long temp2 = CFE_RESOURCEID_TO_ULONG(id2); \ + UtAssert_True(temp1 == temp2, "ResourceID check %s (%lx) == %s (%lx)", #id1, temp1, #id2, temp2); \ + } while (0) #endif /* UT_SUPPORT_H */ diff --git a/modules/core_private/ut-stubs/src/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c index a8ddc15e3..1a3f8eec1 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -693,47 +693,3 @@ void UT_AddSubTest(void (*Test)(void), void (*Setup)(void), void (*Teardown)(voi UtTest_Add(Test, Setup, Teardown, strdup(CompleteTestName)); } - -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 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 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 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, const char *ExpName, bool Exp) -{ - UtAssertEx(Exp, UtAssert_GetContext(), FileName, LineNum, "%s - %s", TestName, ExpName); -} - -void UT_EVTCNT_impl(const char *FileName, int LineNum, const char *TestName, int32 CntExp) -{ - int32 CntSent = UT_GetNumEventsSent(); - - UtAssertEx(CntSent == CntExp, UtAssert_GetContext(), FileName, LineNum, "%s - event count (sent %ld, expected %ld)", - TestName, (long int)CntSent, (long int)CntExp); -} - -void UT_EVTSENT_impl(const char *FileName, int LineNum, const char *TestName, const char *EvtName, int32 EvtId) -{ - UtAssertEx(UT_EventIsInHistory(EvtId), UtAssert_GetContext(), FileName, LineNum, "%s - sent event %s [%ld]", - TestName, EvtName, (long int)EvtId); -} - -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 0x%lx)", TestName, FnName, (long int)FnRet); -} diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index f788e2704..d430fe261 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -1030,7 +1030,7 @@ void TestStartupErrorPaths(void) /* This prep is necessary so GetAppId works */ ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppType_CORE, NULL, &AppRecPtr, NULL); CFE_ES_Global.SystemState = CFE_ES_SystemState_CORE_READY; - ASSERT(CFE_ES_WaitForSystemState(CFE_ES_SystemState_CORE_READY, 0)); + CFE_UtAssert_SUCCESS(CFE_ES_WaitForSystemState(CFE_ES_SystemState_CORE_READY, 0)); } void TestApps(void) diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 188fba8d2..2ea0cef3e 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -245,8 +245,8 @@ void Test_Init(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &msgid, sizeof(msgid), false); UT_EVS_DoGenericCheckEvents(CFE_EVS_TaskMain, &UT_EVS_EventBuf); - ASSERT_TRUE(UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[8])); - ASSERT_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MSGID_EID); + CFE_UtAssert_SyslogIsInHistory(EVS_SYSLOG_MSGS[8]); + UtAssert_INT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MSGID_EID); /* Test early initialization with a get reset area failure */ UT_InitData(); @@ -716,13 +716,13 @@ void Test_Format(void) CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Short format check 1"); /* Note implementation initializes both short and long message */ - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 2); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 1); - ASSERT_TRUE(CFE_SB_MsgId_Equal(MsgData.MsgId, ShortFmtSnapshotData.MsgId)); - ASSERT_TRUE(!CFE_SB_MsgId_Equal(MsgData.MsgId, LongFmtSnapshotData.MsgId)); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 2); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 1); + UtAssert_INT32_EQ(CFE_SB_MsgId_Equal(MsgData.MsgId, ShortFmtSnapshotData.MsgId), true); + UtAssert_INT32_EQ(CFE_SB_MsgId_Equal(MsgData.MsgId, LongFmtSnapshotData.MsgId), false); /* Confirm the right message was sent */ - ASSERT_TRUE(MsgSend == MsgData.MsgPtr); + UtAssert_ADDRESS_EQ(MsgSend, MsgData.MsgPtr); /* Test set event format mode command using a valid command to set long * format, reports implicitly via event diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c index 3d56ec17f..f06ac24bd 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c @@ -61,8 +61,8 @@ void Test_MSG_Init_Ext(void) /* Get msgid version by checking if msgid sets "has secondary" field*/ memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); is_v1 = !hassec; /* Set up return */ @@ -71,66 +71,68 @@ void Test_MSG_Init_Ext(void) UtPrintf("Set to all F's, msgid value = 0"); memset(&msg, 0xFF, sizeof(msg)); msgidval_exp = 0; - ASSERT_EQ(CFE_MSG_Init(&msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(msg)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(&msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(msg)), CFE_SUCCESS); UT_DisplayPkt(&msg, 0); /* Default EDS version check */ - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); - ASSERT_EQ(edsver, CFE_PLATFORM_EDSVER); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); + UtAssert_INT32_EQ(edsver, CFE_PLATFORM_EDSVER); /* Default subsystem check */ - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); if (is_v1) - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); + UtAssert_INT32_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); else - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS & TEST_DEFAULT_SUBSYS_MASK); + UtAssert_INT32_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS & TEST_DEFAULT_SUBSYS_MASK); /* Default system check */ - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); - ASSERT_EQ(system, sc_id); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); + UtAssert_INT32_EQ(system, sc_id); /* Default endian check */ - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); #if (CFE_PLATFORM_ENDIAN == CCSDS_LITTLE_ENDIAN) - ASSERT_EQ(endian, CFE_MSG_Endian_Little); + UtAssert_INT32_EQ(endian, CFE_MSG_Endian_Little); #else - ASSERT_EQ(endian, CFE_MSG_Endian_Big); + UtAssert_INT32_EQ(endian, CFE_MSG_Endian_Big); #endif /* Confirm the rest of the fields not already explicitly checked */ - ASSERT_EQ(Test_MSG_Ext_NotZero(&msg) & ~(MSG_EDSVER_FLAG | MSG_ENDIAN_FLAG | MSG_SUBSYS_FLAG | MSG_SYSTEM_FLAG), 0); + UtAssert_INT32_EQ( + Test_MSG_Ext_NotZero(&msg) & ~(MSG_EDSVER_FLAG | MSG_ENDIAN_FLAG | MSG_SUBSYS_FLAG | MSG_SYSTEM_FLAG), 0); UtPrintf("Set to all 0, max msgid value"); memset(&msg, 0, sizeof(msg)); msgidval_exp = CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; - ASSERT_EQ(CFE_MSG_Init(&msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(msg)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(&msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(msg)), CFE_SUCCESS); UT_DisplayPkt(&msg, 0); /* Default EDS version check */ - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); - ASSERT_EQ(edsver, CFE_PLATFORM_EDSVER); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); + UtAssert_INT32_EQ(edsver, CFE_PLATFORM_EDSVER); /* Default system check */ - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); - ASSERT_EQ(system, sc_id); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); + UtAssert_INT32_EQ(system, sc_id); /* Default endian check */ - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); #if (CFE_PLATFORM_ENDIAN == CCSDS_LITTLE_ENDIAN) - ASSERT_EQ(endian, CFE_MSG_Endian_Little); + UtAssert_INT32_EQ(endian, CFE_MSG_Endian_Little); #else - ASSERT_EQ(endian, CFE_MSG_Endian_Big); + UtAssert_INT32_EQ(endian, CFE_MSG_Endian_Big); #endif /* Default subsystem check */ - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); if (is_v1) - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); + UtAssert_INT32_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); else - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS | ((msgidval_exp >> 8) & 0xFF)); + UtAssert_INT32_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS | ((msgidval_exp >> 8) & 0xFF)); /* Confirm the rest of the fields not already explicitly checked */ - ASSERT_EQ(Test_MSG_Ext_NotZero(&msg) & ~(MSG_EDSVER_FLAG | MSG_ENDIAN_FLAG | MSG_SUBSYS_FLAG | MSG_SYSTEM_FLAG), 0); + UtAssert_INT32_EQ( + Test_MSG_Ext_NotZero(&msg) & ~(MSG_EDSVER_FLAG | MSG_ENDIAN_FLAG | MSG_SUBSYS_FLAG | MSG_SYSTEM_FLAG), 0); } void Test_MSG_EDSVersion(void) @@ -142,33 +144,33 @@ void Test_MSG_EDSVersion(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEDSVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_EDSVER_MAX); - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetEDSVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetEDSVersion(&msg, TEST_EDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetEDSVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_EDSVER_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetEDSVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetEDSVersion(&msg, TEST_EDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetEDSVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_EDSVER_MAX); - ASSERT_EQ(CFE_MSG_SetEDSVersion(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_EDSVER_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetEDSVersion(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_EDSVER_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_EDSVER_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_EDSVER_FLAG); } } @@ -176,19 +178,19 @@ void Test_MSG_EDSVersion(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetEDSVersion(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetEDSVersion(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_EDSVER_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_EDSVER_FLAG); } } } @@ -202,33 +204,33 @@ void Test_MSG_Endian(void) UtPrintf("Bad parameter tests, Null pointers and invalid (CFE_MSG_Endian_Invalid, CFE_MSG_Endian_Little + 1"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEndian(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_GetEndian(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetEndian(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Invalid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Little + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetEndian(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Little + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Endian_Little); - ASSERT_EQ(CFE_MSG_SetEndian(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Endian_Little); + UtAssert_INT32_EQ(CFE_MSG_SetEndian(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_Endian_Little) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_ENDIAN_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_ENDIAN_FLAG); } } @@ -236,19 +238,19 @@ void Test_MSG_Endian(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Endian_Big); - ASSERT_EQ(CFE_MSG_SetEndian(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Endian_Big); + UtAssert_INT32_EQ(CFE_MSG_SetEndian(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_Endian_Big) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_ENDIAN_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_ENDIAN_FLAG); } } } @@ -262,33 +264,33 @@ void Test_MSG_PlaybackFlag(void) UtPrintf("Bad parameter tests, Null pointers and invalid (CFE_MSG_PlayFlag_Invalid, CFE_MSG_PlayFlag_Playback + 1"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetPlaybackFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Invalid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Playback + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetPlaybackFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Playback + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_PlayFlag_Playback); - ASSERT_EQ(CFE_MSG_SetPlaybackFlag(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_PlayFlag_Playback); + UtAssert_INT32_EQ(CFE_MSG_SetPlaybackFlag(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_PlayFlag_Playback) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_PBACK_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_PBACK_FLAG); } } @@ -296,19 +298,19 @@ void Test_MSG_PlaybackFlag(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_PlayFlag_Original); - ASSERT_EQ(CFE_MSG_SetPlaybackFlag(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_PlayFlag_Original); + UtAssert_INT32_EQ(CFE_MSG_SetPlaybackFlag(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_PlayFlag_Original) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_PBACK_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_PBACK_FLAG); } } } @@ -322,33 +324,33 @@ void Test_MSG_Subsystem(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSubsystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_SUBSYS_MAX); - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSubsystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetSubsystem(&msg, TEST_SUBSYS_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSubsystem(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_SUBSYS_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSubsystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSubsystem(&msg, TEST_SUBSYS_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSubsystem(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_SUBSYS_MAX); - ASSERT_EQ(CFE_MSG_SetSubsystem(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_SUBSYS_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetSubsystem(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_SUBSYS_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SUBSYS_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_SUBSYS_FLAG); } } @@ -356,19 +358,19 @@ void Test_MSG_Subsystem(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetSubsystem(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetSubsystem(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SUBSYS_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_SUBSYS_FLAG); } } } @@ -382,30 +384,30 @@ void Test_MSG_System(void) UtPrintf("Bad parameter tests, Null pointers"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_SYSTEM_MAX); - ASSERT_EQ(CFE_MSG_GetSystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_SYSTEM_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_SYSTEM_MAX); - ASSERT_EQ(CFE_MSG_SetSystem(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_SYSTEM_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetSystem(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_SYSTEM_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SYSTEM_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_SYSTEM_FLAG); } } @@ -413,19 +415,19 @@ void Test_MSG_System(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetSystem(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetSystem(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SYSTEM_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_SYSTEM_FLAG); } } } diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c index a9d786f2b..c6c22519e 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c @@ -50,37 +50,37 @@ void Test_MSG_Size(void) UtPrintf("Bad parameter tests, Null pointers and invalid (0, min valid - 1, max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSize(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_GetSize(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSize(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetSize(&msg, 0), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSize(&msg, TEST_MSG_SIZE_OFFSET - 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSize(&msg, 0xFFFF + TEST_MSG_SIZE_OFFSET + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSize(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetSize(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSize(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, TEST_MSG_SIZE_OFFSET - 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, 0xFFFF + TEST_MSG_SIZE_OFFSET + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0xFFFF + TEST_MSG_SIZE_OFFSET); - ASSERT_EQ(CFE_MSG_SetSize(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0xFFFF + TEST_MSG_SIZE_OFFSET); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0xFFFF + TEST_MSG_SIZE_OFFSET) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_LENGTH_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_LENGTH_FLAG); } } @@ -88,19 +88,19 @@ void Test_MSG_Size(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_MSG_SIZE_OFFSET); - ASSERT_EQ(CFE_MSG_SetSize(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_MSG_SIZE_OFFSET); + UtAssert_INT32_EQ(CFE_MSG_SetSize(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_MSG_SIZE_OFFSET) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_LENGTH_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_LENGTH_FLAG); } } } @@ -114,33 +114,33 @@ void Test_MSG_Type(void) UtPrintf("Bad parameter tests, Null pointers and invalid (CFE_MSG_Type_Invalid, CFE_MSG_Type_Tlm + 1"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetType(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_GetType(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetType(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Invalid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetType(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetType(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Cmd); - ASSERT_EQ(CFE_MSG_SetType(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_Type_Cmd) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_TYPE_FLAG); } } @@ -148,19 +148,19 @@ void Test_MSG_Type(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Tlm); - ASSERT_EQ(CFE_MSG_SetType(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Tlm); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_Type_Tlm) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); } } } @@ -174,33 +174,33 @@ void Test_MSG_HeaderVersion(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_CCSDSVER_MAX); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHeaderVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetHeaderVersion(&msg, TEST_CCSDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHeaderVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_CCSDSVER_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&msg, TEST_CCSDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_CCSDSVER_MAX); - ASSERT_EQ(CFE_MSG_SetHeaderVersion(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_CCSDSVER_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_CCSDSVER_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG); } } @@ -208,19 +208,19 @@ void Test_MSG_HeaderVersion(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetHeaderVersion(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetHeaderVersion(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_HDRVER_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_HDRVER_FLAG); } } } @@ -232,45 +232,45 @@ void Test_MSG_HasSecondaryHeader(void) UtPrintf("Bad parameter tests, Null pointers"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, true); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(NULL, false), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(NULL, false), CFE_MSG_BAD_ARGUMENT); UtPrintf("Set to all F's, true and false inputs"); memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, true); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, true); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, true); - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, false); - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, false); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_HASSEC_FLAG); UtPrintf("Set to all 0, true and false inputs"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, false); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, false); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, false); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, false); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, true); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); } void Test_MSG_ApId(void) @@ -282,33 +282,33 @@ void Test_MSG_ApId(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetApId(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_APID_MAX); - ASSERT_EQ(CFE_MSG_GetApId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetApId(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetApId(&msg, TEST_APID_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetApId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetApId(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_APID_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetApId(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetApId(&msg, TEST_APID_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetApId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_APID_MAX); - ASSERT_EQ(CFE_MSG_SetApId(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_APID_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetApId(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_APID_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_APID_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_APID_FLAG); } } @@ -316,19 +316,19 @@ void Test_MSG_ApId(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetApId(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetApId(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); } } } @@ -343,33 +343,33 @@ void Test_MSG_SegmentationFlag(void) UtPrintf("Bad parameter tests, Null pointers and invalid (*_Invalid, max valid + 1"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, CFE_MSG_SegFlag_Invalid); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSegmentationFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Invalid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Unsegmented + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, CFE_MSG_SegFlag_Invalid); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Invalid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Unsegmented + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_SegFlag_Unsegmented); - ASSERT_EQ(CFE_MSG_SetSegmentationFlag(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_SegFlag_Unsegmented); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_SegFlag_Unsegmented) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SEGMENT_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_SEGMENT_FLAG); } } @@ -377,19 +377,19 @@ void Test_MSG_SegmentationFlag(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_SegFlag_Continue); - ASSERT_EQ(CFE_MSG_SetSegmentationFlag(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_SegFlag_Continue); + UtAssert_INT32_EQ(CFE_MSG_SetSegmentationFlag(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == CFE_MSG_SegFlag_Continue) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SEGMENT_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_SEGMENT_FLAG); } } } @@ -406,33 +406,33 @@ void Test_MSG_SequenceCount(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1, max)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSequenceCount(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_SEQUENCE_MAX); - ASSERT_EQ(CFE_MSG_GetSequenceCount(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSequenceCount(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetSequenceCount(&msg, TEST_SEQUENCE_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetSequenceCount(&msg, maxsc), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_SEQUENCE_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&msg, TEST_SEQUENCE_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&msg, maxsc), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_SEQUENCE_MAX); - ASSERT_EQ(CFE_MSG_SetSequenceCount(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_SEQUENCE_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == TEST_SEQUENCE_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SEQUENCE_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_SEQUENCE_FLAG); } } @@ -440,27 +440,27 @@ void Test_MSG_SequenceCount(void) for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetSequenceCount(&msg, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetSequenceCount(&msg, input[i]), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); + UtAssert_INT32_EQ(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SEQUENCE_FLAG); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_SEQUENCE_FLAG); } } UtPrintf("Fully exercise getting next sequence count"); - ASSERT_EQ(CFE_MSG_GetNextSequenceCount(0), 1); - ASSERT_EQ(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX / 2), (TEST_SEQUENCE_MAX / 2) + 1); - ASSERT_EQ(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX), 0); - ASSERT_EQ(CFE_MSG_GetNextSequenceCount(maxsc), 0); + UtAssert_INT32_EQ(CFE_MSG_GetNextSequenceCount(0), 1); + UtAssert_INT32_EQ(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX / 2), (TEST_SEQUENCE_MAX / 2) + 1); + UtAssert_INT32_EQ(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX), 0); + UtAssert_INT32_EQ(CFE_MSG_GetNextSequenceCount(maxsc), 0); } /* diff --git a/modules/msg/ut-coverage/test_cfe_msg_checksum.c b/modules/msg/ut-coverage/test_cfe_msg_checksum.c index c092ecf41..499e1ea24 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_checksum.c +++ b/modules/msg/ut-coverage/test_cfe_msg_checksum.c @@ -43,48 +43,48 @@ void Test_MSG_Checksum(void) UtPrintf("Bad parameter tests, Null pointers"); memset(&cmd, 0, sizeof(cmd)); actual = true; - ASSERT_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_ValidateChecksum(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, true); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); UtPrintf("Bad message, no secondary header"); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual, true); - ASSERT_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); UtPrintf("Bad message, wrong type (telemetry)"); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual, true); - ASSERT_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); UtPrintf("Set to all F's, validate/generate/validate"); memset(&cmd, 0xFF, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, false); - ASSERT_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, false); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, true); - ASSERT_EQ(Test_MSG_NotF(msgptr), MSG_LENGTH_FLAG); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(Test_MSG_NotF(msgptr), MSG_LENGTH_FLAG); UtPrintf("Set to all 0 except secheader and type, validate/generate/validate"); memset(&cmd, 0, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, false); - ASSERT_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, false); + UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, true); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_LENGTH_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, true); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_LENGTH_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_fc.c b/modules/msg/ut-coverage/test_cfe_msg_fc.c index 8826b175a..3083fcb75 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_fc.c +++ b/modules/msg/ut-coverage/test_cfe_msg_fc.c @@ -49,57 +49,57 @@ void Test_MSG_FcnCode(void) UtPrintf("Bad parameter tests, Null pointers, invalid (max valid + 1, max)"); memset(&cmd, 0, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetFcnCode(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual, TEST_FCNCODE_MAX); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); - ASSERT_EQ(CFE_MSG_SetFcnCode(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, TEST_FCNCODE_MAX + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual, TEST_FCNCODE_MAX); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, TEST_FCNCODE_MAX + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); UtPrintf("Bad message, no secondary header"); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); UtPrintf("Bad message, wrong type (telemetry)"); memset(&cmd, 0, sizeof(cmd)); actual = TEST_FCNCODE_MAX; - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&cmd, 0xFF, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, TEST_FCNCODE_MAX); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, TEST_FCNCODE_MAX); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, input[i]), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); - ASSERT_EQ(Test_MSG_NotF(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); + UtAssert_INT32_EQ(Test_MSG_NotF(msgptr), 0); } UtPrintf("Set to all 0, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&cmd, 0, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, 0); - ASSERT_EQ(CFE_MSG_SetFcnCode(msgptr, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, 0); + UtAssert_INT32_EQ(CFE_MSG_SetFcnCode(msgptr, input[i]), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, input[i]); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG | MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, input[i]); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG | MSG_TYPE_FLAG); } } diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index 239b78fd2..95da8c16a 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -54,75 +54,75 @@ void Test_MSG_Init(void) bool is_v1; UtPrintf("Bad parameter tests, Null pointer, invalid size, invalid msgid"); - ASSERT_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), - CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(-1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), sizeof(cmd)), + CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(-1), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); UtPrintf("Set to all F's, msgid value = 0"); memset(&cmd, 0xFF, sizeof(cmd)); msgidval_exp = 0; - ASSERT_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd)), CFE_SUCCESS); UT_DisplayPkt(&cmd.Msg, 0); - ASSERT_EQ(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); - ASSERT_EQ(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); - ASSERT_EQ(size, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); - ASSERT_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); + UtAssert_INT32_EQ(size, sizeof(cmd)); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); + UtAssert_INT32_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); - ASSERT_EQ(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec), CFE_SUCCESS); /* A zero msgid will set hassec to false for v1 */ is_v1 = !hassec; if (!is_v1) { - ASSERT_EQ(apid, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); - ASSERT_EQ(hdrver, CFE_MISSION_CCSDSVER); + UtAssert_INT32_EQ(apid, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); + UtAssert_INT32_EQ(hdrver, CFE_MISSION_CCSDSVER); } else { - ASSERT_EQ(apid, 0); - ASSERT_EQ(hdrver, 0); + UtAssert_INT32_EQ(apid, 0); + UtAssert_INT32_EQ(hdrver, 0); } /* Confirm the rest of the fields not already explicitly checked */ - ASSERT_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~(MSG_APID_FLAG | MSG_HDRVER_FLAG | MSG_HASSEC_FLAG), - MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); + UtAssert_INT32_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~(MSG_APID_FLAG | MSG_HDRVER_FLAG | MSG_HASSEC_FLAG), + MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); UtPrintf("Set to all 0, max msgid value"); memset(&cmd, 0, sizeof(cmd)); msgidval_exp = CFE_PLATFORM_SB_HIGHEST_VALID_MSGID; - ASSERT_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(msgidval_exp), sizeof(cmd)), CFE_SUCCESS); UT_DisplayPkt(&cmd.Msg, 0); - ASSERT_EQ(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); - ASSERT_EQ(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); - ASSERT_EQ(size, sizeof(cmd)); - ASSERT_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); - ASSERT_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); - - ASSERT_EQ(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec), CFE_SUCCESS); - ASSERT_EQ(hassec, true); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); + UtAssert_INT32_EQ(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); + UtAssert_INT32_EQ(size, sizeof(cmd)); + UtAssert_INT32_EQ(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); + UtAssert_INT32_EQ(segflag, CFE_MSG_SegFlag_Unsegmented); + + UtAssert_INT32_EQ(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec), CFE_SUCCESS); + UtAssert_INT32_EQ(hassec, true); if (!is_v1) { - ASSERT_EQ(apid & TEST_DEFAULT_APID_MASK, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); - ASSERT_EQ(hdrver, CFE_MISSION_CCSDSVER); + UtAssert_INT32_EQ(apid & TEST_DEFAULT_APID_MASK, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); + UtAssert_INT32_EQ(hdrver, CFE_MISSION_CCSDSVER); } else { - ASSERT_EQ(apid, 0x7FF); - ASSERT_EQ(hdrver, 0); + UtAssert_INT32_EQ(apid, 0x7FF); + UtAssert_INT32_EQ(hdrver, 0); } - ASSERT_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~MSG_HDRVER_FLAG, - MSG_APID_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG | MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); + UtAssert_INT32_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~MSG_HDRVER_FLAG, + MSG_APID_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG | MSG_LENGTH_FLAG | MSG_SEGMENT_FLAG); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c index 817308ff0..a8bcf17a4 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c @@ -42,32 +42,32 @@ void Test_MSG_GetTypeFromMsgId(void) UtPrintf("Bad parameter tests, Null pointer"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetTypeFromMsgId(msgid, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(msgid, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set to all F's, test cmd and tlm"); memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Tlm); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Tlm); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Cmd); UtPrintf("Set to all 0, test cmd and tlm"); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Cmd); - ASSERT_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); - ASSERT_EQ(actual, CFE_MSG_Type_Tlm); + UtAssert_INT32_EQ(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual, CFE_MSG_Type_Tlm); } /* diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c index 3f7ddd646..93c64b833 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c @@ -43,62 +43,62 @@ void Test_MSG_MsgId(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 1); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 1); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set msg to all F's, set msgid to 0 and verify"); memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, 0), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, 0), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0); - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG | MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG | MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); UtPrintf("Set msg to all 0, set msgid to max and verify"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); - ASSERT_EQ(apid, TEST_MAX_APID); - ASSERT_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); - ASSERT_EQ(type, CFE_MSG_Type_Cmd); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); - ASSERT_EQ(hassec, true); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(apid, TEST_MAX_APID); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); + UtAssert_INT32_EQ(hassec, true); UtPrintf("Set ApId msgid bits only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(TEST_MAX_APID)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); - ASSERT_EQ(apid, TEST_MAX_APID); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(TEST_MAX_APID)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(apid, TEST_MAX_APID); UtPrintf("Set has secondary header bit only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0800)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); - ASSERT_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); - ASSERT_EQ(hassec, true); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0800)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); + UtAssert_INT32_EQ(hassec, true); UtPrintf("Set type msgid bit only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x1000)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); - ASSERT_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); - ASSERT_EQ(type, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x1000)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c index ff0ef54fc..65c45c58d 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c @@ -51,66 +51,67 @@ void Test_MSG_MsgId(void) UtPrintf("Bad parameter tests, Null pointers and invalid (max valid + 1)"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 1); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 1); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtPrintf("Set msg to all F's, set msgid to 0 and verify"); memset(&msg, 0xFF, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, 0), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0xFFFF); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, 0), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0); - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | local_subsys_flag); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); + UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | local_subsys_flag); UtPrintf("Set msg to all 0, set msgid to max and verify"); memset(&msg, 0, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), 0); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID), CFE_SUCCESS); UT_DisplayPkt(&msg, sizeof(msg)); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | local_subsys_flag); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); - ASSERT_EQ(apid, 0x7F); - ASSERT_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); - ASSERT_EQ(type, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | local_subsys_flag); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(apid, 0x7F); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); if (CFE_MSG_GetSubsystem(&msg, &subsystem) != CFE_MSG_NOT_IMPLEMENTED) { - ASSERT_EQ(subsystem, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID >> 8); + UtAssert_INT32_EQ(subsystem, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID >> 8); } UtPrintf("Set ApId msgid bits only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x007F)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); - ASSERT_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); - ASSERT_EQ(apid, 0x007F); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x007F)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + UtAssert_INT32_EQ(apid, 0x007F); UtPrintf("Set type msgid bit only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0080)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); - ASSERT_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); - ASSERT_EQ(type, CFE_MSG_Type_Cmd); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0080)), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); UtPrintf("Set subsystem msgid bits only and verify"); - ASSERT_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0xFF00 & CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); - ASSERT_EQ(Test_MSG_NotZero(&msg), local_subsys_flag); + UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0xFF00 & CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), + CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), local_subsys_flag); if (CFE_MSG_GetSubsystem(&msg, &subsystem) != CFE_MSG_NOT_IMPLEMENTED) { - ASSERT_EQ(subsystem, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID >> 8); + UtAssert_INT32_EQ(subsystem, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID >> 8); } } diff --git a/modules/msg/ut-coverage/test_cfe_msg_time.c b/modules/msg/ut-coverage/test_cfe_msg_time.c index 680b1e02e..8aae8862c 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_time.c +++ b/modules/msg/ut-coverage/test_cfe_msg_time.c @@ -44,55 +44,55 @@ void Test_MSG_Time(void) UtPrintf("Bad parameter tests, Null pointers, no secondary header"); memset(&tlm, 0, sizeof(tlm)); - ASSERT_EQ(CFE_MSG_GetMsgTime(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(actual.Seconds, 0xFFFFFFFF); - ASSERT_EQ(actual.Subseconds, 0xFFFFFFFF); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); - ASSERT_EQ(CFE_MSG_SetMsgTime(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); - ASSERT_EQ(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), 0); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual.Seconds, 0); - ASSERT_EQ(actual.Subseconds, 0); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(actual.Seconds, 0xFFFFFFFF); + UtAssert_INT32_EQ(actual.Subseconds, 0xFFFFFFFF); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual.Seconds, 0); + UtAssert_INT32_EQ(actual.Subseconds, 0); UtPrintf("Bad message, wrong type (command)"); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - ASSERT_EQ(actual.Seconds, 0); - ASSERT_EQ(actual.Subseconds, 0); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + UtAssert_INT32_EQ(actual.Seconds, 0); + UtAssert_INT32_EQ(actual.Subseconds, 0); UtPrintf("Set to all F's, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&tlm, 0xFF, sizeof(tlm)); - ASSERT_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual.Seconds, 0xFFFFFFFF); - ASSERT_EQ(actual.Subseconds, 0xFFFF0000); - ASSERT_EQ(CFE_MSG_SetMsgTime(msgptr, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual.Seconds, 0xFFFFFFFF); + UtAssert_INT32_EQ(actual.Subseconds, 0xFFFF0000); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(msgptr, input[i]), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(tlm)); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual.Seconds, input[i].Seconds); - ASSERT_EQ(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); - ASSERT_EQ(Test_MSG_NotF(msgptr), MSG_TYPE_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual.Seconds, input[i].Seconds); + UtAssert_INT32_EQ(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); + UtAssert_INT32_EQ(Test_MSG_NotF(msgptr), MSG_TYPE_FLAG); } UtPrintf("Set to all 0, various valid inputs"); for (i = 0; i < sizeof(input) / sizeof(input[0]); i++) { memset(&tlm, 0, sizeof(tlm)); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual.Seconds, 0); - ASSERT_EQ(actual.Subseconds, 0); - ASSERT_EQ(CFE_MSG_SetMsgTime(msgptr, input[i]), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual.Seconds, 0); + UtAssert_INT32_EQ(actual.Subseconds, 0); + UtAssert_INT32_EQ(CFE_MSG_SetMsgTime(msgptr, input[i]), CFE_SUCCESS); UT_DisplayPkt(msgptr, sizeof(tlm)); - ASSERT_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); - ASSERT_EQ(actual.Seconds, input[i].Seconds); - ASSERT_EQ(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); - ASSERT_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); + UtAssert_INT32_EQ(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + UtAssert_INT32_EQ(actual.Seconds, input[i].Seconds); + UtAssert_INT32_EQ(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); + UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); } } diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 888ed68f2..174c29157 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -201,9 +201,9 @@ void Test_SB_AppInit_EVSRegFail(void) int32 ForcedRtnVal = -1; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, ForcedRtnVal); - ASSERT_EQ(CFE_SB_AppInit(), ForcedRtnVal); + UtAssert_INT32_EQ(CFE_SB_AppInit(), ForcedRtnVal); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_SB_AppInit_EVSRegFail */ @@ -228,11 +228,11 @@ void Test_SB_AppInit_EVSSendEvtFail(void) * (The others use SendEventWithAppID which is a different counter). */ UT_SetDeferredRetcode(UT_KEY(CFE_EVS_SendEvent), 1, ForcedRtnVal); - ASSERT_EQ(CFE_SB_AppInit(), ForcedRtnVal); + UtAssert_INT32_EQ(CFE_SB_AppInit(), ForcedRtnVal); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_AppInit_EVSSendEvtFail */ @@ -245,11 +245,11 @@ void Test_SB_AppInit_CrPipeFail(void) * type of error code. */ UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 1, OS_ERROR); - ASSERT_EQ(CFE_SB_AppInit(), CFE_SB_PIPE_CR_ERR); + UtAssert_INT32_EQ(CFE_SB_AppInit(), CFE_SB_PIPE_CR_ERR); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_CR_PIPE_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CR_PIPE_ERR_EID); } /* end Test_SB_AppInit_CrPipeFail */ @@ -259,13 +259,13 @@ void Test_SB_AppInit_CrPipeFail(void) void Test_SB_AppInit_Sub1Fail(void) { UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, -1); - ASSERT_EQ(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_DEST_BLK_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DEST_BLK_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_AppInit_Sub1Fail */ @@ -275,13 +275,13 @@ void Test_SB_AppInit_Sub1Fail(void) void Test_SB_AppInit_Sub2Fail(void) { UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 2, -1); - ASSERT_EQ(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_DEST_BLK_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DEST_BLK_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_AppInit_Sub2Fail */ @@ -294,11 +294,11 @@ void Test_SB_AppInit_GetPoolFail(void) UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 4, ForcedRtnVal); - ASSERT_EQ(CFE_SB_AppInit(), ForcedRtnVal); + UtAssert_INT32_EQ(CFE_SB_AppInit(), ForcedRtnVal); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_AppInit_GetPoolFail */ @@ -311,11 +311,11 @@ void Test_SB_AppInit_PutPoolFail(void) UT_SetDeferredRetcode(UT_KEY(CFE_ES_PutPoolBuf), 1, ForcedRtnVal); - ASSERT_EQ(CFE_SB_AppInit(), ForcedRtnVal); + UtAssert_INT32_EQ(CFE_SB_AppInit(), ForcedRtnVal); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_AppInit_PutPoolFail */ @@ -336,13 +336,13 @@ void Test_SB_Main_RcvErr(void) UT_SetDeferredRetcode(UT_KEY(OS_QueueGet), 1, -1); CFE_SB_TaskMain(); - EVTCNT(6); + CFE_UtAssert_EventCount(6); - EVTSENT(CFE_SB_INIT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_INIT_EID); - EVTSENT(CFE_SB_Q_RD_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_Q_RD_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_Main_RcvErr */ @@ -354,9 +354,9 @@ void Test_SB_Main_InitErr(void) UT_SetDeferredRetcode(UT_KEY(CFE_ES_PutPoolBuf), 1, -1); CFE_SB_TaskMain(); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_Main_InitErr */ @@ -416,9 +416,9 @@ void Test_SB_Cmds_Noop(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); CFE_SB_ProcessCmdPipePkt(&Noop.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_CMD0_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CMD0_RCVD_EID); } /* end Test_SB_Cmds_Noop */ @@ -441,9 +441,9 @@ void Test_SB_Cmds_RstCtrs(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); CFE_SB_ProcessCmdPipePkt(&ResetCounters.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_CMD1_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CMD1_RCVD_EID); } /* Test_SB_Cmds_RstCtrs */ @@ -478,9 +478,9 @@ void Test_SB_Cmds_Stats(void) CFE_SB_ProcessCmdPipePkt(&SendSbStats.SBBuf); /* No subs event and command processing event */ - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SND_STATS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_STATS_EID); } /* end Test_SB_Cmds_Stats */ @@ -504,15 +504,15 @@ void Test_SB_Cmds_RoutingInfoDef(void) WriteRoutingInfo.Cmd.Payload.Filename[0] = '\0'; /* Make some routing info by calling CFE_SB_AppInit */ - SETUP(CFE_SB_AppInit()); + CFE_UtAssert_SETUP(CFE_SB_AppInit()); CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); - EVTCNT(5); + CFE_UtAssert_EventCount(5); - EVTSENT(CFE_SB_INIT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_INIT_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); @@ -521,9 +521,9 @@ void Test_SB_Cmds_RoutingInfoDef(void) UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); - TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_Cmds_RoutingInfoDef */ @@ -551,9 +551,9 @@ void Test_SB_Cmds_RoutingInfoAlreadyPending(void) CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_RoutingInfoSpec */ @@ -577,31 +577,32 @@ void Test_SB_Cmds_RoutingInfoDataGetter(void) CFE_SB_BackgroundFileStateInfo_t State; /* Create some map info */ - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); - SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); memset(&State, 0, sizeof(State)); LocalBuffer = NULL; LocalBufSize = 0; - ASSERT_TRUE(!CFE_SB_WriteRouteInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ(CFE_SB_WriteRouteInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize), false); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ( + CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize), true); UtAssert_ZERO(LocalBufSize); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); - TEARDOWN(CFE_SB_DeletePipe(PipeId3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId3)); } /* end Test_SB_Cmds_RoutingInfoDataGetter */ /* @@ -628,15 +629,15 @@ void Test_SB_Cmds_PipeInfoDef(void) WritePipeInfo.Cmd.Payload.Filename[0] = '\0'; /* Create some pipe info */ - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); @@ -644,11 +645,11 @@ void Test_SB_Cmds_PipeInfoDef(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); - TEARDOWN(CFE_SB_DeletePipe(PipeId3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId3)); } /* end Test_SB_Cmds_PipeInfoDef */ @@ -676,9 +677,9 @@ void Test_SB_Cmds_PipeInfoAlreadyPending(void) CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_PipeInfoAlreadyPending */ @@ -695,31 +696,32 @@ void Test_SB_Cmds_PipeInfoDataGetter(void) size_t LocalBufSize; CFE_SB_BackgroundFileStateInfo_t State; - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); memset(&State, 0, sizeof(State)); LocalBuffer = NULL; LocalBufSize = 0; /* Note that CFE_SB_CreatePipe() fills entry 1 first, so entry 0 is unused */ - ASSERT_TRUE(!CFE_SB_WritePipeInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ(CFE_SB_WritePipeInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize), false); UtAssert_ZERO(LocalBufSize); - ASSERT_TRUE(!CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ(CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize), false); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ( + CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize), true); UtAssert_ZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize), true); UtAssert_ZERO(LocalBufSize); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); - TEARDOWN(CFE_SB_DeletePipe(PipeId3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId3)); } /* end Test_SB_Cmds_PipeInfoDataGetter */ /* @@ -733,23 +735,23 @@ void Test_SB_Cmds_BackgroundFileWriteEvents(void) UT_ClearEventHistory(); CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_COMPLETE, CFE_SUCCESS, 10, 0, 1000); - EVTSENT(CFE_SB_SND_RTG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_EID); UT_ClearEventHistory(); CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR, CFE_SUCCESS, 10, 10, 1000); - EVTSENT(CFE_SB_FILEWRITE_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_FILEWRITE_ERR_EID); UT_ClearEventHistory(); CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR, CFE_SUCCESS, 10, 10, 1000); - EVTSENT(CFE_SB_FILEWRITE_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_FILEWRITE_ERR_EID); UT_ClearEventHistory(); CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_CREATE_ERROR, OS_ERROR, 10, 0, 0); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); UT_ClearEventHistory(); CFE_SB_BackgroundFileEventHandler(&State, CFE_FS_FileWriteEvent_UNDEFINED, OS_ERROR, 0, 0, 0); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* @@ -772,32 +774,33 @@ void Test_SB_Cmds_MapInfoDataGetter(void) CFE_SB_BackgroundFileStateInfo_t State; /* Create some map info */ - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); - SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); memset(&State, 0, sizeof(State)); LocalBuffer = NULL; LocalBufSize = 0; - ASSERT_TRUE(!CFE_SB_WriteMsgMapInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ(CFE_SB_WriteMsgMapInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize), false); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + UtAssert_INT32_EQ( + CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize), true); UtAssert_NULL(LocalBuffer); UtAssert_ZERO(LocalBufSize); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); - TEARDOWN(CFE_SB_DeletePipe(PipeId3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId3)); } /* end Test_SB_MapInfoDataGetter */ /* @@ -830,24 +833,24 @@ void Test_SB_Cmds_MapInfoDef(void) WriteMapInfo.Cmd.Payload.Filename[0] = '\0'; /* Create some map info */ - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); - SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); - SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId3, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); - EVTCNT(10); + CFE_UtAssert_EventCount(10); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); @@ -855,11 +858,11 @@ void Test_SB_Cmds_MapInfoDef(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); - TEARDOWN(CFE_SB_DeletePipe(PipeId3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId3)); } /* end Test_SB_Cmds_MapInfoDef */ @@ -887,9 +890,9 @@ void Test_SB_Cmds_MapInfoAlreadyPending(void) CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_MapInfoSpec */ @@ -915,22 +918,22 @@ void Test_SB_Cmds_EnRouteValParam(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "EnRouteTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "EnRouteTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId; CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_ENBL_RTE2_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_ENBL_RTE2_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_Cmds_EnRouteValParam */ @@ -956,22 +959,22 @@ void Test_SB_Cmds_EnRouteNonExist(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "EnRouteTestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "EnRouteTestPipe2")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "EnRouteTestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "EnRouteTestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId1)); EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId2; CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_ENBL_RTE1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_ENBL_RTE1_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); } /* end Test_SB_Cmds_EnRouteNonExist */ @@ -998,9 +1001,9 @@ void Test_SB_Cmds_EnRouteInvParam(void) CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_ENBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam */ @@ -1027,9 +1030,9 @@ void Test_SB_Cmds_EnRouteInvParam2(void) CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_ENBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam2 */ @@ -1057,9 +1060,9 @@ void Test_SB_Cmds_EnRouteInvParam3(void) CFE_SB_ProcessCmdPipePkt(&EnableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_ENBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam3 */ @@ -1084,22 +1087,22 @@ void Test_SB_Cmds_DisRouteValParam(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "DisRouteTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "DisRouteTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId; CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_DSBL_RTE2_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DSBL_RTE2_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_Cmds_DisRouteValParam */ @@ -1124,22 +1127,22 @@ void Test_SB_Cmds_DisRouteNonExist(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "DisRouteTestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "DisRouteTestPipe2")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "DisRouteTestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "DisRouteTestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId1)); DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId2; CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_DSBL_RTE1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DSBL_RTE1_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); } /* end Test_SB_Cmds_DisRouteNonExist */ @@ -1166,9 +1169,9 @@ void Test_SB_Cmds_DisRouteInvParam(void) CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_DSBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam */ @@ -1195,9 +1198,9 @@ void Test_SB_Cmds_DisRouteInvParam2(void) CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_DSBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam2 */ @@ -1225,9 +1228,9 @@ void Test_SB_Cmds_DisRouteInvParam3(void) CFE_SB_ProcessCmdPipePkt(&DisableRoute.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_DSBL_RTE3_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam3 */ @@ -1256,9 +1259,9 @@ void Test_SB_Cmds_SendHK(void) CFE_SB_ProcessCmdPipePkt(&Housekeeping.SBBuf); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID); } /* end Test_SB_Cmds_SendHK */ @@ -1284,8 +1287,8 @@ void Test_SB_Cmds_SendPrevSubs(void) CFE_SB_MsgId_t MsgIdCmd; CFE_MSG_Size_t Size; - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); NumEvts = 2; /* one for each pipe create */ /* Two full pkts to be sent plus five entries in a partial pkt, skipping MSGID 0x0D */ @@ -1302,11 +1305,11 @@ void Test_SB_Cmds_SendPrevSubs(void) if (i != CFE_SB_ALLSUBS_TLM_MID) { NumEvts += 1; - SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId1)); } } - SETUP(CFE_SB_SubscribeLocal(MsgId, PipeId2, MsgLim)); + CFE_UtAssert_SETUP(CFE_SB_SubscribeLocal(MsgId, PipeId2, MsgLim)); /* For 3 internal TransmitMsg calls */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID); @@ -1332,11 +1335,11 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Event count is only exact if there were no collisions */ if (UT_EventIsInHistory(CFE_SB_HASHCOLLISION_EID)) { - ASSERT_TRUE(UT_GetNumEventsSent() > NumEvts); + UtAssert_True(UT_GetNumEventsSent() > NumEvts, "NumEvents sent: %d, needed %d", (int)UT_GetNumEventsSent(), (int)NumEvts); } else { - EVTCNT(NumEvts); + CFE_UtAssert_EventCount(NumEvts); } /* Round out the number to three full pkts in order to test branch path @@ -1344,11 +1347,11 @@ void Test_SB_Cmds_SendPrevSubs(void) */ for (; i < CFE_SB_SUB_ENTRIES_PER_PKT * 3; i++) { - SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId1)); NumEvts += 1; } - SETUP(CFE_SB_SubscribeLocal(MsgId, PipeId2, MsgLim)); + CFE_UtAssert_SETUP(CFE_SB_SubscribeLocal(MsgId, PipeId2, MsgLim)); /* For 3 internal TransmitMsg calls */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID); @@ -1374,20 +1377,20 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Event count is only exact if there were no collisions */ if (UT_EventIsInHistory(CFE_SB_HASHCOLLISION_EID)) { - ASSERT_TRUE(UT_GetNumEventsSent() > NumEvts); + UtAssert_True(UT_GetNumEventsSent() > NumEvts, "NumEvents sent: %d, needed %d", (int)UT_GetNumEventsSent(), (int)NumEvts); } else { - EVTCNT(NumEvts); + CFE_UtAssert_EventCount(NumEvts); } - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SEND_NO_SUBS_EID); - EVTSENT(CFE_SB_FULL_SUB_PKT_EID); - EVTSENT(CFE_SB_PART_SUB_PKT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_FULL_SUB_PKT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PART_SUB_PKT_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); } /* end Test_SB_Cmds_SendPrevSubs */ @@ -1411,7 +1414,7 @@ void Test_SB_Cmds_SubRptOn(void) CFE_SB_ProcessCmdPipePkt(&EnableSubReporting.SBBuf); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_SB_Cmds_SubRptOn */ @@ -1435,7 +1438,7 @@ void Test_SB_Cmds_SubRptOff(void) CFE_SB_ProcessCmdPipePkt(&DisableSubReporting.SBBuf); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_SB_Cmds_SubRptOff */ @@ -1453,8 +1456,8 @@ void Test_SB_Cmds_CmdUnexpCmdCode(void) /* Use a command code known to be invalid */ CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); - EVTCNT(1); - EVTSENT(CFE_SB_BAD_CMD_CODE_EID); + CFE_UtAssert_EventCount(1); + CFE_UtAssert_EventIsInHistory(CFE_SB_BAD_CMD_CODE_EID); } /* end Test_SB_Cmds_UnexpCmdCode */ @@ -1479,9 +1482,9 @@ void Test_SB_Cmds_BadCmdLength(void) CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_LEN_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_LEN_ERR_EID); } /* end Test_SB_Cmds_BadCmdLength */ @@ -1496,9 +1499,9 @@ void Test_SB_Cmds_UnexpMsgId(void) CFE_SB_ProcessCmdPipePkt((CFE_SB_Buffer_t *)NULL); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_BAD_MSGID_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_BAD_MSGID_EID); } /* end Test_SB_Cmds_UnexpMsgId */ @@ -1564,11 +1567,11 @@ void Test_CreatePipe_NullPtr(void) UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetTaskInfo), 1, CFE_ES_ERR_RESOURCEID_NOT_VALID); UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 1, OS_SUCCESS); /* Avoids creating socket */ - ASSERT_EQ(CFE_SB_CreatePipe(NULL, PipeDepth, "TestPipe"), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(NULL, PipeDepth, "TestPipe"), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_CR_PIPE_BAD_ARG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CR_PIPE_BAD_ARG_EID); } /* end Test_CreatePipe_NullPtr */ @@ -1579,15 +1582,15 @@ void Test_CreatePipe_ValPipeDepth(void) { CFE_SB_PipeId_t PipeIdReturned[2]; - ASSERT(CFE_SB_CreatePipe(&PipeIdReturned[0], 1, "TestPipeMin")); - ASSERT(CFE_SB_CreatePipe(&PipeIdReturned[1], OS_QUEUE_MAX_DEPTH, "TestPipeMax")); + CFE_UtAssert_SUCCESS(CFE_SB_CreatePipe(&PipeIdReturned[0], 1, "TestPipeMin")); + CFE_UtAssert_SUCCESS(CFE_SB_CreatePipe(&PipeIdReturned[1], OS_QUEUE_MAX_DEPTH, "TestPipeMax")); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[0])); - TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[1])); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[0])); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[1])); } /* end Test_CreatePipe_ValPipeDepth */ @@ -1599,16 +1602,16 @@ void Test_CreatePipe_InvalPipeDepth(void) CFE_SB_PipeId_t PipeIdReturned[3]; UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 1, OS_SUCCESS); /* Avoid creating socket */ - ASSERT_EQ(CFE_SB_CreatePipe(&PipeIdReturned[0], 0, "TestPipe1"), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(&PipeIdReturned[0], 0, "TestPipe1"), CFE_SB_BAD_ARGUMENT); UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 1, OS_SUCCESS); - ASSERT_EQ(CFE_SB_CreatePipe(&PipeIdReturned[1], OS_QUEUE_MAX_DEPTH + 1, "TestPipeMaxDepPlus1"), - CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(&PipeIdReturned[1], OS_QUEUE_MAX_DEPTH + 1, "TestPipeMaxDepPlus1"), + CFE_SB_BAD_ARGUMENT); UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 1, OS_SUCCESS); - ASSERT_EQ(CFE_SB_CreatePipe(&PipeIdReturned[2], 0xffff, "TestPipeffff"), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(&PipeIdReturned[2], 0xffff, "TestPipeffff"), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_CR_PIPE_BAD_ARG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CR_PIPE_BAD_ARG_EID); } /* end Test_CreatePipe_InvalPipeDepth */ @@ -1632,20 +1635,20 @@ void Test_CreatePipe_MaxPipes(void) if (i < CFE_PLATFORM_SB_MAX_PIPES) { - SETUP(CFE_SB_CreatePipe(&PipeIdReturned[i], PipeDepth, PipeName)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeIdReturned[i], PipeDepth, PipeName)); } else { - ASSERT_EQ(CFE_SB_CreatePipe(&PipeIdReturned[i], PipeDepth, PipeName), CFE_SB_MAX_PIPES_MET); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(&PipeIdReturned[i], PipeDepth, PipeName), CFE_SB_MAX_PIPES_MET); } } - EVTSENT(CFE_SB_MAX_PIPES_MET_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MAX_PIPES_MET_EID); /* Clean up */ for (i = 0; i < CFE_PLATFORM_SB_MAX_PIPES; i++) { - TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[i])); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeIdReturned[i])); } /* @@ -1654,8 +1657,8 @@ void Test_CreatePipe_MaxPipes(void) */ CFE_SB_Global.PipeTbl[1].PipeId = CFE_SB_PIPEID_C(UT_SB_MakePipeIdForIndex(1)); CFE_SB_Global.PipeTbl[2].PipeId = CFE_SB_INVALID_PIPE; - ASSERT_TRUE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(1))); - ASSERT_TRUE(!CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(2))); + UtAssert_INT32_EQ(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(1)), true); + UtAssert_INT32_EQ(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(2)), false); } /* end Test_CreatePipe_MaxPipes */ @@ -1674,21 +1677,21 @@ void Test_CreatePipe_SamePipeName(void) UT_SetDeferredRetcode(UT_KEY(OS_QueueCreate), 2, OS_ERR_NAME_TAKEN); /* First call to CFE_SB_CreatePipe() should succeed */ - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, PipeName)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, PipeName)); FirstPipeId = PipeId; /* Second call to CFE_SB_CreatePipe with same PipeName should fail */ - ASSERT_EQ(CFE_SB_CreatePipe(&PipeId, PipeDepth, PipeName), CFE_SB_PIPE_CR_ERR); + UtAssert_INT32_EQ(CFE_SB_CreatePipe(&PipeId, PipeDepth, PipeName), CFE_SB_PIPE_CR_ERR); - ASSERT_TRUE(CFE_RESOURCEID_TEST_EQUAL(PipeId, FirstPipeId)); + CFE_UtAssert_ResourceId_EQ(PipeId, FirstPipeId); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_CR_PIPE_NAME_TAKEN_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_CR_PIPE_NAME_TAKEN_EID); /* Call to CFE_SB_DeletePipe with the first pipe id created should work fine */ - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* @@ -1711,13 +1714,13 @@ void Test_DeletePipe_NoSubs(void) CFE_SB_PipeId_t PipedId; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); - ASSERT(CFE_SB_DeletePipe(PipedId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); + CFE_UtAssert_SUCCESS(CFE_SB_DeletePipe(PipedId)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_PIPE_DELETED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_DELETED_EID); } /* end Test_DeletePipe_NoSubs */ @@ -1733,17 +1736,17 @@ void Test_DeletePipe_WithSubs(void) CFE_SB_MsgId_t MsgId3 = SB_UT_CMD_MID4; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId0, PipedId)); - SETUP(CFE_SB_Subscribe(MsgId1, PipedId)); - SETUP(CFE_SB_Subscribe(MsgId2, PipedId)); - SETUP(CFE_SB_Subscribe(MsgId3, PipedId)); - ASSERT(CFE_SB_DeletePipe(PipedId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId3, PipedId)); + CFE_UtAssert_SUCCESS(CFE_SB_DeletePipe(PipedId)); - EVTCNT(6); + CFE_UtAssert_EventCount(6); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_PIPE_DELETED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_DELETED_EID); } /* end Test_DeletePipe_WithSubs */ @@ -1754,11 +1757,11 @@ void Test_DeletePipe_InvalidPipeId(void) { CFE_SB_PipeId_t PipeId = SB_UT_ALTERNATE_INVALID_PIPEID; - ASSERT_EQ(CFE_SB_DeletePipe(PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_DeletePipe(PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_DEL_PIPE_ERR1_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DEL_PIPE_ERR1_EID); } /* end Test_DeletePipe_InvalidPipeId */ @@ -1772,7 +1775,7 @@ void Test_DeletePipe_InvalidPipeOwner(void) CFE_ES_AppId_t RealOwner; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); /* Change owner of pipe through memory corruption */ PipeDscPtr = CFE_SB_LocatePipeDescByID(PipedId); @@ -1780,15 +1783,15 @@ void Test_DeletePipe_InvalidPipeOwner(void) /* Choose a value that is sure not to be owner */ PipeDscPtr->AppId = UT_SB_AppID_Modify(RealOwner, 1); - ASSERT_EQ(CFE_SB_DeletePipe(PipedId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_DeletePipe(PipedId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_DEL_PIPE_ERR2_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DEL_PIPE_ERR2_EID); /* Restore owner id and delete pipe since test is complete */ PipeDscPtr->AppId = RealOwner; - TEARDOWN(CFE_SB_DeletePipe(PipedId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipedId)); } /* end Test_DeletePipe_InvalidPipeId */ @@ -1801,16 +1804,16 @@ void Test_DeletePipe_WithAppid(void) CFE_ES_AppId_t AppId; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID1, PipedId)); - SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID2, PipedId)); - SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID3, PipedId)); - SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID4, PipedId)); - SETUP(CFE_ES_GetAppID(&AppId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipedId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID1, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID2, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID3, PipedId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(SB_UT_CMD_MID4, PipedId)); + CFE_UtAssert_SETUP(CFE_ES_GetAppID(&AppId)); - ASSERT(CFE_SB_DeletePipeWithAppId(PipedId, AppId)); + CFE_UtAssert_SUCCESS(CFE_SB_DeletePipeWithAppId(PipedId, AppId)); - EVTCNT(6); + CFE_UtAssert_EventCount(6); } /* end Test_DeletePipe_WithAppid */ @@ -1844,12 +1847,12 @@ void Test_GetPipeName_NullPtr(void) { CFE_SB_PipeId_t PipeId; - SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe")); - ASSERT_EQ(CFE_SB_GetPipeName(NULL, OS_MAX_API_NAME, PipeId), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe")); + UtAssert_INT32_EQ(CFE_SB_GetPipeName(NULL, OS_MAX_API_NAME, PipeId), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPENAME_NULL_PTR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPENAME_NULL_PTR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName_NullPtr */ @@ -1861,14 +1864,14 @@ void Test_GetPipeName_InvalidId(void) char PipeName[OS_MAX_API_NAME]; CFE_SB_PipeId_t PipeId; - SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe")); UT_SetDeferredRetcode(UT_KEY(OS_GetResourceName), 1, OS_ERROR); - ASSERT_EQ(CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPENAME_ID_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPENAME_ID_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName_InvalidId */ @@ -1882,15 +1885,15 @@ void Test_GetPipeName(void) OS_queue_prop_t queue_info = {"TestPipe1"}; - SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe1")); UT_SetDataBuffer(UT_KEY(OS_QueueGetInfo), &queue_info, sizeof(queue_info), false); - ASSERT(CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId)); + CFE_UtAssert_SUCCESS(CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId)); - EVTSENT(CFE_SB_GETPIPENAME_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPENAME_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName */ @@ -1911,13 +1914,13 @@ void Test_GetPipeIdByName_NullPtrs(void) { CFE_SB_PipeId_t PipeIDOut; - ASSERT_EQ(CFE_SB_GetPipeIdByName(&PipeIDOut, NULL), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeIdByName(&PipeIDOut, NULL), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); - ASSERT_EQ(CFE_SB_GetPipeIdByName(NULL, "invalid"), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeIdByName(NULL, "invalid"), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); } /* end Test_GetPipeIdByName_NullPtrs */ @@ -1929,9 +1932,9 @@ void Test_GetPipeIdByName_InvalidName(void) CFE_SB_PipeId_t PipeIdOut; UT_SetDeferredRetcode(UT_KEY(OS_QueueGetIdByName), 1, OS_ERR_NAME_NOT_FOUND); - ASSERT_EQ(CFE_SB_GetPipeIdByName(&PipeIdOut, "invalid"), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeIdByName(&PipeIdOut, "invalid"), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID); } /* end Test_GetPipeIdByName_InvalidName */ @@ -1943,16 +1946,16 @@ void Test_GetPipeIdByName(void) CFE_SB_PipeId_t PipeId = SB_UT_PIPEID_0; CFE_SB_PipeId_t PipeIdOut; - SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, 4, "TestPipe1")); UT_SetDataBuffer(UT_KEY(OS_QueueGetIdByName), &(CFE_SB_Global.PipeTbl[0].SysQueueId), sizeof(CFE_SB_Global.PipeTbl[0].SysQueueId), false); - ASSERT(CFE_SB_GetPipeIdByName(&PipeIdOut, "TestPipe1")); + CFE_UtAssert_SUCCESS(CFE_SB_GetPipeIdByName(&PipeIdOut, "TestPipe1")); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEIDBYNAME_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeIdByName */ @@ -1961,9 +1964,9 @@ void Test_GetPipeIdByName(void) */ void Test_SetPipeOpts_BadID(void) { - ASSERT_EQ(CFE_SB_SetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, 0), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_SetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, 0), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_SETPIPEOPTS_ID_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SETPIPEOPTS_ID_ERR_EID); } /* end Test_SetPipeOpts_BadID */ @@ -1976,20 +1979,20 @@ void Test_SetPipeOpts_NotOwner(void) CFE_SB_PipeD_t *PipeDscPtr; CFE_ES_AppId_t OrigOwner; - SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); PipeDscPtr = CFE_SB_LocatePipeDescByID(PipeID); OrigOwner = PipeDscPtr->AppId; PipeDscPtr->AppId = UT_SB_AppID_Modify(OrigOwner, 1); - ASSERT_EQ(CFE_SB_SetPipeOpts(PipeID, 0), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_SetPipeOpts(PipeID, 0), CFE_SB_BAD_ARGUMENT); PipeDscPtr->AppId = OrigOwner; - EVTSENT(CFE_SB_SETPIPEOPTS_OWNER_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SETPIPEOPTS_OWNER_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_SetPipeOpts_NotOwner */ @@ -2000,13 +2003,13 @@ void Test_SetPipeOpts(void) { CFE_SB_PipeId_t PipeID; - SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); - ASSERT(CFE_SB_SetPipeOpts(PipeID, 0)); + CFE_UtAssert_SUCCESS(CFE_SB_SetPipeOpts(PipeID, 0)); - EVTSENT(CFE_SB_SETPIPEOPTS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SETPIPEOPTS_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_SetPipeOpts */ @@ -2017,9 +2020,9 @@ void Test_GetPipeOpts_BadID(void) { uint8 Opts = 0; - ASSERT_EQ(CFE_SB_GetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, &Opts), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, &Opts), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEOPTS_ID_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEOPTS_ID_ERR_EID); } /* end Test_GetPipeOpts_BadID */ @@ -2030,13 +2033,13 @@ void Test_GetPipeOpts_BadPtr(void) { CFE_SB_PipeId_t PipeID; - SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); - ASSERT_EQ(CFE_SB_GetPipeOpts(PipeID, NULL), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_GetPipeOpts(PipeID, NULL), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEOPTS_PTR_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEOPTS_PTR_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_GetPipeOpts_BadPtr */ @@ -2048,13 +2051,13 @@ void Test_GetPipeOpts(void) CFE_SB_PipeId_t PipeID; uint8 Opts = 0; - SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeID, 4, "TestPipe1")); - ASSERT(CFE_SB_GetPipeOpts(PipeID, &Opts)); + CFE_UtAssert_SUCCESS(CFE_SB_GetPipeOpts(PipeID, &Opts)); - EVTSENT(CFE_SB_GETPIPEOPTS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GETPIPEOPTS_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_GetPipeOpts */ @@ -2088,16 +2091,16 @@ void Test_Subscribe_SubscribeEx(void) uint16 PipeDepth = 10; uint16 MsgLim = 8; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - ASSERT(CFE_SB_SubscribeEx(MsgId, PipeId, Quality, MsgLim)); + CFE_UtAssert_SUCCESS(CFE_SB_SubscribeEx(MsgId, PipeId, Quality, MsgLim)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_SubscribeEx */ @@ -2109,11 +2112,11 @@ void Test_Subscribe_InvalidPipeId(void) CFE_SB_PipeId_t PipeId = SB_UT_PIPEID_2; CFE_SB_MsgId_t MsgId = SB_UT_ALTERNATE_INVALID_MID; - ASSERT_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUB_INV_PIPE_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUB_INV_PIPE_EID); } /* end Test_Subscribe_InvalidPipeId */ @@ -2126,15 +2129,15 @@ void Test_Subscribe_InvalidMsgId(void) CFE_SB_MsgId_t MsgId = SB_UT_ALTERNATE_INVALID_MID; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - ASSERT_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_SUB_ARG_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUB_ARG_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_InvalidMsgId */ @@ -2149,16 +2152,16 @@ void Test_Subscribe_MaxMsgLim(void) uint16 PipeDepth = 10; uint16 MsgLim; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); MsgLim = 0xffff; - ASSERT(CFE_SB_SubscribeEx(MsgId, PipeId, Quality, MsgLim)); + CFE_UtAssert_SUCCESS(CFE_SB_SubscribeEx(MsgId, PipeId, Quality, MsgLim)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_MaxMsgLim */ @@ -2171,17 +2174,17 @@ void Test_Subscribe_DuplicateSubscription(void) CFE_SB_MsgId_t MsgId = SB_UT_CMD_MID; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - ASSERT(CFE_SB_Subscribe(MsgId, PipeId)); - ASSERT(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SUCCESS(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SUCCESS(CFE_SB_Subscribe(MsgId, PipeId)); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_DUP_SUBSCRIP_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_DUP_SUBSCRIP_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_DuplicateSubscription */ @@ -2195,16 +2198,16 @@ void Test_Subscribe_LocalSubscription(void) uint16 PipeDepth = 10; uint16 MsgLim = 4; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - ASSERT(CFE_SB_SubscribeLocal(MsgId, PipeId, MsgLim)); + CFE_UtAssert_SUCCESS(CFE_SB_SubscribeLocal(MsgId, PipeId, MsgLim)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_LocalSubscription */ @@ -2223,7 +2226,7 @@ void Test_Subscribe_MaxDestCount(void) for (i = 0; i < CFE_PLATFORM_SB_MAX_DEST_PER_PKT + 1; i++) { snprintf(PipeName, sizeof(PipeName), "TestPipe%ld", (long)i); - SETUP(CFE_SB_CreatePipe(&PipeId[i], PipeDepth, PipeName)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId[i], PipeDepth, PipeName)); } /* Do subscriptions */ @@ -2231,23 +2234,23 @@ void Test_Subscribe_MaxDestCount(void) { if (i < CFE_PLATFORM_SB_MAX_DEST_PER_PKT) { - SETUP(CFE_SB_Subscribe(MsgId, PipeId[i])); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId[i])); } else { - ASSERT_EQ(CFE_SB_Subscribe(MsgId, PipeId[i]), CFE_SB_MAX_DESTS_MET); + UtAssert_INT32_EQ(CFE_SB_Subscribe(MsgId, PipeId[i]), CFE_SB_MAX_DESTS_MET); } } - EVTCNT((2 * CFE_PLATFORM_SB_MAX_DEST_PER_PKT) + 3); + CFE_UtAssert_EventCount((2 * CFE_PLATFORM_SB_MAX_DEST_PER_PKT) + 3); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_MAX_DESTS_MET_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MAX_DESTS_MET_EID); /* Delete pipes */ for (i = 0; i < CFE_PLATFORM_SB_MAX_DEST_PER_PKT + 1; i++) { - TEARDOWN(CFE_SB_DeletePipe(PipeId[i])); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId[i])); } } /* end Test_Subscribe_MaxDestCount */ @@ -2263,27 +2266,27 @@ void Test_Subscribe_MaxMsgIdCount(void) uint16 PipeDepth = 50; int32 i; - SETUP(CFE_SB_CreatePipe(&PipeId0, PipeDepth, "TestPipe0")); - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId0, PipeDepth, "TestPipe0")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); for (i = 0; i < CFE_PLATFORM_SB_MAX_MSG_IDS + 1; i++) { if (i < CFE_PLATFORM_SB_MAX_MSG_IDS) { - SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2)); } else { - ASSERT_EQ(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2), CFE_SB_MAX_MSGS_MET); + UtAssert_INT32_EQ(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2), CFE_SB_MAX_MSGS_MET); } } - EVTSENT(CFE_SB_MAX_MSGS_MET_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MAX_MSGS_MET_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId0)); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId0)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); } /* end Test_Subscribe_MaxMsgIdCount */ @@ -2307,16 +2310,16 @@ void Test_Subscribe_SendPrevSubs(void) * but creating one and initializing it for completeness, in * case that changes in the future */ memset(&SendPrevSubsMsg, 0, sizeof(SendPrevSubsMsg)); - SETUP(CFE_SB_CreatePipe(&PipeId0, PipeDepth, "TestPipe0")); - SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId0)); - SETUP(CFE_SB_Subscribe(MsgId1, PipeId0)); - SETUP(CFE_SB_Subscribe(MsgId2, PipeId0)); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId2, PipeId1)); - SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId0, PipeDepth, "TestPipe0")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId0)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipeId0)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipeId0)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId1, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId2, PipeId1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId0, PipeId2)); /* For internal TransmitMsg call */ MsgIdCmd = CFE_SB_ValueToMsgId(CFE_SB_ALLSUBS_TLM_MID); @@ -2324,15 +2327,15 @@ void Test_Subscribe_SendPrevSubs(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgIdCmd, sizeof(MsgIdCmd), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - ASSERT(CFE_SB_SendPrevSubsCmd(&SendPrevSubsMsg)); + CFE_UtAssert_SUCCESS(CFE_SB_SendPrevSubsCmd(&SendPrevSubsMsg)); - EVTCNT(12); + CFE_UtAssert_EventCount(12); - EVTSENT(CFE_SB_PART_SUB_PKT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PART_SUB_PKT_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId0)); - TEARDOWN(CFE_SB_DeletePipe(PipeId1)); - TEARDOWN(CFE_SB_DeletePipe(PipeId2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId0)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId2)); } /* end Test_Subscribe_SendPrevSubs */ @@ -2344,11 +2347,11 @@ void Test_Subscribe_PipeNonexistent(void) CFE_SB_MsgId_t MsgId = SB_UT_CMD_MID; CFE_SB_PipeId_t PipeId = SB_UT_ALTERNATE_INVALID_PIPEID; - ASSERT_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUB_INV_PIPE_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUB_INV_PIPE_EID); } /* end Test_Subscribe_PipeNonexistent */ @@ -2364,7 +2367,7 @@ void Test_Subscribe_SubscriptionReporting(void) CFE_SB_MsgId_t MsgIdRpt; CFE_MSG_Size_t Size; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); /* Enable subscription reporting */ CFE_SB_SetSubscriptionReporting(CFE_SB_ENABLE); @@ -2376,22 +2379,23 @@ void Test_Subscribe_SubscriptionReporting(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); /* Subscribe to message: GLOBAL */ - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* Unsubscribe so that a local subscription can be tested */ - SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); /* Subscribe to message: LOCAL */ - ASSERT(CFE_SB_SubscribeFull(MsgId, PipeId, Quality, CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT, CFE_SB_MSG_LOCAL)); + CFE_UtAssert_SUCCESS( + CFE_SB_SubscribeFull(MsgId, PipeId, Quality, CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT, CFE_SB_MSG_LOCAL)); - EVTCNT(6); + CFE_UtAssert_EventCount(6); - EVTSENT(CFE_SB_SUBSCRIPTION_RPT_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RPT_EID); /* Disable subscription reporting */ CFE_SB_SetSubscriptionReporting(CFE_SB_DISABLE); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_SubscriptionReporting */ @@ -2406,7 +2410,7 @@ void Test_Subscribe_InvalidPipeOwner(void) uint16 PipeDepth = 10; CFE_ES_AppId_t RealOwner; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); /* Change owner of pipe through memory corruption */ PipeDscPtr = CFE_SB_LocatePipeDescByID(PipeId); @@ -2416,13 +2420,13 @@ void Test_Subscribe_InvalidPipeOwner(void) PipeDscPtr->AppId = UT_SB_AppID_Modify(RealOwner, 1); CFE_SB_Subscribe(MsgId, PipeId); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_SUB_INV_CALLER_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUB_INV_CALLER_EID); /* Restore owner id and delete pipe since test is complete */ PipeDscPtr->AppId = RealOwner; - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_InvalidPipeOwner */ @@ -2451,22 +2455,22 @@ void Test_Unsubscribe_Basic(void) CFE_SB_MsgId_t MsgId = SB_UT_INTERMEDIATE_VALID_MID; uint16 PipeDepth = 50; - SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); - ASSERT(CFE_SB_Unsubscribe(MsgId, TestPipe)); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(MsgId, TestPipe)); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); /* Check unsubscribe after unsubscribe produces event */ UT_ClearEventHistory(); - ASSERT(CFE_SB_Unsubscribe(MsgId, TestPipe)); - EVTCNT(2); - EVTSENT(CFE_SB_UNSUB_NO_SUBS_EID); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(MsgId, TestPipe)); + CFE_UtAssert_EventCount(2); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_NO_SUBS_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_Basic */ @@ -2479,16 +2483,16 @@ void Test_Unsubscribe_Local(void) CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; uint16 PipeDepth = 50; - SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); - ASSERT(CFE_SB_UnsubscribeLocal(SB_UT_LAST_VALID_MID, TestPipe)); + CFE_UtAssert_SUCCESS(CFE_SB_UnsubscribeLocal(SB_UT_LAST_VALID_MID, TestPipe)); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_Local */ @@ -2503,17 +2507,17 @@ void Test_Unsubscribe_InvalParam(void) uint16 PipeDepth = 50; CFE_SB_PipeId_t SavedPipeId; - SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); /* Perform test using a bad message ID */ - ASSERT_EQ(CFE_SB_Unsubscribe(SB_UT_ALTERNATE_INVALID_MID, TestPipe), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Unsubscribe(SB_UT_ALTERNATE_INVALID_MID, TestPipe), CFE_SB_BAD_ARGUMENT); /* Get the caller's Application ID */ - ASSERT(CFE_ES_GetAppID(&CallerId)); + CFE_UtAssert_SUCCESS(CFE_ES_GetAppID(&CallerId)); /* Perform test using a bad scope value */ - ASSERT_EQ(CFE_SB_UnsubscribeFull(SB_UT_FIRST_VALID_MID, TestPipe, CFE_SB_MSG_LOCAL + 1, CallerId), - CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_UnsubscribeFull(SB_UT_FIRST_VALID_MID, TestPipe, CFE_SB_MSG_LOCAL + 1, CallerId), + CFE_SB_BAD_ARGUMENT); /* Perform test using an invalid pipe ID for branch path coverage. * This situation cannot happen in normal circumstances since the @@ -2523,17 +2527,17 @@ void Test_Unsubscribe_InvalParam(void) PipeDscPtr = CFE_SB_LocatePipeDescByID(TestPipe); SavedPipeId = CFE_SB_PipeDescGetID(PipeDscPtr); PipeDscPtr->PipeId = SB_UT_ALTERNATE_INVALID_PIPEID; - ASSERT_EQ(CFE_SB_Unsubscribe(SB_UT_FIRST_VALID_MID, TestPipe), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Unsubscribe(SB_UT_FIRST_VALID_MID, TestPipe), CFE_SB_BAD_ARGUMENT); /* We must restore the old value so CFE_SB_DeletePipe() works */ PipeDscPtr->PipeId = SavedPipeId; - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_UNSUB_ARG_ERR_EID); - EVTSENT(CFE_SB_UNSUB_INV_PIPE_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_ARG_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_INV_PIPE_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_InvalParam */ @@ -2547,21 +2551,21 @@ void Test_Unsubscribe_NoMatch(void) uint16 PipeDepth = 50; /* Create pipe, subscribe, unsubscribe */ - SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); - SETUP(CFE_SB_Unsubscribe(MsgId, TestPipe)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); + CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, TestPipe)); UT_ClearEventHistory(); /* Check that unsubscribe to msgid that was never subscribed reports error */ - ASSERT(CFE_SB_Unsubscribe(SB_UT_TLM_MID1, TestPipe)); - EVTSENT(CFE_SB_UNSUB_NO_SUBS_EID); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(SB_UT_TLM_MID1, TestPipe)); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_NO_SUBS_EID); UT_ClearEventHistory(); /* Check that repeated unsubscribe to msgid that was subscribted reports error */ - ASSERT(CFE_SB_Unsubscribe(MsgId, TestPipe)); - EVTSENT(CFE_SB_UNSUB_NO_SUBS_EID); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(MsgId, TestPipe)); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_NO_SUBS_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_NoMatch */ @@ -2574,16 +2578,16 @@ void Test_Unsubscribe_InvalidPipe(void) CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; uint16 PipeDepth = 50; - SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe)); - ASSERT_EQ(CFE_SB_Unsubscribe(MsgId, SB_UT_ALTERNATE_INVALID_PIPEID), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Unsubscribe(MsgId, SB_UT_ALTERNATE_INVALID_PIPEID), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_UNSUB_INV_PIPE_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_INV_PIPE_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_InvalidPipe */ @@ -2598,9 +2602,9 @@ void Test_Unsubscribe_InvalidPipeOwner(void) CFE_ES_AppId_t RealOwner; uint16 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* Change owner of pipe through memory corruption */ PipeDscPtr = CFE_SB_LocatePipeDescByID(PipeId); @@ -2608,15 +2612,15 @@ void Test_Unsubscribe_InvalidPipeOwner(void) /* Choose a value that is sure not be owner */ PipeDscPtr->AppId = UT_SB_AppID_Modify(RealOwner, 1); - ASSERT_EQ(CFE_SB_Unsubscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_Unsubscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_UNSUB_INV_CALLER_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_UNSUB_INV_CALLER_EID); PipeDscPtr->AppId = RealOwner; - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Unsubscribe_InvalidPipeOwner */ @@ -2632,23 +2636,23 @@ void Test_Unsubscribe_FirstDestWithMany(void) CFE_SB_PipeId_t TestPipe3; uint16 PipeDepth = 50; - SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&TestPipe3, PipeDepth, "TestPipe3")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe3)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe3)); - ASSERT(CFE_SB_Unsubscribe(MsgId, TestPipe1)); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(MsgId, TestPipe1)); - EVTCNT(7); + CFE_UtAssert_EventCount(7); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_REMOVED_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); - TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); - TEARDOWN(CFE_SB_DeletePipe(TestPipe3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe3)); } /* end Test_Unsubscribe_FirstDestWithMany */ @@ -2664,23 +2668,23 @@ void Test_Unsubscribe_MiddleDestWithMany(void) CFE_SB_PipeId_t TestPipe3; uint16 PipeDepth = 50; - SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_CreatePipe(&TestPipe3, PipeDepth, "TestPipe3")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe3)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe3, PipeDepth, "TestPipe3")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe3)); - ASSERT(CFE_SB_Unsubscribe(MsgId, TestPipe2)); + CFE_UtAssert_SUCCESS(CFE_SB_Unsubscribe(MsgId, TestPipe2)); - EVTCNT(7); + CFE_UtAssert_EventCount(7); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_REMOVED_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); - TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); - TEARDOWN(CFE_SB_DeletePipe(TestPipe3)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe3)); } /* end Test_Unsubscribe_MiddleDestWithMany */ @@ -2696,23 +2700,23 @@ void Test_Unsubscribe_GetDestPtr(void) uint16 PipeDepth = 50; CFE_SBR_RouteId_t RouteId; - SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); - SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); - SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); - SETUP(CFE_SB_Unsubscribe(MsgId, TestPipe2)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe1, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&TestPipe2, PipeDepth, "TestPipe2")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe1)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, TestPipe2)); + CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, TestPipe2)); /* For now just get route id and use it, will need update when stubbed */ RouteId = CFE_SBR_GetRouteId(MsgId); - ASSERT_TRUE(CFE_SB_GetDestPtr(RouteId, TestPipe2) == NULL); + UtAssert_NULL(CFE_SB_GetDestPtr(RouteId, TestPipe2)); - EVTCNT(5); + CFE_UtAssert_EventCount(5); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_REMOVED_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); - TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe1)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe2)); } /* end Test_Unsubscribe_GetDestPtr */ @@ -2746,11 +2750,11 @@ void Test_TransmitMsg_API(void) */ void Test_TransmitMsg_NullPtr(void) { - ASSERT_EQ(CFE_SB_TransmitMsg(NULL, true), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(NULL, true), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SEND_BAD_ARG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SEND_BAD_ARG_EID); } /* end Test_TransmitMsg_NullPtr */ @@ -2766,11 +2770,11 @@ void Test_TransmitMsg_NoSubscribers(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID); } /* end Test_TransmitMsg_NoSubscribers */ @@ -2786,11 +2790,11 @@ void Test_TransmitMsg_MaxMsgSizePlusOne(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - ASSERT_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_MSG_TOO_BIG); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_MSG_TOO_BIG); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_MSG_TOO_BIG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MSG_TOO_BIG_EID); } /* end Test_TransmitMsg_MaxMsgSizePlusOne */ @@ -2806,17 +2810,17 @@ void Test_TransmitMsg_BasicSend(void) CFE_MSG_Size_t Size = sizeof(TlmPkt); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_BasicSend */ @@ -2848,8 +2852,8 @@ void Test_TransmitMsg_SequenceCount(void) /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SeqCntTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SeqCntTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* Note the Sequence count value doesn't really matter, just set unique to confirm use */ SeqCntExpected = 1; @@ -2858,57 +2862,57 @@ void Test_TransmitMsg_SequenceCount(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 1); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); - ASSERT_EQ(SeqCnt, SeqCntExpected); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 1); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); + UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, false)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, false)); /* Assert sequence count wasn't set */ - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 1); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 1); SeqCntExpected = 2; UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), SeqCntExpected); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - ASSERT_EQ(SeqCnt, SeqCntExpected); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 2); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 2); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 2); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 2); - EVTCNT(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventCount(2); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); /* should have no subscribers now */ + CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); /* should have no subscribers now */ SeqCntExpected = 3; UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), SeqCntExpected); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 3 */ - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 3); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 3); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 3 */ + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 3); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 3); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* resubscribe so we can receive a msg */ + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* resubscribe so we can receive a msg */ SeqCntExpected = 4; UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), SeqCntExpected); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 4 */ - ASSERT_EQ(SeqCnt, SeqCntExpected); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 4); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 4); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* increment to 4 */ + UtAssert_INT32_EQ(SeqCnt, SeqCntExpected); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 4); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 4); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_SequenceCount */ @@ -2924,20 +2928,20 @@ void Test_TransmitMsg_QueuePutError(void) CFE_MSG_Size_t Size = sizeof(TlmPkt); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; - SETUP(CFE_SB_CreatePipe(&PipeId4Error, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId4Error)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId4Error, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId4Error)); UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_ERROR); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_Q_WR_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_Q_WR_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId4Error)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId4Error)); } /* end Test_TransmitMsg_QueuePutError */ @@ -2953,14 +2957,14 @@ void Test_TransmitMsg_PipeFull(void) CFE_MSG_Size_t Size = sizeof(TlmPkt); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "PipeFullTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "PipeFullTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* This send should pass */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); /* Tell the QueuePut stub to return OS_QUEUE_FULL on its next call */ UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_QUEUE_FULL); @@ -2970,13 +2974,13 @@ void Test_TransmitMsg_PipeFull(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Pipe overflow causes TransmitMsg to return CFE_SUCCESS */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_Q_FULL_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_Q_FULL_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_PipeFull */ @@ -2992,7 +2996,7 @@ void Test_TransmitMsg_MsgLimitExceeded(void) CFE_MSG_Size_t Size = sizeof(TlmPkt); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "MsgLimTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "MsgLimTestPipe")); /* Set maximum allowed messages on the pipe at one time to 1 */ CFE_SB_SubscribeEx(MsgId, PipeId, CFE_SB_DEFAULT_QOS, 1); @@ -3002,7 +3006,7 @@ void Test_TransmitMsg_MsgLimitExceeded(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* First send should pass */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); @@ -3011,13 +3015,13 @@ void Test_TransmitMsg_MsgLimitExceeded(void) /* This send should produce a MsgId to Pipe Limit Exceeded message, but * return success */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_MSGID_LIM_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MSGID_LIM_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_MsgLimitExceeded */ @@ -3033,8 +3037,8 @@ void Test_TransmitMsg_GetPoolBufErr(void) CFE_MSG_Size_t Size = sizeof(TlmPkt); PipeDepth = 1; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "GetPoolErrPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "GetPoolErrPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); @@ -3042,13 +3046,13 @@ void Test_TransmitMsg_GetPoolBufErr(void) * allocation failed) */ UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); - ASSERT_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true), CFE_SB_BUF_ALOC_ERR); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - EVTSENT(CFE_SB_GET_BUF_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_GET_BUF_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_GetPoolBufErr */ @@ -3065,9 +3069,9 @@ void Test_AllocateMessageBuffer(void) * allocation failed) */ UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); - ASSERT_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) == NULL); + UtAssert_NULL(CFE_SB_AllocateMessageBuffer(MsgSize)); - EVTCNT(0); + CFE_UtAssert_EventCount(0); /* Increase the peak memory and buffers in use above the expected values in * order to exercise branch paths @@ -3078,14 +3082,15 @@ void Test_AllocateMessageBuffer(void) CFE_SB_Global.StatTlmMsg.Payload.MemInUse = 0; CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse = MemUse + 10; CFE_SB_Global.StatTlmMsg.Payload.PeakSBBuffersInUse = CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse + 2; - ASSERT_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) != NULL); + UtAssert_NOT_NULL(CFE_SB_AllocateMessageBuffer(MsgSize)); - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, MemUse + 10); /* unchanged */ - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, MemUse); /* predicted value */ + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, MemUse + 10); /* unchanged */ + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, MemUse); /* predicted value */ - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakSBBuffersInUse, CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse + 1); + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakSBBuffersInUse, + CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse + 1); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_TransmitMsg_ZeroCopyGetPtr */ @@ -3107,16 +3112,16 @@ void Test_TransmitMsg_ZeroCopyBufferValidate(void) memset(&BadZeroCpyBuf, 0, sizeof(BadZeroCpyBuf)); /* Null Buffer => BAD_ARGUMENT */ - ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(NULL, &BufDscPtr), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_ZeroCopyBufferValidate(NULL, &BufDscPtr), CFE_SB_BAD_ARGUMENT); /* Non-null buffer pointer but Non Zero-Copy => CFE_SB_BUFFER_INVALID */ - ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(&BadZeroCpyBuf.Content, &BufDscPtr), CFE_SB_BUFFER_INVALID); + UtAssert_INT32_EQ(CFE_SB_ZeroCopyBufferValidate(&BadZeroCpyBuf.Content, &BufDscPtr), CFE_SB_BUFFER_INVALID); /* Good buffer pointer + Good Handle => SUCCESS */ - ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(SendPtr, &BufDscPtr), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_ZeroCopyBufferValidate(SendPtr, &BufDscPtr), CFE_SUCCESS); /* Confirm that the computed pointer was correct */ - ASSERT_TRUE(&BufDscPtr->Content == SendPtr); + UtAssert_ADDRESS_EQ(&BufDscPtr->Content, SendPtr); /* Clean-up */ CFE_SB_ReleaseMessageBuffer(SendPtr); @@ -3140,9 +3145,9 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* Create a real/valid Zero Copy handle via the API */ SendPtr = CFE_SB_AllocateMessageBuffer(sizeof(SB_UT_Test_Tlm_t)); @@ -3157,19 +3162,19 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test a successful zero copy send */ - ASSERT(CFE_SB_TransmitBuffer(SendPtr, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitBuffer(SendPtr, true)); - ASSERT(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); + CFE_UtAssert_SUCCESS(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); - ASSERT_TRUE(SendPtr == ReceivePtr); + UtAssert_ADDRESS_EQ(SendPtr, ReceivePtr); - ASSERT_EQ(SeqCnt, 1); + UtAssert_INT32_EQ(SeqCnt, 1); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* @@ -3190,8 +3195,8 @@ void Test_TransmitBuffer_NoIncrement(void) /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyPassTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyPassTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); SendPtr = CFE_SB_AllocateMessageBuffer(sizeof(SB_UT_Test_Tlm_t)); @@ -3205,17 +3210,17 @@ void Test_TransmitBuffer_NoIncrement(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test a successful zero copy pass */ - ASSERT(CFE_SB_TransmitBuffer(SendPtr, false)); - ASSERT(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitBuffer(SendPtr, false)); + CFE_UtAssert_SUCCESS(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); - ASSERT_TRUE(SendPtr == ReceivePtr); - ASSERT_EQ(SeqCnt, 22); + UtAssert_ADDRESS_EQ(SendPtr, ReceivePtr); + UtAssert_INT32_EQ(SeqCnt, 22); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* @@ -3232,25 +3237,25 @@ void Test_ReleaseMessageBuffer(void) ZeroCpyMsgPtr1 = CFE_SB_AllocateMessageBuffer(MsgSize); ZeroCpyMsgPtr2 = CFE_SB_AllocateMessageBuffer(MsgSize); ZeroCpyMsgPtr3 = CFE_SB_AllocateMessageBuffer(MsgSize); - SETUP(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2)); + CFE_UtAssert_SETUP(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2)); /* Test response to an invalid buffer (has been released already) */ - ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2), CFE_SB_BUFFER_INVALID); + UtAssert_INT32_EQ(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2), CFE_SB_BUFFER_INVALID); /* Test response to a null message pointer */ - ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(NULL), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_ReleaseMessageBuffer(NULL), CFE_SB_BAD_ARGUMENT); /* Test response to an invalid message pointer */ memset(&BadBufferDesc, 0, sizeof(BadBufferDesc)); - ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(&BadBufferDesc.Content), CFE_SB_BUFFER_INVALID); + UtAssert_INT32_EQ(CFE_SB_ReleaseMessageBuffer(&BadBufferDesc.Content), CFE_SB_BUFFER_INVALID); /* Test successful release of the second buffer */ - ASSERT(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr3)); + CFE_UtAssert_SUCCESS(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr3)); /* Test successful release of the third buffer */ - ASSERT(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr1)); + CFE_UtAssert_SUCCESS(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr1)); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_TransmitMsg_ZeroCopyReleasePtr */ @@ -3270,8 +3275,8 @@ void Test_TransmitMsg_DisabledDestination(void) PipeDepth = 2; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); RouteId = CFE_SBR_GetRouteId(MsgId); DestPtr = CFE_SB_GetDestPtr(RouteId, PipeId); @@ -3281,13 +3286,13 @@ void Test_TransmitMsg_DisabledDestination(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_DisabledDestination */ @@ -3307,17 +3312,17 @@ void Test_BroadcastBufferToRoute(void) CFE_SB_TrackingListReset(&SBBufD.Link); PipeDepth = 2; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); RouteId = CFE_SBR_GetRouteId(MsgId); /* No return from this function - it handles all errors */ CFE_SB_BroadcastBufferToRoute(&SBBufD, RouteId); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_BroadcastBufferToRoute */ @@ -3336,13 +3341,14 @@ void Test_TransmitMsgValidate_MaxMsgSizePlusOne(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - ASSERT_EQ(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn), CFE_SB_MSG_TOO_BIG); - ASSERT_EQ(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); - ASSERT_EQ(SizeRtn, Size); + UtAssert_INT32_EQ(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn), + CFE_SB_MSG_TOO_BIG); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); + UtAssert_INT32_EQ(SizeRtn, Size); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_MSG_TOO_BIG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_MSG_TOO_BIG_EID); } /* @@ -3360,14 +3366,14 @@ void Test_TransmitMsgValidate_NoSubscribers(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - ASSERT(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn)); - ASSERT_EQ(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); - ASSERT_EQ(SizeRtn, Size); - ASSERT_TRUE(!CFE_SBR_IsValidRouteId(RouteIdRtn)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn)); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); + UtAssert_INT32_EQ(SizeRtn, Size); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(RouteIdRtn), false); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID); } /* @@ -3392,11 +3398,11 @@ void Test_ReceiveBuffer_InvalidPipeId(void) CFE_SB_Buffer_t *SBBufPtr; CFE_SB_PipeId_t InvalidPipeId = SB_UT_ALTERNATE_INVALID_PIPEID; - ASSERT_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, InvalidPipeId, CFE_SB_POLL), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, InvalidPipeId, CFE_SB_POLL), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_BAD_PIPEID_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_BAD_PIPEID_EID); } /* end Test_ReceiveBuffer_InvalidPipeId */ @@ -3410,15 +3416,15 @@ void Test_ReceiveBuffer_InvalidTimeout(void) uint32 PipeDepth = 10; int32 TimeOut = -5; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); - ASSERT_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, TimeOut), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, TimeOut), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_RCV_BAD_ARG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_RCV_BAD_ARG_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_InvalidTimeout */ @@ -3431,15 +3437,15 @@ void Test_ReceiveBuffer_Poll(void) CFE_SB_PipeId_t PipeId; uint32 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); - ASSERT_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_POLL), CFE_SB_NO_MESSAGE); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_POLL), CFE_SB_NO_MESSAGE); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_Poll */ @@ -3453,16 +3459,16 @@ void Test_ReceiveBuffer_Timeout(void) uint32 PipeDepth = 10; int32 TimeOut = 200; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); UT_SetDeferredRetcode(UT_KEY(OS_QueueGet), 1, OS_QUEUE_TIMEOUT); - ASSERT_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, TimeOut), CFE_SB_TIME_OUT); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, TimeOut), CFE_SB_TIME_OUT); - EVTCNT(1); + CFE_UtAssert_EventCount(1); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_Timeout */ @@ -3475,15 +3481,15 @@ void Test_ReceiveBuffer_PipeReadError(void) CFE_SB_PipeId_t PipeId; uint32 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); UT_SetDeferredRetcode(UT_KEY(OS_QueueGet), 1, OS_ERROR); - ASSERT_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER), CFE_SB_PIPE_RD_ERR); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER), CFE_SB_PIPE_RD_ERR); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_Q_RD_ERR_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_Q_RD_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_PipeReadError */ @@ -3500,22 +3506,22 @@ void Test_ReceiveBuffer_PendForever(void) CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; CFE_MSG_Size_t Size = sizeof(TlmPkt); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); - SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - ASSERT(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER)); + CFE_UtAssert_SUCCESS(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER)); - ASSERT_TRUE(SBBufPtr != NULL); + UtAssert_NOT_NULL(SBBufPtr); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_PendForever */ @@ -3537,7 +3543,7 @@ void Test_CleanupApp_API(void) CFE_ES_GetAppID(&AppID); AppID2 = CFE_ES_APPID_C(CFE_ResourceId_FromInteger(2)); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); CFE_SB_AllocateMessageBuffer(10); /* Mimic a different app ID getting a buffer */ @@ -3573,11 +3579,11 @@ void Test_CleanupApp_API(void) /* This should have freed the last buffer */ UtAssert_STUB_COUNT(CFE_ES_PutPoolBuf, 3); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_PIPE_DELETED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_DELETED_EID); } /* end Test_CleanupApp_API */ @@ -3589,15 +3595,15 @@ void Test_ReceiveBuffer_InvalidBufferPtr(void) CFE_SB_PipeId_t PipeId; uint32 PipeDepth = 10; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); - ASSERT_EQ(CFE_SB_ReceiveBuffer(NULL, PipeId, CFE_SB_PEND_FOREVER), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_ReceiveBuffer(NULL, PipeId, CFE_SB_PEND_FOREVER), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_RCV_BAD_ARG_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_RCV_BAD_ARG_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_InvalidBufferPtr */ @@ -3626,26 +3632,26 @@ void Test_CFE_SB_MsgHdrSize(void) type = CFE_MSG_Type_Invalid; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - ASSERT_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_Message_t)); + UtAssert_INT32_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_Message_t)); /* Has secondary, tlm type */ hassec = true; type = CFE_MSG_Type_Tlm; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - ASSERT_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_TelemetryHeader_t)); + UtAssert_INT32_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_TelemetryHeader_t)); /* Has secondary, cmd type */ type = CFE_MSG_Type_Cmd; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - ASSERT_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_CommandHeader_t)); + UtAssert_INT32_EQ(CFE_SB_MsgHdrSize(&msg), sizeof(CFE_MSG_CommandHeader_t)); /* Has secondary, invalid type */ type = CFE_MSG_Type_Invalid; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - ASSERT_EQ(CFE_SB_MsgHdrSize(&msg), 0); + UtAssert_INT32_EQ(CFE_SB_MsgHdrSize(&msg), 0); } /* end Test_CFE_SB_MsgHdrSize */ @@ -3755,7 +3761,7 @@ void Test_CFE_SB_SetGetUserDataLength(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &size, sizeof(size), false); - ASSERT_EQ(CFE_SB_GetUserDataLength(&msg), size - sizeof(CCSDS_SpacePacket_t)); + UtAssert_INT32_EQ(CFE_SB_GetUserDataLength(&msg), size - sizeof(CCSDS_SpacePacket_t)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); @@ -3772,11 +3778,11 @@ void Test_CFE_SB_ValidateMsgId(void) /* Validate Msg Id */ MsgId = SB_UT_LAST_VALID_MID; - ASSERT_EQ(CFE_SB_ValidateMsgId(MsgId), CFE_SUCCESS); + UtAssert_INT32_EQ(CFE_SB_ValidateMsgId(MsgId), CFE_SUCCESS); /* Test for invalid msg id */ MsgId = SB_UT_ALTERNATE_INVALID_MID; - ASSERT_EQ(CFE_SB_ValidateMsgId(MsgId), CFE_SB_FAILED); + UtAssert_INT32_EQ(CFE_SB_ValidateMsgId(MsgId), CFE_SB_FAILED); } /* @@ -3809,16 +3815,16 @@ void Test_OS_MutSem_ErrLogic(void) UT_SetDeferredRetcode(UT_KEY(OS_MutSemTake), 1, OS_SEM_FAILURE); UT_SetDeferredRetcode(UT_KEY(OS_MutSemGive), 2, OS_SEM_FAILURE); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - ASSERT(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SUCCESS(CFE_SB_Subscribe(MsgId, PipeId)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - EVTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_OS_MutSemTake_ErrLogic */ @@ -3835,14 +3841,14 @@ void Test_ReqToSendEvent_ErrLogic(void) */ CFE_ES_GetTaskID(&TaskId); CFE_SB_Global.StopRecurseFlags[0] = 0x0000; - ASSERT_EQ(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_GRANTED); + UtAssert_INT32_EQ(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_GRANTED); /* Call the function a second time; the result should indicate that the * bit is already set */ - ASSERT_EQ(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_DENIED); + UtAssert_INT32_EQ(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_DENIED); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_ReqToSendEvent_ErrLogic */ @@ -3852,9 +3858,9 @@ void Test_ReqToSendEvent_ErrLogic(void) */ void Test_PutDestBlk_ErrLogic(void) { - ASSERT_EQ(CFE_SB_PutDestinationBlk(NULL), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_PutDestinationBlk(NULL), CFE_SB_BAD_ARGUMENT); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_PutDestBlk_ErrLogic */ @@ -3871,9 +3877,9 @@ void Test_CFE_SB_Buffers(void) CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse = sizeof(CFE_SB_BufferD_t) * 4; bd = CFE_SB_GetBufferFromPool(0); - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, sizeof(CFE_SB_BufferD_t) * 4); + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, sizeof(CFE_SB_BufferD_t) * 4); - EVTCNT(0); + CFE_UtAssert_EventCount(0); /* * If returning to the pool fails SB still isn't going to use the buffer anymore, @@ -3882,23 +3888,23 @@ void Test_CFE_SB_Buffers(void) ExpRtn = CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse - 1; UT_SetDeferredRetcode(UT_KEY(CFE_ES_PutPoolBuf), 1, -1); CFE_SB_ReturnBufferToPool(bd); - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse, ExpRtn); + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse, ExpRtn); - EVTCNT(0); + CFE_UtAssert_EventCount(0); bd->UseCount = 0; CFE_SB_DecrBufUseCnt(bd); - ASSERT_EQ(bd->UseCount, 0); + UtAssert_INT32_EQ(bd->UseCount, 0); - EVTCNT(0); + CFE_UtAssert_EventCount(0); UT_SetDeferredRetcode(UT_KEY(CFE_ES_PutPoolBuf), 1, -1); CFE_SB_Global.StatTlmMsg.Payload.MemInUse = 0; CFE_SB_PutDestinationBlk((CFE_SB_DestinationD_t *)bd); - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, 0); + UtAssert_INT32_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, 0); - EVTCNT(0); + CFE_UtAssert_EventCount(0); } /* end Test_CFE_SB_Buffers */ @@ -3912,26 +3918,26 @@ void Test_CFE_SB_BadPipeInfo(void) uint16 PipeDepth = 10; CFE_ES_AppId_t AppID; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe1")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe1")); /* Set the pipe ID to an erroneous value and attempt to delete the pipe */ PipeDscPtr = CFE_SB_LocatePipeDescByID(PipeId); PipeDscPtr->PipeId = SB_UT_PIPEID_1; CFE_ES_GetAppID(&AppID); - ASSERT_EQ(CFE_SB_DeletePipeFull(SB_UT_PIPEID_0, AppID), CFE_SB_BAD_ARGUMENT); + UtAssert_INT32_EQ(CFE_SB_DeletePipeFull(SB_UT_PIPEID_0, AppID), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); /* Reset the pipe ID and delete the pipe */ PipeDscPtr->PipeId = PipeId; - ASSERT_EQ( + UtAssert_INT32_EQ( CFE_SB_SubscribeFull(SB_UT_FIRST_VALID_MID, PipeId, CFE_SB_DEFAULT_QOS, CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT, 2), CFE_SB_BAD_ARGUMENT); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_CFE_SB_BadPipeInfo */ @@ -3968,8 +3974,8 @@ void Test_SB_TransmitMsgPaths_Nominal(void) CFE_SB_ProcessCmdPipePkt(&Housekeeping.SBBuf); /* The no subs event should not be in history but count should increment */ - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID)); - ASSERT_EQ(CFE_SB_Global.HKTlmMsg.Payload.NoSubscribersCounter, 1); + CFE_UtAssert_EventIsNotInHistory(CFE_SB_SEND_NO_SUBS_EID); + UtAssert_INT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.NoSubscribersCounter, 1); /* Repress get buffer error */ CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; @@ -3987,11 +3993,11 @@ void Test_SB_TransmitMsgPaths_Nominal(void) UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); CFE_SB_ProcessCmdPipePkt(&Housekeeping.SBBuf); - ASSERT_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 0); + UtAssert_INT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 0); - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_GET_BUF_ERR_EID)); + CFE_UtAssert_EventIsNotInHistory(CFE_SB_GET_BUF_ERR_EID); - EVTCNT(0); + CFE_UtAssert_EventCount(0); CFE_SB_Global.StopRecurseFlags[1] = 0; @@ -3999,20 +4005,20 @@ void Test_SB_TransmitMsgPaths_Nominal(void) MsgId = SB_UT_CMD_MID; Size = sizeof(TlmPkt); Type = CFE_MSG_Type_Cmd; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); /* Will fail because of deferred CFE_ES_GetPoolBuf failure return */ - ASSERT_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BUF_ALOC_ERR); + UtAssert_INT32_EQ(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BUF_ALOC_ERR); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(3); + CFE_UtAssert_EventCount(3); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ void Test_SB_TransmitMsgPaths_LimitErr(void) @@ -4026,29 +4032,29 @@ void Test_SB_TransmitMsgPaths_LimitErr(void) /* Test inhibiting sending a "message ID limit error" message */ MsgId = SB_UT_TLM_MID; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "MsgLimTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "MsgLimTestPipe")); /* Set maximum allowed messages on the pipe at one time to 1 */ - SETUP(CFE_SB_SubscribeEx(MsgId, PipeId, CFE_SB_DEFAULT_QOS, 1)); + CFE_UtAssert_SETUP(CFE_SB_SubscribeEx(MsgId, PipeId, CFE_SB_DEFAULT_QOS, 1)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* First send should pass */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_MSGID_LIM_ERR_EID_BIT); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); CFE_SB_Global.StopRecurseFlags[1] = 0; - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_MSGID_LIM_ERR_EID)); + CFE_UtAssert_EventIsNotInHistory(CFE_SB_MSGID_LIM_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ @@ -4063,15 +4069,15 @@ void Test_SB_TransmitMsgPaths_FullErr(void) /* Test inhibiting sending a "pipe full" message */ MsgId = SB_UT_TLM_MID; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "PipeFullTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "PipeFullTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* This send should pass */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); @@ -4080,14 +4086,14 @@ void Test_SB_TransmitMsgPaths_FullErr(void) /* Tell the QueuePut stub to return OS_QUEUE_FULL on its next call */ UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_QUEUE_FULL); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_Q_FULL_ERR_EID_BIT); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); CFE_SB_Global.StopRecurseFlags[1] = 0; - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_Q_FULL_ERR_EID_BIT)); + CFE_UtAssert_EventIsNotInHistory(CFE_SB_Q_FULL_ERR_EID_BIT); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ void Test_SB_TransmitMsgPaths_WriteErr(void) @@ -4101,8 +4107,8 @@ void Test_SB_TransmitMsgPaths_WriteErr(void) /* Test inhibiting sending a "pipe write error" message */ MsgId = SB_UT_TLM_MID; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDeferredRetcode(UT_KEY(OS_QueuePut), 1, OS_ERROR); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); @@ -4110,20 +4116,20 @@ void Test_SB_TransmitMsgPaths_WriteErr(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_Q_WR_ERR_EID_BIT); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); CFE_SB_Global.StopRecurseFlags[1] = 0; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - EVTCNT(2); + CFE_UtAssert_EventCount(2); - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_Q_WR_ERR_EID)); + CFE_UtAssert_EventIsNotInHistory(CFE_SB_Q_WR_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ @@ -4138,19 +4144,19 @@ void Test_SB_TransmitMsgPaths_IgnoreOpt(void) /* Setup Test skipping sending to a pipe when the pipe option is set to ignore */ MsgId = SB_UT_TLM_MID; - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SkipPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); - SETUP(CFE_SB_SetPipeOpts(PipeId, CFE_SB_PIPEOPTS_IGNOREMINE)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SkipPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_SetPipeOpts(PipeId, CFE_SB_PIPEOPTS_IGNOREMINE)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test skipping this pipe and the send should pass */ - ASSERT(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - TEARDOWN(CFE_SB_SetPipeOpts(PipeId, 0)); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_SetPipeOpts(PipeId, 0)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ @@ -4168,25 +4174,25 @@ void Test_ReceiveBuffer_UnsubResubPath(void) CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; CFE_MSG_Size_t Size = sizeof(TlmPkt); - SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "RcvTestPipe")); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); - SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); + CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(&TlmPkt.Hdr.Msg, true)); - SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); - SETUP(CFE_SB_Subscribe(MsgId, PipeId)); - ASSERT(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER)); + CFE_UtAssert_SETUP(CFE_SB_Unsubscribe(MsgId, PipeId)); + CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId)); + CFE_UtAssert_SUCCESS(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, CFE_SB_PEND_FOREVER)); - ASSERT_TRUE(SBBufPtr != NULL); + UtAssert_NOT_NULL(SBBufPtr); - EVTCNT(4); + CFE_UtAssert_EventCount(4); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EventIsInHistory(CFE_SB_SUBSCRIPTION_REMOVED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_UnsubResubPath */ diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c index f0ed6c102..664dd4ab1 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c @@ -41,8 +41,8 @@ void Test_SBR_Map_Direct(void) uint32 i; UtPrintf("Invalid msg checks"); - ASSERT_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - ASSERT_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))), false); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))), false); UtPrintf("Initialize map"); CFE_SBR_Init_Map(); @@ -59,18 +59,18 @@ void Test_SBR_Map_Direct(void) count++; } } - ASSERT_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); + UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); UtPrintf("Set/Get a range of ids "); routeid = CFE_SBR_ValueToRouteId(CFE_PLATFORM_SB_MAX_MSG_IDS + 1); msgid = CFE_SB_ValueToMsgId(0); - ASSERT_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); - ASSERT_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); + UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); routeid = CFE_SBR_ValueToRouteId(0); msgid = CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); - ASSERT_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); - ASSERT_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); + UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); UtPrintf("Check there is now 1 valid entry in map"); count = 0; @@ -81,13 +81,13 @@ void Test_SBR_Map_Direct(void) count++; } } - ASSERT_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); UtPrintf("Set back to invalid and check again"); routeid = CFE_SBR_INVALID_ROUTE_ID; - ASSERT_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); - ASSERT_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); - ASSERT_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(msgid)), false); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); + UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(msgid)), false); /* Performance check, 0xFFFFFF on 3.2GHz linux box is around 8-9 seconds */ count = 0; diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c index 0b7586ad4..de4013aac 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c @@ -60,8 +60,8 @@ void Test_SBR_Map_Hash(void) uint32 collisions; UtPrintf("Invalid msg checks"); - ASSERT_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - ASSERT_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))), false); + UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))), false); UtPrintf("Initialize routing and map"); CFE_SBR_Init(); @@ -78,7 +78,7 @@ void Test_SBR_Map_Hash(void) count++; } } - ASSERT_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); + UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1); /* Note AddRoute required for hash logic to work since it depends on MsgId in routing table */ UtPrintf("Add routes and check with a rollover and a skip"); @@ -86,15 +86,15 @@ void Test_SBR_Map_Hash(void) msgid[1] = Test_SBR_Unhash(0xFFFFFFFF); msgid[2] = Test_SBR_Unhash(0x7FFFFFFF); routeid[0] = CFE_SBR_AddRoute(msgid[0], &collisions); - ASSERT_EQ(collisions, 0); + UtAssert_INT32_EQ(collisions, 0); routeid[1] = CFE_SBR_AddRoute(msgid[1], &collisions); - ASSERT_EQ(collisions, 0); + UtAssert_INT32_EQ(collisions, 0); routeid[2] = CFE_SBR_AddRoute(msgid[2], &collisions); - ASSERT_EQ(collisions, 2); + UtAssert_INT32_EQ(collisions, 2); - ASSERT_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[0])), CFE_SBR_RouteIdToValue(routeid[0])); - ASSERT_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[1])), CFE_SBR_RouteIdToValue(routeid[1])); - ASSERT_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[2])), CFE_SBR_RouteIdToValue(routeid[2])); + UtAssert_INT32_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[0])), CFE_SBR_RouteIdToValue(routeid[0])); + UtAssert_INT32_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[1])), CFE_SBR_RouteIdToValue(routeid[1])); + UtAssert_INT32_EQ(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[2])), CFE_SBR_RouteIdToValue(routeid[2])); /* Performance check, 0xFFFFFF on 3.2GHz linux box is around 8-9 seconds */ count = 0; diff --git a/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c index 4e006bd0b..7a87f7fd1 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c @@ -51,9 +51,9 @@ void Test_SBR_Route_Unsort_General(void) CFE_SBR_Init(); UtPrintf("Invalid msg checks"); - ASSERT_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL))); - ASSERT_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions))); - ASSERT_EQ(collisions, 0); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL)), false); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions)), false); + UtAssert_INT32_EQ(collisions, 0); /* * Force valid msgid responses @@ -65,18 +65,18 @@ void Test_SBR_Route_Unsort_General(void) UtPrintf("Callback test with no routes"); count = 0; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, NULL); - ASSERT_EQ(count, 0); + UtAssert_INT32_EQ(count, 0); UtPrintf("Add maximum mesage id value"); msgid = CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); routeid = CFE_SBR_AddRoute(msgid, &collisions); - ASSERT_EQ(collisions, 0); - ASSERT_TRUE(CFE_SBR_IsValidRouteId(routeid)); + UtAssert_INT32_EQ(collisions, 0); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(routeid), true); UtPrintf("Callback test with one route"); count = 0; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, NULL); - ASSERT_EQ(count, 1); + UtAssert_INT32_EQ(count, 1); UtPrintf("Fill routing table"); count = 0; @@ -86,30 +86,30 @@ void Test_SBR_Route_Unsort_General(void) } /* Check for expected count indicating full routing table */ - ASSERT_EQ(count + 1, CFE_PLATFORM_SB_MAX_MSG_IDS); + UtAssert_INT32_EQ(count + 1, CFE_PLATFORM_SB_MAX_MSG_IDS); /* Try one more for good luck */ - ASSERT_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(count), NULL))); + UtAssert_INT32_EQ(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(count), NULL)), false); /* Check that maximum msgid is still in the table */ - ASSERT_EQ(CFE_SB_MsgIdToValue(CFE_SBR_GetMsgId(routeid)), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); - ASSERT_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); + UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(CFE_SBR_GetMsgId(routeid)), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); UtPrintf("Callback test with full route"); count = 0; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, NULL); - ASSERT_EQ(count, CFE_PLATFORM_SB_MAX_MSG_IDS); + UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_MAX_MSG_IDS); UtPrintf("Callback test throttled"); throttle.MaxLoop = CFE_PLATFORM_SB_MAX_MSG_IDS - 1; throttle.StartIndex = 0; count = 0; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, &throttle); - ASSERT_EQ(count, CFE_PLATFORM_SB_MAX_MSG_IDS - 1); + UtAssert_INT32_EQ(count, CFE_PLATFORM_SB_MAX_MSG_IDS - 1); count = 0; throttle.StartIndex = throttle.NextIndex; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, &throttle); - ASSERT_EQ(count, 1); + UtAssert_INT32_EQ(count, 1); } void Test_SBR_Route_Unsort_GetSet(void) @@ -128,9 +128,9 @@ void Test_SBR_Route_Unsort_GetSet(void) routeid[1] = CFE_SBR_ValueToRouteId(CFE_PLATFORM_SB_MAX_MSG_IDS); for (i = 0; i < 2; i++) { - ASSERT_TRUE(CFE_SB_MsgId_Equal(CFE_SBR_GetMsgId(routeid[i]), CFE_SB_INVALID_MSG_ID)); + UtAssert_INT32_EQ(CFE_SB_MsgId_Equal(CFE_SBR_GetMsgId(routeid[i]), CFE_SB_INVALID_MSG_ID), true); UtAssert_ADDRESS_EQ(CFE_SBR_GetDestListHeadPtr(routeid[i]), NULL); - ASSERT_EQ(CFE_SBR_GetSequenceCounter(routeid[i]), 0); + UtAssert_INT32_EQ(CFE_SBR_GetSequenceCounter(routeid[i]), 0); } /* @@ -154,7 +154,7 @@ void Test_SBR_Route_Unsort_GetSet(void) count++; } } - ASSERT_EQ(count, 0); + UtAssert_INT32_EQ(count, 0); UtPrintf("Add routes and initialize values for testing"); msgid[0] = CFE_SB_ValueToMsgId(0); @@ -171,22 +171,22 @@ void Test_SBR_Route_Unsort_GetSet(void) UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), seqcntexpected[0]); for (i = 0; i < 3; i++) { - ASSERT_TRUE(CFE_SB_MsgId_Equal(msgid[i], CFE_SBR_GetMsgId(routeid[i]))); + UtAssert_INT32_EQ(CFE_SB_MsgId_Equal(msgid[i], CFE_SBR_GetMsgId(routeid[i])), true); CFE_SBR_IncrementSequenceCounter(routeid[0]); } - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 3); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 3); /* Increment route 1 once and set dest pointers */ UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), seqcntexpected[1]); CFE_SBR_IncrementSequenceCounter(routeid[1]); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 4); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 4); CFE_SBR_SetDestListHeadPtr(routeid[1], &dest[1]); CFE_SBR_SetDestListHeadPtr(routeid[2], &dest[0]); UtPrintf("Verify remaining set values"); - ASSERT_EQ(CFE_SBR_GetSequenceCounter(routeid[0]), seqcntexpected[0]); - ASSERT_EQ(CFE_SBR_GetSequenceCounter(routeid[1]), seqcntexpected[1]); - ASSERT_EQ(CFE_SBR_GetSequenceCounter(routeid[2]), 0); + UtAssert_INT32_EQ(CFE_SBR_GetSequenceCounter(routeid[0]), seqcntexpected[0]); + UtAssert_INT32_EQ(CFE_SBR_GetSequenceCounter(routeid[1]), seqcntexpected[1]); + UtAssert_INT32_EQ(CFE_SBR_GetSequenceCounter(routeid[2]), 0); UtAssert_ADDRESS_EQ(CFE_SBR_GetDestListHeadPtr(routeid[0]), NULL); UtAssert_ADDRESS_EQ(CFE_SBR_GetDestListHeadPtr(routeid[1]), &dest[1]); UtAssert_ADDRESS_EQ(CFE_SBR_GetDestListHeadPtr(routeid[2]), &dest[0]); diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 8bc42b492..fe5e6420f 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -329,7 +329,7 @@ void Test_CFE_TBL_InitData(void) /* This function has only one possible path with no return code */ UT_InitData(); CFE_TBL_InitData(); - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 3); + UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 3); } /* @@ -3210,14 +3210,14 @@ void Test_CFE_TBL_TblMod(void) } MyFilename[sizeof(MyFilename) - 1] = '\0'; - ASSERT(CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_FILE, MyFilename)); - ASSERT_EQ(UT_GetNumEventsSent(), 1); - ASSERT_TRUE(UT_EventIsInHistory(CFE_TBL_LOAD_SUCCESS_INF_EID)); + CFE_UtAssert_SUCCESS(CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_FILE, MyFilename)); + UtAssert_INT32_EQ(UT_GetNumEventsSent(), 1); + CFE_UtAssert_EventIsInHistory(CFE_TBL_LOAD_SUCCESS_INF_EID); /* Notify Table Services that the table has been modified */ - ASSERT(CFE_TBL_Modified(App1TblHandle1)); - ASSERT(CFE_TBL_GetInfo(&TblInfo1, "ut_cfe_tbl.UT_Table2")); - ASSERT_EQ(TblInfo1.TimeOfLastUpdate.Seconds, TblInfo1.TimeOfLastUpdate.Subseconds); + CFE_UtAssert_SUCCESS(CFE_TBL_Modified(App1TblHandle1)); + CFE_UtAssert_SUCCESS(CFE_TBL_GetInfo(&TblInfo1, "ut_cfe_tbl.UT_Table2")); + UtAssert_INT32_EQ(TblInfo1.TimeOfLastUpdate.Seconds, TblInfo1.TimeOfLastUpdate.Subseconds); /* * LastFileLoaded (limited by mission) can be bigger than MyFilename (limited by osal),