From 0869452ab0c08d4e60a3e404bc0ce355972a7fe8 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 16 Jun 2021 15:48:24 -0400 Subject: [PATCH] Fix #1626, rename/clean CFE coverage assert macros Rename CFE coverage test assert macros in ut_support.h to have consistent name prefix. Adds implementation functions for completely generic signed/unsigned comparison asserts, and wrapper macros to invoke those functions. These functions return the pass/fail status of the assert as a bool value, so the test case can act on the result. Also adds a "VOIDCALL" and "RESOURCEID_EQ" macro for logging void functions and ID checks, respectively. --- .../core_private/ut-stubs/inc/ut_support.h | 262 +++- .../core_private/ut-stubs/src/ut_support.c | 142 +- modules/es/ut-coverage/es_UT.c | 2 +- modules/evs/ut-coverage/evs_UT.c | 14 +- .../msg/ut-coverage/test_cfe_msg_ccsdsext.c | 276 ++-- .../msg/ut-coverage/test_cfe_msg_ccsdspri.c | 342 ++-- .../msg/ut-coverage/test_cfe_msg_checksum.c | 64 +- modules/msg/ut-coverage/test_cfe_msg_fc.c | 66 +- modules/msg/ut-coverage/test_cfe_msg_init.c | 72 +- .../ut-coverage/test_cfe_msg_msgid_shared.c | 38 +- .../msg/ut-coverage/test_cfe_msg_msgid_v1.c | 88 +- .../msg/ut-coverage/test_cfe_msg_msgid_v2.c | 84 +- modules/msg/ut-coverage/test_cfe_msg_time.c | 70 +- modules/sb/ut-coverage/sb_UT.c | 1370 ++++++++--------- .../sbr/ut-coverage/test_cfe_sbr_map_direct.c | 22 +- .../sbr/ut-coverage/test_cfe_sbr_map_hash.c | 18 +- .../ut-coverage/test_cfe_sbr_route_unsorted.c | 46 +- modules/tbl/ut-coverage/tbl_UT.c | 14 +- 18 files changed, 1623 insertions(+), 1367 deletions(-) diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 06e97b54a..2f2d69b87 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -138,6 +138,27 @@ typedef struct } UT_TaskPipeDispatchId_t; +/** + * \brief Comparison types for generic value asserts + * + * These constants are used with the generic value assert functions + * + * \sa CFE_UtAssert_GenericSignedCompare_Impl + * \sa CFE_UtAssert_GenericUnsignedCompare_Impl + */ +typedef enum +{ + CFE_UtAssert_Compare_NONE, /**< invalid/not used, always false */ + CFE_UtAssert_Compare_EQ, /**< actual equals reference value */ + CFE_UtAssert_Compare_NEQ, /**< actual does not non equal reference value */ + CFE_UtAssert_Compare_LT, /**< actual less than reference (exclusive) */ + CFE_UtAssert_Compare_GT, /**< actual greater than reference (exclusive) */ + CFE_UtAssert_Compare_LTEQ, /**< actual less than or equal to reference (inclusive) */ + CFE_UtAssert_Compare_GTEQ, /**< actual greater than reference (inclusive) */ + CFE_UtAssert_Compare_BOOL, /**< interpret as logical boolean values (0=false, nonzero=true) */ + CFE_UtAssert_Compare_MAX /**< placeholder, not used */ +} CFE_UtAssert_Compare_t; + /* ** Functions */ @@ -596,8 +617,74 @@ 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); + +/* +** Assert Helper Functions +** Wrappers around the UtAssert functions to tune them for CFE use. +** These should all return a generalized pass/fail status (bool) +*/ + +/*****************************************************************************/ +/** +** \brief Helper function for nominal CFE calls +** +** \par Description +** This helper function wraps the normal UtAssert function, intended for verifying +** CFE API calls that are expected to return successfully (#CFE_SUCCESS typically). +** +** This can also be used to confirm setup and teardown operations by passing the CaseType +** parameter appropriately (UTASSERT_CASETYPE_TSF or UTASSERT_CASETYPE_TTF, respectively). +** +** \par Assumptions, External Events, and Notes: +** When used for setup (TSF) or teardown (TTF) then the test case is only logged to +** the output if it fails. This is to keep logs more concise, by not including +** test cases that are not related to the main focus of the code under test. +** +** Note this will accept any non-negative value as logical "success", so it +** also works with functions that return a size or other non-error status. +** +** \returns Test pass status, returns true if status was successful, false if it failed. +** +******************************************************************************/ +bool CFE_UtAssert_SuccessCheck_Impl(CFE_Status_t Status, UtAssert_CaseType_t CaseType, const char *File, uint32 Line, const char *Text); + +/*****************************************************************************/ +/** +** \brief Helper function for generic unsigned integer value checks +** +** \par Description +** This helper function wraps the normal UtAssertEx() function, to compare two +** integer values in an unsigned context. The comparison is performed as two +** 32 bit unsigned integers and the numeric values are printed to the test log +** in hexadecimal notation (base-16). +** +** \par Assumptions, External Events, and Notes: +** None +** +** \returns Test pass status, returns true if status was successful, false if it failed. +** +******************************************************************************/ +bool CFE_UtAssert_GenericUnsignedCompare_Impl(uint32 ActualValue, CFE_UtAssert_Compare_t CompareType, uint32 ReferenceValue, const char *File, uint32 Line, + const char *Desc, const char *ActualText, const char *ReferenceText); + +/*****************************************************************************/ +/** +** \brief Helper function for generic signed integer value checks +** +** \par Description +** This helper function wraps the normal UtAssertEx() function, to compare two +** integer values in a signed context. The comparison is performed as two +** 32 bit signed integers and the numeric values are printed to the test log +** in standard decimal notation (base-10). +** +** \par Assumptions, External Events, and Notes: +** None +** +** \returns Test pass status, returns true if status was successful, false if it failed. +** +******************************************************************************/ +bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Compare_t CompareType, int32 ReferenceValue, const char *File, uint32 Line, + const char *Desc, const char *ActualText, const char *ReferenceText); /*****************************************************************************/ /** @@ -609,15 +696,10 @@ 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) CFE_UtAssert_SuccessCheck_Impl(FN, UTASSERT_CASETYPE_TSF, __FILE__, __LINE__, #FN) /*****************************************************************************/ /** @@ -631,56 +713,79 @@ 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) CFE_UtAssert_SuccessCheck_Impl(FN, UTASSERT_CASETYPE_FAILURE, __FILE__, __LINE__, #FN) /*****************************************************************************/ /** -** \brief Asserts the expected execution of the function being tested. +** \brief Asserts the specific status code from the function being tested. ** ** \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. +** This function and macro should be used to test for a specific status code +** from a function (typically an error case). ** ** \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))) +#define CFE_UtAssert_EQUAL(FN, EXP) CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_EQ, EXP, __FILE__, __LINE__, "", #FN, #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); +/*****************************************************************************/ +/** +** \brief Asserts the expression/function evaluates as logically true +** +** \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 for a function or value/expression +** that should evaluate as logically true +** +** \par Assumptions, External Events, and Notes: +** None +** +******************************************************************************/ +#define CFE_UtAssert_TRUE(FN) CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_BOOL, true, __FILE__, __LINE__, "", #FN, "true") /*****************************************************************************/ /** -** \brief Asserts the expected execution of the function being tested. +** \brief Asserts the expression/function evaluates as logically false ** ** \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. +** This function and macro should be used to test for a function or value/expression +** that should evaluate as logically false ** ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_TRUE, #EVTCNT, #EVTSENT, #REPORT, #TEARDOWN +******************************************************************************/ +#define CFE_UtAssert_FALSE(FN) CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_BOOL, false, __FILE__, __LINE__, "", #FN, "false") + +/*****************************************************************************/ +/** +** \brief Asserts the minimum value of a given function or expression +** +** \par Description +** This macro confirms that the given expression is at least the minimum value (inclusive) +** +** \par Assumptions, External Events, and Notes: +** None ** ******************************************************************************/ -#define ASSERT_TRUE(EXP) (UT_ASSERT_TRUE_impl(__FILE__, __LINE__, __func__, (#EXP), (EXP))) +#define CFE_UtAssert_ATLEAST(FN, MIN) CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_GTEQ, MIN, __FILE__, __LINE__, "", #FN, #MIN) -/** \brief Function to be called by the EVTCNT() macro */ -void UT_EVTCNT_impl(const char *FileName, int LineNum, const char *TestName, int32 CntExp); +/*****************************************************************************/ +/** +** \brief Asserts the maximum value of a given function or expression +** +** \par Description +** This macro confirms that the given expression is at most the maximum value (inclusive) +** +** \par Assumptions, External Events, and Notes: +** None +** +******************************************************************************/ +#define CFE_UtAssert_ATMOST(FN, MAX) CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_LTEQ, MAX, __FILE__, __LINE__, "", #FN, #MAX) /*****************************************************************************/ /** @@ -694,17 +799,12 @@ void UT_EVTCNT_impl(const char *FileName, int LineNum, const char *TestName, int ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTSENT, #REPORT, #TEARDOWN -** ******************************************************************************/ -#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_EVENTCOUNT(EXP) CFE_UtAssert_GenericSignedCompare_Impl(UT_GetNumEventsSent(), CFE_UtAssert_Compare_EQ, EXP, __FILE__, __LINE__, "Event Count: ", "Sent", "Expected") /*****************************************************************************/ /** -** \brief Ensures that the test generated the expected event. +** \brief Ensures that the code under test generated an expected event. ** ** \par Description ** Most tests will generate a number of events, and this function and macro check whether an @@ -713,13 +813,56 @@ void UT_EVTSENT_impl(const char *FileName, int LineNum, const char *TestName, co ** \par Assumptions, External Events, and Notes: ** None ** -** \sa #START, #SETUP, #ASSERT, #ASSERT_EQ, #ASSERT_TRUE, #EVTCNT, #REPORT, #TEARDOWN +** \sa #CFE_UtAssert_EVENTNOTSENT +** +******************************************************************************/ +#define CFE_UtAssert_EVENTSENT(EVT) CFE_UtAssert_GenericSignedCompare_Impl(UT_EventIsInHistory(EVT), CFE_UtAssert_Compare_GT, 0, __FILE__, __LINE__, "Event Generated: ", #EVT, "") + +/*****************************************************************************/ +/** +** \brief Ensures that the code under test did not generate an unexpected event. +** +** \par Description +** 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_EVENTSENT, and asserts that the +** code under test did NOT generate the given event ID. +** +** \par Assumptions, External Events, and Notes: +** None +** +** \sa #CFE_UtAssert_EVENTSENT +** +******************************************************************************/ +#define CFE_UtAssert_EVENTNOTSENT(EVT) CFE_UtAssert_GenericSignedCompare_Impl(UT_EventIsInHistory(EVT), CFE_UtAssert_Compare_EQ, 0, __FILE__, __LINE__, "Event Not Generated: ", #EVT, "") + +/*****************************************************************************/ +/** +** \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_SYSLOG(str) CFE_UtAssert_GenericSignedCompare_Impl(UT_SyslogIsInHistory(str), CFE_UtAssert_Compare_GT, 0, __FILE__, __LINE__, "Syslog generated: ", #str, "") + +/*****************************************************************************/ +/** +** \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 EVTSENT(EVT) (UT_EVTSENT_impl(__FILE__, __LINE__, __func__, (#EVT), (EVT))) +#define CFE_UtAssert_PRINTF(str) CFE_UtAssert_GenericSignedCompare_Impl(UT_PrintfIsInHistory(str), CFE_UtAssert_Compare_GT, 0, __FILE__, __LINE__, "Printf generated: ", #str, "") -/** \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. @@ -730,11 +873,38 @@ void UT_TEARDOWN_impl(const char *FileName, int LineNum, const char *TestName, c ** of any teardown steps result in a text message and the test being considered failed. ** ** \par Assumptions, External Events, and Notes: +** To keep logs clean, this only generates a log message if it fails +** +******************************************************************************/ +#define CFE_UtAssert_TEARDOWN(FN) CFE_UtAssert_SuccessCheck_Impl(FN, UTASSERT_CASETYPE_TTF, __FILE__, __LINE__, #FN) + +/*****************************************************************************/ +/** +** \brief Macro for logging calls to a "void" function +** +** \par Description +** 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) (func, UtAssert(true, #func, __FILE__, __LINE__)) + +/*****************************************************************************/ +/** +** \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) CFE_UtAssert_GenericUnsignedCompare_Impl(CFE_RESOURCEID_TO_ULONG(id1), CFE_UtAssert_Compare_EQ, CFE_RESOURCEID_TO_ULONG(id2), __FILE__, __LINE__, "Resource ID Check: ", #id1, #id2) #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..0bae5aa84 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -694,46 +694,132 @@ 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) +const char *CFE_UtAssert_GetOpText(CFE_UtAssert_Compare_t CompareType) { - UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TSF, FileName, LineNum, "%s - Setup - %s returned 0x%lx", - TestName, FnName, (long int)FnRet); -} + const char *OpText; -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); -} + switch (CompareType) + { + case CFE_UtAssert_Compare_EQ: /* actual equals reference value */ + case CFE_UtAssert_Compare_BOOL: /* actual and reference are logical boolean values */ + OpText = "=="; + break; + case CFE_UtAssert_Compare_NEQ: /* actual does not non equal reference value */ + OpText = "!="; + break; + case CFE_UtAssert_Compare_LT: /* actual less than reference (exclusive) */ + OpText = "<"; + break; + case CFE_UtAssert_Compare_GT: /* actual greater than reference (exclusive) */ + OpText = ">"; + break; + case CFE_UtAssert_Compare_LTEQ: /* actual less than or equal to reference (inclusive) */ + OpText = "<="; + break; + case CFE_UtAssert_Compare_GTEQ: /* actual greater than reference (inclusive) */ + OpText = ">="; + break; + default: /* should never happen */ + OpText = "??"; + break; + } -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); + return OpText; } -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) +bool CFE_UtAssert_SuccessCheck_Impl(CFE_Status_t Status, UtAssert_CaseType_t CaseType, const char *File, uint32 Line, const char *Text) { - int32 CntSent = UT_GetNumEventsSent(); + bool Result = (Status >= CFE_SUCCESS); + + if (!Result || (CaseType != UTASSERT_CASETYPE_TSF && CaseType != UTASSERT_CASETYPE_TTF)) + { + UtAssertEx(Result, CaseType, File, Line, "%s (0x%lx) == CFE_SUCCESS", Text, (unsigned long)Status); + } - UtAssertEx(CntSent == CntExp, UtAssert_GetContext(), FileName, LineNum, "%s - event count (sent %ld, expected %ld)", - TestName, (long int)CntSent, (long int)CntExp); + return Result; } -void UT_EVTSENT_impl(const char *FileName, int LineNum, const char *TestName, const char *EvtName, int32 EvtId) +bool CFE_UtAssert_GenericUnsignedCompare_Impl(uint32 ActualValue, CFE_UtAssert_Compare_t CompareType, uint32 ReferenceValue, const char *File, uint32 Line, + const char *Desc, const char *ActualText, const char *ReferenceText) { - UtAssertEx(UT_EventIsInHistory(EvtId), UtAssert_GetContext(), FileName, LineNum, "%s - sent event %s [%ld]", - TestName, EvtName, (long int)EvtId); + bool Result; + + switch (CompareType) + { + case CFE_UtAssert_Compare_EQ: /* actual equals reference value */ + Result = (ActualValue == ReferenceValue); + break; + case CFE_UtAssert_Compare_NEQ: /* actual does not non equal reference value */ + Result = (ActualValue != ReferenceValue); + break; + case CFE_UtAssert_Compare_LT: /* actual less than reference (exclusive) */ + Result = (ActualValue < ReferenceValue); + break; + case CFE_UtAssert_Compare_GT: /* actual greater than reference (exclusive) */ + Result = (ActualValue > ReferenceValue); + break; + case CFE_UtAssert_Compare_LTEQ: /* actual less than or equal to reference (inclusive) */ + Result = (ActualValue <= ReferenceValue); + break; + case CFE_UtAssert_Compare_GTEQ: /* actual greater than reference (inclusive) */ + Result = (ActualValue >= ReferenceValue); + break; + case CFE_UtAssert_Compare_BOOL: /* actual and reference are logical boolean values */ + Result = ActualValue; + if (!ReferenceValue) + { + /* Invert the result if reference is false */ + Result = !Result; + } + break; + default: /* should never happen */ + Result = false; + break; + } + + return UtAssertEx(Result, UTASSERT_CASETYPE_FAILURE, File, Line, "%s%s (0x%lx) %s %s (0x%lx)", + Desc, ActualText, (unsigned long)ActualValue, CFE_UtAssert_GetOpText(CompareType), ReferenceText, (unsigned long)ReferenceValue); } -void UT_TEARDOWN_impl(const char *FileName, int LineNum, const char *TestName, const char *FnName, int32 FnRet) +bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Compare_t CompareType, int32 ReferenceValue, const char *File, uint32 Line, + const char *Desc, const char *ActualText, const char *ReferenceText) { - UtAssertEx(FnRet == CFE_SUCCESS, UTASSERT_CASETYPE_TTF, FileName, LineNum, - "%s - Teardown failed (%s returned 0x%lx)", TestName, FnName, (long int)FnRet); + bool Result; + + switch (CompareType) + { + case CFE_UtAssert_Compare_EQ: /* actual equals reference value */ + Result = (ActualValue == ReferenceValue); + break; + case CFE_UtAssert_Compare_NEQ: /* actual does not non equal reference value */ + Result = (ActualValue != ReferenceValue); + break; + case CFE_UtAssert_Compare_LT: /* actual less than reference (exclusive) */ + Result = (ActualValue < ReferenceValue); + break; + case CFE_UtAssert_Compare_GT: /* actual greater than reference (exclusive) */ + Result = (ActualValue > ReferenceValue); + break; + case CFE_UtAssert_Compare_LTEQ: /* actual less than or equal to reference (inclusive) */ + Result = (ActualValue <= ReferenceValue); + break; + case CFE_UtAssert_Compare_GTEQ: /* actual greater than reference (inclusive) */ + Result = (ActualValue >= ReferenceValue); + break; + case CFE_UtAssert_Compare_BOOL: /* actual and reference are logical boolean values */ + Result = ActualValue; + if (!ReferenceValue) + { + /* Invert the result if reference is false */ + Result = !Result; + } + break; + default: /* should never happen */ + Result = false; + break; + } + + return UtAssertEx(Result, UTASSERT_CASETYPE_FAILURE, File, Line, "%s%s (%ld) %s %s (%ld)", + Desc, ActualText, (long)ActualValue, CFE_UtAssert_GetOpText(CompareType), ReferenceText, (long)ReferenceValue); } 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..2d0ccaf67 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_TRUE(UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[8])); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 2); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 1); + CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(MsgData.MsgId, ShortFmtSnapshotData.MsgId)); + CFE_UtAssert_TRUE(!CFE_SB_MsgId_Equal(MsgData.MsgId, LongFmtSnapshotData.MsgId)); /* Confirm the right message was sent */ - ASSERT_TRUE(MsgSend == MsgData.MsgPtr); + CFE_UtAssert_TRUE(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..66278be78 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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); is_v1 = !hassec; /* Set up return */ @@ -71,66 +71,66 @@ 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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); + CFE_UtAssert_EQUAL(edsver, CFE_PLATFORM_EDSVER); /* Default subsystem check */ - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); if (is_v1) - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); + CFE_UtAssert_EQUAL(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); else - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS & TEST_DEFAULT_SUBSYS_MASK); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); + CFE_UtAssert_EQUAL(system, sc_id); /* Default endian check */ - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); #if (CFE_PLATFORM_ENDIAN == CCSDS_LITTLE_ENDIAN) - ASSERT_EQ(endian, CFE_MSG_Endian_Little); + CFE_UtAssert_EQUAL(endian, CFE_MSG_Endian_Little); #else - ASSERT_EQ(endian, CFE_MSG_Endian_Big); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &edsver), CFE_SUCCESS); + CFE_UtAssert_EQUAL(edsver, CFE_PLATFORM_EDSVER); /* Default system check */ - ASSERT_EQ(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); - ASSERT_EQ(system, sc_id); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &system), CFE_SUCCESS); + CFE_UtAssert_EQUAL(system, sc_id); /* Default endian check */ - ASSERT_EQ(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &endian), CFE_SUCCESS); #if (CFE_PLATFORM_ENDIAN == CCSDS_LITTLE_ENDIAN) - ASSERT_EQ(endian, CFE_MSG_Endian_Little); + CFE_UtAssert_EQUAL(endian, CFE_MSG_Endian_Little); #else - ASSERT_EQ(endian, CFE_MSG_Endian_Big); + CFE_UtAssert_EQUAL(endian, CFE_MSG_Endian_Big); #endif /* Default subsystem check */ - ASSERT_EQ(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &subsys), CFE_SUCCESS); if (is_v1) - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); + CFE_UtAssert_EQUAL(subsys, CFE_PLATFORM_DEFAULT_SUBSYS); else - ASSERT_EQ(subsys, CFE_PLATFORM_DEFAULT_SUBSYS | ((msgidval_exp >> 8) & 0xFF)); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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 +142,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_EDSVER_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetEDSVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetEDSVersion(&msg, TEST_EDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetEDSVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_EDSVER_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_EDSVER_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_EDSVER_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), MSG_EDSVER_FLAG); } } @@ -176,19 +176,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetEDSVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_EDSVER_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_EDSVER_FLAG); } } } @@ -202,33 +202,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetEndian(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Invalid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetEndian(&msg, CFE_MSG_Endian_Little + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_Endian_Little); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_Endian_Little) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_ENDIAN_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), MSG_ENDIAN_FLAG); } } @@ -236,19 +236,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_Endian_Big); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetEndian(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_Endian_Big) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_ENDIAN_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_ENDIAN_FLAG); } } } @@ -262,33 +262,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetPlaybackFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Invalid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetPlaybackFlag(&msg, CFE_MSG_PlayFlag_Playback + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_PlayFlag_Playback); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_PlayFlag_Playback) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_PBACK_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), MSG_PBACK_FLAG); } } @@ -296,19 +296,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_PlayFlag_Original); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetPlaybackFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_PlayFlag_Original) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_PBACK_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_PBACK_FLAG); } } } @@ -322,33 +322,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_SUBSYS_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSubsystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetSubsystem(&msg, TEST_SUBSYS_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSubsystem(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_SUBSYS_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_SUBSYS_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SUBSYS_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), MSG_SUBSYS_FLAG); } } @@ -356,19 +356,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSubsystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SUBSYS_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_SUBSYS_FLAG); } } } @@ -382,30 +382,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_SYSTEM_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSystem(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_SYSTEM_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_SYSTEM_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SYSTEM_FLAG); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), MSG_SYSTEM_FLAG); } } @@ -413,19 +413,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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSystem(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SYSTEM_FLAG); + CFE_UtAssert_EQUAL(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..a98244e45 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(&msg, 0), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(&msg, TEST_MSG_SIZE_OFFSET - 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(&msg, 0xFFFF + TEST_MSG_SIZE_OFFSET + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0xFFFF + TEST_MSG_SIZE_OFFSET); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0xFFFF + TEST_MSG_SIZE_OFFSET) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_LENGTH_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_MSG_SIZE_OFFSET); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_MSG_SIZE_OFFSET) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_LENGTH_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Invalid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_Type_Cmd); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_Type_Cmd) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_TYPE_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_Type_Tlm); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_Type_Tlm) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_CCSDSVER_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetHeaderVersion(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetHeaderVersion(&msg, TEST_CCSDSVER_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetHeaderVersion(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_CCSDSVER_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_CCSDSVER_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_HDRVER_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_HDRVER_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, true); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, false); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, false); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, false), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, false); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); - ASSERT_EQ(CFE_MSG_SetHasSecondaryHeader(&msg, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_APID_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetApId(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetApId(&msg, TEST_APID_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetApId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_APID_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_APID_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_APID_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, CFE_MSG_SegFlag_Invalid); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSegmentationFlag(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Invalid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSegmentationFlag(&msg, CFE_MSG_SegFlag_Unsegmented + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_SegFlag_Unsegmented); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_SegFlag_Unsegmented) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SEGMENT_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, CFE_MSG_SegFlag_Continue); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == CFE_MSG_SegFlag_Continue) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SEGMENT_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_SEQUENCE_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSequenceCount(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetSequenceCount(&msg, TEST_SEQUENCE_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetSequenceCount(&msg, maxsc), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_SEQUENCE_MAX); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == TEST_SEQUENCE_MAX) { - ASSERT_EQ(Test_MSG_NotF(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotF(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotF(&msg), MSG_SEQUENCE_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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]); + CFE_UtAssert_EQUAL(CFE_MSG_GetSequenceCount(&msg, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); if (input[i] == 0) { - ASSERT_EQ(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); } else { - ASSERT_EQ(Test_MSG_NotZero(&msg), MSG_SEQUENCE_FLAG); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetNextSequenceCount(0), 1); + CFE_UtAssert_EQUAL(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX / 2), (TEST_SEQUENCE_MAX / 2) + 1); + CFE_UtAssert_EQUAL(CFE_MSG_GetNextSequenceCount(TEST_SEQUENCE_MAX), 0); + CFE_UtAssert_EQUAL(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..0ac3f4c5b 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); + CFE_UtAssert_EQUAL(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, false); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetSize(msgptr, sizeof(cmd)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, false); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, true); + CFE_UtAssert_EQUAL(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..2652804f6 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual, TEST_FCNCODE_MAX); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(msgptr), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetFcnCode(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetFcnCode(msgptr, TEST_FCNCODE_MAX + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(msgptr), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetFcnCode(msgptr, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetFcnCode(msgptr, 0), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, TEST_FCNCODE_MAX); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetFcnCode(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual, input[i]); + CFE_UtAssert_EQUAL(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..ed781bcd2 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_UtAssert_EQUAL(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_Init(&cmd.Msg, CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); + CFE_UtAssert_EQUAL(size, sizeof(cmd)); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(apid, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); + CFE_UtAssert_EQUAL(hdrver, CFE_MISSION_CCSDSVER); } else { - ASSERT_EQ(apid, 0); - ASSERT_EQ(hdrver, 0); + CFE_UtAssert_EQUAL(apid, 0); + CFE_UtAssert_EQUAL(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), + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&cmd.Msg, &msgid_act), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid_act), msgidval_exp); + CFE_UtAssert_EQUAL(CFE_MSG_GetSize(&cmd.Msg, &size), CFE_SUCCESS); + CFE_UtAssert_EQUAL(size, sizeof(cmd)); + CFE_UtAssert_EQUAL(CFE_MSG_GetSegmentationFlag(&cmd.Msg, &segflag), CFE_SUCCESS); + CFE_UtAssert_EQUAL(segflag, CFE_MSG_SegFlag_Unsegmented); + + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&cmd.Msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(apid & TEST_DEFAULT_APID_MASK, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); + CFE_UtAssert_EQUAL(hdrver, CFE_MISSION_CCSDSVER); } else { - ASSERT_EQ(apid, 0x7FF); - ASSERT_EQ(hdrver, 0); + CFE_UtAssert_EQUAL(apid, 0x7FF); + CFE_UtAssert_EQUAL(hdrver, 0); } - ASSERT_EQ(Test_MSG_Pri_NotZero(&cmd.Msg) & ~MSG_HDRVER_FLAG, + CFE_UtAssert_EQUAL(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..42e4eda4a 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetTypeFromMsgId(msgid, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(&msg, CFE_MSG_Type_Tlm), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetTypeFromMsgId(msgid, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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..1b02582a2 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 1); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, 0xFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0xFFFF); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | MSG_HASSEC_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(apid, TEST_MAX_APID); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + CFE_UtAssert_EQUAL(type, CFE_MSG_Type_Cmd); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(TEST_MAX_APID)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0800)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x1000)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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..3fd0fa0ce 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,66 @@ 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(NULL, &msgid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 1); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(NULL, msgid), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_INVALID_MSG_ID), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_PLATFORM_SB_HIGHEST_VALID_MSGID + 1), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, 0xFFFFFFFF), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0xFFFF); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(msgid), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_APID_FLAG | MSG_TYPE_FLAG | local_subsys_flag); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(apid, 0x7F); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x007F)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_APID_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetApId(&msg, &apid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x0080)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(&msg), MSG_TYPE_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetType(&msg, &type), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0xFF00 & CFE_PLATFORM_SB_HIGHEST_VALID_MSGID)), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgId(&msg, &msgid), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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..aad867738 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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(NULL, &actual), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(actual.Seconds, 0xFFFFFFFF); + CFE_UtAssert_EQUAL(actual.Subseconds, 0xFFFFFFFF); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(msgptr), 0); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgTime(NULL, input[0]), CFE_MSG_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(msgptr), 0); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual.Seconds, 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_SetMsgTime(msgptr, actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); + CFE_UtAssert_EQUAL(actual.Seconds, 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual.Seconds, 0xFFFFFFFF); + CFE_UtAssert_EQUAL(actual.Subseconds, 0xFFFF0000); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual.Seconds, input[i].Seconds); + CFE_UtAssert_EQUAL(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_SetHasSecondaryHeader(msgptr, true), CFE_SUCCESS); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual.Seconds, 0); + CFE_UtAssert_EQUAL(actual.Subseconds, 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_MSG_GetMsgTime(msgptr, &actual), CFE_SUCCESS); + CFE_UtAssert_EQUAL(actual.Seconds, input[i].Seconds); + CFE_UtAssert_EQUAL(actual.Subseconds, input[i].Subseconds & 0xFFFF0000); + CFE_UtAssert_EQUAL(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..c9974d5e9 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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_AppInit(), CFE_SB_PIPE_CR_ERR); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_CR_PIPE_ERR_EID); + CFE_UtAssert_EVENTSENT(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); + CFE_UtAssert_EQUAL(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); - EVTCNT(3); + CFE_UtAssert_EVENTCOUNT(3); - EVTSENT(CFE_SB_DEST_BLK_ERR_EID); + CFE_UtAssert_EVENTSENT(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); + CFE_UtAssert_EQUAL(CFE_SB_AppInit(), CFE_SB_BUF_ALOC_ERR); - EVTCNT(4); + CFE_UtAssert_EVENTCOUNT(4); - EVTSENT(CFE_SB_DEST_BLK_ERR_EID); + CFE_UtAssert_EVENTSENT(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_INIT_EID); - EVTSENT(CFE_SB_Q_RD_ERR_EID); + CFE_UtAssert_EVENTSENT(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_EVENTSENT(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_EVENTSENT(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_EVENTSENT(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_EVENTSENT(CFE_SB_INIT_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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_EVENTSENT(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_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_RoutingInfoSpec */ @@ -577,31 +577,31 @@ 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)); + CFE_UtAssert_TRUE(!CFE_SB_WriteRouteInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + CFE_UtAssert_TRUE(CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); 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 +628,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_EVENTSENT(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 +644,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_EVENTSENT(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 +676,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_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_PipeInfoAlreadyPending */ @@ -695,31 +695,31 @@ 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)); + CFE_UtAssert_TRUE(!CFE_SB_WritePipeInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); - ASSERT_TRUE(!CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize)); + CFE_UtAssert_TRUE(!CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize)); + CFE_UtAssert_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize)); + CFE_UtAssert_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize)); 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 +733,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_EVENTSENT(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_EVENTSENT(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_EVENTSENT(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_EVENTSENT(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 +772,32 @@ 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)); + CFE_UtAssert_TRUE(!CFE_SB_WriteMsgMapInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - ASSERT_TRUE(CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + CFE_UtAssert_TRUE(CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); 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 +830,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +855,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_EVENTSENT(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 +887,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_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); } /* end Test_SB_Cmds_MapInfoSpec */ @@ -915,22 +915,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_ENBL_RTE2_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_ENBL_RTE2_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_Cmds_EnRouteValParam */ @@ -956,22 +956,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +998,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_EVENTSENT(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam */ @@ -1027,9 +1027,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_EVENTSENT(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam2 */ @@ -1057,9 +1057,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_EVENTSENT(CFE_SB_ENBL_RTE3_EID); } /* end Test_SB_Cmds_EnRouteInvParam3 */ @@ -1084,22 +1084,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_DSBL_RTE2_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_DSBL_RTE2_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_Cmds_DisRouteValParam */ @@ -1124,22 +1124,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +1166,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_EVENTSENT(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam */ @@ -1195,9 +1195,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_EVENTSENT(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam2 */ @@ -1225,9 +1225,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_EVENTSENT(CFE_SB_DSBL_RTE3_EID); } /* end Test_SB_Cmds_DisRouteInvParam3 */ @@ -1256,9 +1256,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_EVENTSENT(CFE_SB_SEND_NO_SUBS_EID); } /* end Test_SB_Cmds_SendHK */ @@ -1284,8 +1284,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 +1302,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 +1332,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); + CFE_UtAssert_TRUE(UT_GetNumEventsSent() > NumEvts); } else { - EVTCNT(NumEvts); + CFE_UtAssert_EVENTCOUNT(NumEvts); } /* Round out the number to three full pkts in order to test branch path @@ -1344,11 +1344,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 +1374,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); + CFE_UtAssert_TRUE(UT_GetNumEventsSent() > 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_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_FULL_SUB_PKT_EID); + CFE_UtAssert_EVENTSENT(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 +1411,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 +1435,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 +1453,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_EVENTSENT(CFE_SB_BAD_CMD_CODE_EID); } /* end Test_SB_Cmds_UnexpCmdCode */ @@ -1479,9 +1479,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_EVENTSENT(CFE_SB_LEN_ERR_EID); } /* end Test_SB_Cmds_BadCmdLength */ @@ -1496,9 +1496,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_EVENTSENT(CFE_SB_BAD_MSGID_EID); } /* end Test_SB_Cmds_UnexpMsgId */ @@ -1564,11 +1564,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_CR_PIPE_BAD_ARG_EID); } /* end Test_CreatePipe_NullPtr */ @@ -1579,15 +1579,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_EVENTSENT(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 +1599,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); + CFE_UtAssert_EQUAL(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_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_CR_PIPE_BAD_ARG_EID); } /* end Test_CreatePipe_InvalPipeDepth */ @@ -1632,20 +1632,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); + CFE_UtAssert_EQUAL(CFE_SB_CreatePipe(&PipeIdReturned[i], PipeDepth, PipeName), CFE_SB_MAX_PIPES_MET); } } - EVTSENT(CFE_SB_MAX_PIPES_MET_EID); + CFE_UtAssert_EVENTSENT(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 +1654,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))); + CFE_UtAssert_TRUE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(1))); + CFE_UtAssert_TRUE(!CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(2))); } /* end Test_CreatePipe_MaxPipes */ @@ -1674,21 +1674,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); + CFE_UtAssert_EQUAL(CFE_SB_CreatePipe(&PipeId, PipeDepth, PipeName), CFE_SB_PIPE_CR_ERR); - ASSERT_TRUE(CFE_RESOURCEID_TEST_EQUAL(PipeId, FirstPipeId)); + CFE_UtAssert_TRUE(CFE_RESOURCEID_TEST_EQUAL(PipeId, FirstPipeId)); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_CR_PIPE_NAME_TAKEN_EID); + CFE_UtAssert_EVENTSENT(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 +1711,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_DELETED_EID); } /* end Test_DeletePipe_NoSubs */ @@ -1733,17 +1733,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_DELETED_EID); } /* end Test_DeletePipe_WithSubs */ @@ -1754,11 +1754,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); + CFE_UtAssert_EQUAL(CFE_SB_DeletePipe(PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_DEL_PIPE_ERR1_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_DEL_PIPE_ERR1_EID); } /* end Test_DeletePipe_InvalidPipeId */ @@ -1772,7 +1772,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 +1780,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); + CFE_UtAssert_EQUAL(CFE_SB_DeletePipe(PipedId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_DEL_PIPE_ERR2_EID); + CFE_UtAssert_EVENTSENT(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 +1801,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 +1844,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")); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeName(NULL, OS_MAX_API_NAME, PipeId), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPENAME_NULL_PTR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPENAME_NULL_PTR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName_NullPtr */ @@ -1861,14 +1861,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); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPENAME_ID_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPENAME_ID_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName_InvalidId */ @@ -1882,15 +1882,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_EVENTSENT(CFE_SB_GETPIPENAME_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeName */ @@ -1911,13 +1911,13 @@ void Test_GetPipeIdByName_NullPtrs(void) { CFE_SB_PipeId_t PipeIDOut; - ASSERT_EQ(CFE_SB_GetPipeIdByName(&PipeIDOut, NULL), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeIdByName(&PipeIDOut, NULL), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); - ASSERT_EQ(CFE_SB_GetPipeIdByName(NULL, "invalid"), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeIdByName(NULL, "invalid"), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPEIDBYNAME_NULL_ERR_EID); } /* end Test_GetPipeIdByName_NullPtrs */ @@ -1929,9 +1929,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); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeIdByName(&PipeIdOut, "invalid"), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID); } /* end Test_GetPipeIdByName_InvalidName */ @@ -1943,16 +1943,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_EVENTSENT(CFE_SB_GETPIPEIDBYNAME_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_GetPipeIdByName */ @@ -1961,9 +1961,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); + CFE_UtAssert_EQUAL(CFE_SB_SetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, 0), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_SETPIPEOPTS_ID_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SETPIPEOPTS_ID_ERR_EID); } /* end Test_SetPipeOpts_BadID */ @@ -1976,20 +1976,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); + CFE_UtAssert_EQUAL(CFE_SB_SetPipeOpts(PipeID, 0), CFE_SB_BAD_ARGUMENT); PipeDscPtr->AppId = OrigOwner; - EVTSENT(CFE_SB_SETPIPEOPTS_OWNER_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SETPIPEOPTS_OWNER_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_SetPipeOpts_NotOwner */ @@ -2000,13 +2000,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_EVENTSENT(CFE_SB_SETPIPEOPTS_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_SetPipeOpts */ @@ -2017,9 +2017,9 @@ void Test_GetPipeOpts_BadID(void) { uint8 Opts = 0; - ASSERT_EQ(CFE_SB_GetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, &Opts), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeOpts(SB_UT_ALTERNATE_INVALID_PIPEID, &Opts), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEOPTS_ID_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPEOPTS_ID_ERR_EID); } /* end Test_GetPipeOpts_BadID */ @@ -2030,13 +2030,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); + CFE_UtAssert_EQUAL(CFE_SB_GetPipeOpts(PipeID, NULL), CFE_SB_BAD_ARGUMENT); - EVTSENT(CFE_SB_GETPIPEOPTS_PTR_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_GETPIPEOPTS_PTR_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_GetPipeOpts_BadPtr */ @@ -2048,13 +2048,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_EVENTSENT(CFE_SB_GETPIPEOPTS_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeID)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeID)); } /* end Test_GetPipeOpts */ @@ -2088,16 +2088,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_SubscribeEx */ @@ -2109,11 +2109,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); + CFE_UtAssert_EQUAL(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_SUB_INV_PIPE_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUB_INV_PIPE_EID); } /* end Test_Subscribe_InvalidPipeId */ @@ -2126,15 +2126,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); + CFE_UtAssert_EQUAL(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EVENTCOUNT(3); - EVTSENT(CFE_SB_SUB_ARG_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUB_ARG_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_InvalidMsgId */ @@ -2149,16 +2149,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_MaxMsgLim */ @@ -2171,17 +2171,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_DUP_SUBSCRIP_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_DuplicateSubscription */ @@ -2195,16 +2195,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_Subscribe_LocalSubscription */ @@ -2223,7 +2223,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 +2231,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(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 +2263,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); + CFE_UtAssert_EQUAL(CFE_SB_Subscribe(CFE_SB_ValueToMsgId(i), PipeId2), CFE_SB_MAX_MSGS_MET); } } - EVTSENT(CFE_SB_MAX_MSGS_MET_EID); + CFE_UtAssert_EVENTSENT(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 +2307,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 +2324,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_EVENTSENT(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 +2344,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); + CFE_UtAssert_EQUAL(CFE_SB_Subscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_SUB_INV_PIPE_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUB_INV_PIPE_EID); } /* end Test_Subscribe_PipeNonexistent */ @@ -2364,7 +2364,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 +2376,22 @@ 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_EVENTSENT(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 +2406,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 +2416,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_EVENTSENT(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 +2451,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_EVENTSENT(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_EVENTSENT(CFE_SB_UNSUB_NO_SUBS_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_Basic */ @@ -2479,16 +2479,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_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_Local */ @@ -2503,16 +2503,16 @@ 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); + CFE_UtAssert_EQUAL(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_UtAssert_EQUAL(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. @@ -2523,17 +2523,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_UNSUB_ARG_ERR_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_UNSUB_INV_PIPE_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_InvalParam */ @@ -2547,21 +2547,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_EVENTSENT(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_EVENTSENT(CFE_SB_UNSUB_NO_SUBS_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_NoMatch */ @@ -2574,16 +2574,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_UNSUB_INV_PIPE_EID); - TEARDOWN(CFE_SB_DeletePipe(TestPipe)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(TestPipe)); } /* end Test_Unsubscribe_InvalidPipe */ @@ -2598,9 +2598,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 +2608,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); + CFE_UtAssert_EQUAL(CFE_SB_Unsubscribe(MsgId, PipeId), CFE_SB_BAD_ARGUMENT); - EVTCNT(3); + CFE_UtAssert_EVENTCOUNT(3); - EVTSENT(CFE_SB_UNSUB_INV_CALLER_EID); + CFE_UtAssert_EVENTSENT(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 +2632,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_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +2664,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_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +2696,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); + CFE_UtAssert_TRUE(CFE_SB_GetDestPtr(RouteId, TestPipe2) == NULL); - EVTCNT(5); + CFE_UtAssert_EVENTCOUNT(5); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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 +2746,11 @@ void Test_TransmitMsg_API(void) */ void Test_TransmitMsg_NullPtr(void) { - ASSERT_EQ(CFE_SB_TransmitMsg(NULL, true), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_TransmitMsg(NULL, true), CFE_SB_BAD_ARGUMENT); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_SEND_BAD_ARG_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SEND_BAD_ARG_EID); } /* end Test_TransmitMsg_NullPtr */ @@ -2766,11 +2766,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_EVENTSENT(CFE_SB_SEND_NO_SUBS_EID); } /* end Test_TransmitMsg_NoSubscribers */ @@ -2786,11 +2786,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_MSG_TOO_BIG_EID); } /* end Test_TransmitMsg_MaxMsgSizePlusOne */ @@ -2806,17 +2806,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 +2848,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 +2858,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)); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 1); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); + CFE_UtAssert_EQUAL(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); + /* CFE_UtAssert_SUCCESS sequence count wasn't set */ + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 1); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(SeqCnt, SeqCntExpected); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 2); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 2); - EVTCNT(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTCOUNT(2); + CFE_UtAssert_EVENTSENT(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 */ + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 3); + CFE_UtAssert_EQUAL(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 */ + CFE_UtAssert_EQUAL(SeqCnt, SeqCntExpected); + CFE_UtAssert_EQUAL(UT_GetStubCount(UT_KEY(CFE_MSG_SetSequenceCount)), 4); + CFE_UtAssert_EQUAL(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 +2924,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_EVENTSENT(CFE_SB_Q_WR_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId4Error)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId4Error)); } /* end Test_TransmitMsg_QueuePutError */ @@ -2953,14 +2953,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 +2970,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_EVENTSENT(CFE_SB_Q_FULL_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_PipeFull */ @@ -2992,7 +2992,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 +3002,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 +3011,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_EVENTSENT(CFE_SB_MSGID_LIM_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_MsgLimitExceeded */ @@ -3033,8 +3033,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 +3042,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_GET_BUF_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_GetPoolBufErr */ @@ -3065,9 +3065,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); + CFE_UtAssert_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) == NULL); - 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 +3078,14 @@ 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); + CFE_UtAssert_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) != NULL); - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, MemUse + 10); /* unchanged */ - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, MemUse); /* predicted value */ + CFE_UtAssert_EQUAL(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, MemUse + 10); /* unchanged */ + CFE_UtAssert_EQUAL(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, MemUse); /* predicted value */ - ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakSBBuffersInUse, CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse + 1); + CFE_UtAssert_EQUAL(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 +3107,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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_ZeroCopyBufferValidate(SendPtr, &BufDscPtr), CFE_SUCCESS); /* Confirm that the computed pointer was correct */ - ASSERT_TRUE(&BufDscPtr->Content == SendPtr); + CFE_UtAssert_TRUE(&BufDscPtr->Content == SendPtr); /* Clean-up */ CFE_SB_ReleaseMessageBuffer(SendPtr); @@ -3140,9 +3140,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 +3157,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); + CFE_UtAssert_TRUE(SendPtr == ReceivePtr); - ASSERT_EQ(SeqCnt, 1); + CFE_UtAssert_EQUAL(SeqCnt, 1); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* @@ -3190,8 +3190,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 +3205,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); + CFE_UtAssert_TRUE(SendPtr == ReceivePtr); + CFE_UtAssert_EQUAL(SeqCnt, 22); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* @@ -3232,25 +3232,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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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 +3270,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 +3281,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_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_TransmitMsg_DisabledDestination */ @@ -3307,17 +3307,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 +3336,13 @@ 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); + CFE_UtAssert_EQUAL(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn), CFE_SB_MSG_TOO_BIG); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); + CFE_UtAssert_EQUAL(SizeRtn, Size); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_MSG_TOO_BIG_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_MSG_TOO_BIG_EID); } /* @@ -3360,14 +3360,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)); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(MsgIdRtn), CFE_SB_MsgIdToValue(MsgId)); + CFE_UtAssert_EQUAL(SizeRtn, Size); + CFE_UtAssert_TRUE(!CFE_SBR_IsValidRouteId(RouteIdRtn)); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_SEND_NO_SUBS_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SEND_NO_SUBS_EID); } /* @@ -3392,11 +3392,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_BAD_PIPEID_EID); } /* end Test_ReceiveBuffer_InvalidPipeId */ @@ -3410,15 +3410,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_RCV_BAD_ARG_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_InvalidTimeout */ @@ -3431,15 +3431,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_Poll */ @@ -3453,16 +3453,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); + CFE_UtAssert_EQUAL(CFE_SB_ReceiveBuffer(&SBBufPtr, PipeId, TimeOut), CFE_SB_TIME_OUT); - EVTCNT(1); + CFE_UtAssert_EVENTCOUNT(1); - EVTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_Timeout */ @@ -3475,15 +3475,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_Q_RD_ERR_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_PipeReadError */ @@ -3500,22 +3500,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); + CFE_UtAssert_TRUE(SBBufPtr != NULL); - EVTCNT(2); + CFE_UtAssert_EVENTCOUNT(2); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_PendForever */ @@ -3537,7 +3537,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 +3573,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); - EVTSENT(CFE_SB_PIPE_DELETED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_PIPE_DELETED_EID); } /* end Test_CleanupApp_API */ @@ -3589,15 +3589,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); + CFE_UtAssert_EQUAL(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_EVENTSENT(CFE_SB_RCV_BAD_ARG_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_ReceiveBuffer_InvalidBufferPtr */ @@ -3626,26 +3626,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)); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_MsgHdrSize(&msg), 0); } /* end Test_CFE_SB_MsgHdrSize */ @@ -3755,7 +3755,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)); + CFE_UtAssert_EQUAL(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 +3772,11 @@ void Test_CFE_SB_ValidateMsgId(void) /* Validate Msg Id */ MsgId = SB_UT_LAST_VALID_MID; - ASSERT_EQ(CFE_SB_ValidateMsgId(MsgId), CFE_SUCCESS); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_ValidateMsgId(MsgId), CFE_SB_FAILED); } /* @@ -3809,16 +3809,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_EVENTSENT(CFE_SB_PIPE_ADDED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_OS_MutSemTake_ErrLogic */ @@ -3835,14 +3835,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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_DENIED); - EVTCNT(0); + CFE_UtAssert_EVENTCOUNT(0); } /* end Test_ReqToSendEvent_ErrLogic */ @@ -3852,9 +3852,9 @@ void Test_ReqToSendEvent_ErrLogic(void) */ void Test_PutDestBlk_ErrLogic(void) { - ASSERT_EQ(CFE_SB_PutDestinationBlk(NULL), CFE_SB_BAD_ARGUMENT); + CFE_UtAssert_EQUAL(CFE_SB_PutDestinationBlk(NULL), CFE_SB_BAD_ARGUMENT); - EVTCNT(0); + CFE_UtAssert_EVENTCOUNT(0); } /* end Test_PutDestBlk_ErrLogic */ @@ -3871,9 +3871,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); + CFE_UtAssert_EQUAL(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 +3882,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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, 0); - EVTCNT(0); + CFE_UtAssert_EVENTCOUNT(0); } /* end Test_CFE_SB_Buffers */ @@ -3912,26 +3912,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); + CFE_UtAssert_EQUAL(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( + CFE_UtAssert_EQUAL( 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 +3968,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_TRUE(!UT_EventIsInHistory(CFE_SB_SEND_NO_SUBS_EID)); + CFE_UtAssert_EQUAL(CFE_SB_Global.HKTlmMsg.Payload.NoSubscribersCounter, 1); /* Repress get buffer error */ CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter = 0; @@ -3987,11 +3987,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); + CFE_UtAssert_EQUAL(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 0); - ASSERT_TRUE(!UT_EventIsInHistory(CFE_SB_GET_BUF_ERR_EID)); + CFE_UtAssert_TRUE(!UT_EventIsInHistory(CFE_SB_GET_BUF_ERR_EID)); - EVTCNT(0); + CFE_UtAssert_EVENTCOUNT(0); CFE_SB_Global.StopRecurseFlags[1] = 0; @@ -3999,20 +3999,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); + CFE_UtAssert_EQUAL(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 +4026,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_TRUE(!UT_EventIsInHistory(CFE_SB_MSGID_LIM_ERR_EID)); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ @@ -4063,15 +4063,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 +4080,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_TRUE(!UT_EventIsInHistory(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 +4101,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 +4110,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_TRUE(!UT_EventIsInHistory(CFE_SB_Q_WR_ERR_EID)); - TEARDOWN(CFE_SB_DeletePipe(PipeId)); + CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); } /* end Test_SB_TransmitMsgPaths */ @@ -4138,19 +4138,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 +4168,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); + CFE_UtAssert_TRUE(SBBufPtr != NULL); - EVTCNT(4); + CFE_UtAssert_EVENTCOUNT(4); - EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); - EVTSENT(CFE_SB_SUBSCRIPTION_REMOVED_EID); + CFE_UtAssert_EVENTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + CFE_UtAssert_EVENTSENT(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..d9c673abd 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); + CFE_UtAssert_EQUAL(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SBR_SetRouteId(msgid, routeid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SBR_SetRouteId(msgid, routeid), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SBR_SetRouteId(msgid, routeid), 0); + CFE_UtAssert_EQUAL(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); + CFE_UtAssert_EQUAL(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..f7a8a8110 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); + CFE_UtAssert_EQUAL(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(collisions, 0); routeid[1] = CFE_SBR_AddRoute(msgid[1], &collisions); - ASSERT_EQ(collisions, 0); + CFE_UtAssert_EQUAL(collisions, 0); routeid[2] = CFE_SBR_AddRoute(msgid[2], &collisions); - ASSERT_EQ(collisions, 2); + CFE_UtAssert_EQUAL(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])); + CFE_UtAssert_EQUAL(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[0])), CFE_SBR_RouteIdToValue(routeid[0])); + CFE_UtAssert_EQUAL(CFE_SBR_RouteIdToValue(CFE_SBR_GetRouteId(msgid[1])), CFE_SBR_RouteIdToValue(routeid[1])); + CFE_UtAssert_EQUAL(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..b783f9a60 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); + CFE_UtAssert_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL))); + CFE_UtAssert_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions))); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(collisions, 0); + CFE_UtAssert_TRUE(CFE_SBR_IsValidRouteId(routeid)); UtPrintf("Callback test with one route"); count = 0; CFE_SBR_ForEachRouteId(Test_SBR_Callback, &count, NULL); - ASSERT_EQ(count, 1); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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))); + CFE_UtAssert_TRUE(!CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(count), NULL))); /* 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); + CFE_UtAssert_EQUAL(CFE_SB_MsgIdToValue(CFE_SBR_GetMsgId(routeid)), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(CFE_SBR_GetMsgId(routeid[i]), CFE_SB_INVALID_MSG_ID)); UtAssert_ADDRESS_EQ(CFE_SBR_GetDestListHeadPtr(routeid[i]), NULL); - ASSERT_EQ(CFE_SBR_GetSequenceCounter(routeid[i]), 0); + CFE_UtAssert_EQUAL(CFE_SBR_GetSequenceCounter(routeid[i]), 0); } /* @@ -154,7 +154,7 @@ void Test_SBR_Route_Unsort_GetSet(void) count++; } } - ASSERT_EQ(count, 0); + CFE_UtAssert_EQUAL(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]))); + CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(msgid[i], CFE_SBR_GetMsgId(routeid[i]))); CFE_SBR_IncrementSequenceCounter(routeid[0]); } - ASSERT_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_GetNextSequenceCount)), 3); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(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); + CFE_UtAssert_EQUAL(CFE_SBR_GetSequenceCounter(routeid[0]), seqcntexpected[0]); + CFE_UtAssert_EQUAL(CFE_SBR_GetSequenceCounter(routeid[1]), seqcntexpected[1]); + CFE_UtAssert_EQUAL(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..69716ce16 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); + CFE_UtAssert_EQUAL(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)); + CFE_UtAssert_EQUAL(UT_GetNumEventsSent(), 1); + CFE_UtAssert_TRUE(UT_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")); + CFE_UtAssert_EQUAL(TblInfo1.TimeOfLastUpdate.Seconds, TblInfo1.TimeOfLastUpdate.Subseconds); /* * LastFileLoaded (limited by mission) can be bigger than MyFilename (limited by osal),