diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index fa4683ba2..a7a29426a 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -138,27 +138,6 @@ 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 */ @@ -630,65 +609,6 @@ bool CFE_UtAssert_SuccessCheck_Impl(CFE_Status_t Status, UtAssert_CaseType_t Cas bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line, const char *Desc, const char *FormatString); -/*****************************************************************************/ -/** -** \brief Helper function for string buffer check verifications -** -** \par Description -** This helper function wraps the normal UtAssert function, intended for verifying -** the contents of string buffer(s). This also includes the actual message in the log, -** but scrubs it for newlines and other items that may affect the ability to parse -** the log file via a script. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns Test pass status, returns true if status was successful, false if it failed. -** -******************************************************************************/ -bool CFE_UtAssert_StringBufCheck_Impl(const char *String1, size_t String1Max, const char *String2, size_t String2Max, - const char *File, uint32 Line); - -/*****************************************************************************/ -/** -** \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); - /*****************************************************************************/ /** ** \brief Checks the successful execution of a setup function. @@ -719,66 +639,6 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ******************************************************************************/ #define CFE_UtAssert_SUCCESS(FN) CFE_UtAssert_SuccessCheck_Impl(FN, UTASSERT_CASETYPE_FAILURE, __FILE__, __LINE__, #FN) -/*****************************************************************************/ -/** -** \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 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 for a function or value/expression -** that should evaluate as logically false -** -** \par Assumptions, External Events, and Notes: -** None -** -******************************************************************************/ -#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 CFE_UtAssert_ATLEAST(FN, MIN) \ - CFE_UtAssert_GenericSignedCompare_Impl(FN, CFE_UtAssert_Compare_GTEQ, MIN, __FILE__, __LINE__, "", #FN, #MIN) - -/*****************************************************************************/ -/** -** \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) - /*****************************************************************************/ /** ** \brief Ensures that the test generated the expected number of events. @@ -792,9 +652,9 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** None ** ******************************************************************************/ -#define CFE_UtAssert_EVENTCOUNT(EXP) \ - CFE_UtAssert_GenericSignedCompare_Impl(UT_GetNumEventsSent(), CFE_UtAssert_Compare_EQ, EXP, __FILE__, __LINE__, \ - "Event Count: ", "Sent", "Expected") +#define CFE_UtAssert_EVENTCOUNT(EXP) \ + UtAssert_GenericUnsignedCompare(UT_GetNumEventsSent(), UtAssert_Compare_EQ, EXP, UtAssert_Radix_DECIMAL, __FILE__, \ + __LINE__, "Event Count: ", "Sent", "Expected") /*****************************************************************************/ /** @@ -810,9 +670,9 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** \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, "") +#define CFE_UtAssert_EVENTSENT(EVT) \ + UtAssert_GenericUnsignedCompare(UT_EventIsInHistory(EVT), UtAssert_Compare_NEQ, 0, UtAssert_Radix_DECIMAL, \ + __FILE__, __LINE__, "Event Generated: ", #EVT, "") /*****************************************************************************/ /** @@ -829,9 +689,9 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** \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, "") +#define CFE_UtAssert_EVENTNOTSENT(EVT) \ + UtAssert_GenericUnsignedCompare(UT_EventIsInHistory(EVT), UtAssert_Compare_EQ, 0, UtAssert_Radix_DECIMAL, \ + __FILE__, __LINE__, "Event Not Generated: ", #EVT, "") /*****************************************************************************/ /** @@ -878,21 +738,6 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ******************************************************************************/ #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 -** -******************************************************************************/ -#define CFE_UtAssert_VOIDCALL(func) (func, UtAssert(true, #func, __FILE__, __LINE__)) - /*****************************************************************************/ /** ** \brief Macro to check CFE resource ID for equality @@ -905,10 +750,9 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** and integers may not be interchangable with strict type checking. ** ******************************************************************************/ -#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) +#define CFE_UtAssert_RESOURCEID_EQ(id1, id2) \ + UtAssert_GenericUnsignedCompare(CFE_RESOURCEID_TO_ULONG(id1), UtAssert_Compare_EQ, CFE_RESOURCEID_TO_ULONG(id2), \ + UtAssert_Radix_HEX, __FILE__, __LINE__, "Resource ID Check: ", #id1, #id2) /*****************************************************************************/ /** @@ -921,9 +765,9 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** This is a simple unsigned comparison which logs the values as hexadecimal ** ******************************************************************************/ -#define CFE_UtAssert_MEMOFFSET_EQ(off1, off2) \ - CFE_UtAssert_GenericUnsignedCompare_Impl(off1, CFE_UtAssert_Compare_EQ, off2, __FILE__, __LINE__, \ - "Offset Check: ", #off1, #off2) +#define CFE_UtAssert_MEMOFFSET_EQ(off1, off2) \ + UtAssert_GenericUnsignedCompare(off1, UtAssert_Compare_EQ, off2, UtAssert_Radix_HEX, __FILE__, __LINE__, \ + "Offset Check: ", #off1, #off2) /*****************************************************************************/ /** @@ -937,29 +781,8 @@ bool CFE_UtAssert_GenericSignedCompare_Impl(int32 ActualValue, CFE_UtAssert_Comp ** and integers may not be interchangable with strict type checking. ** ******************************************************************************/ -#define CFE_UtAssert_MSGID_EQ(mid1, mid2) \ - CFE_UtAssert_GenericUnsignedCompare_Impl(CFE_SB_MsgIdToValue(mid1), CFE_UtAssert_Compare_EQ, \ - CFE_SB_MsgIdToValue(mid2), __FILE__, __LINE__, "MsgId Check: ", #mid1, \ - #mid2) - -/*****************************************************************************/ -/** -** \brief Macro to check string buffers for equality -** -** \par Description -** A macro that checks two string buffers for equality. Both buffer maximum sizes are explicitly -** specified, so that strings may reside in a fixed length buffer. The function will never -** check beyond the specified length, regardless of termination. -** -** \par Assumptions, External Events, and Notes: -** The generic #UtAssert_StrCmp macro requires both arguments to be NULL terminated. This also -** includes the actual string in the log, but filters embedded newlines to keep the log clean. -** -** If the string arguments are guaranteed to be NULL terminated and/or the max size is -** not known, then the SIZE_MAX constant may be passed for the respective string. -** -******************************************************************************/ -#define CFE_UtAssert_STRINGBUF_EQ(str1, size1, str2, size2) \ - CFE_UtAssert_StringBufCheck_Impl(str1, size1, str2, size2, __FILE__, __LINE__) +#define CFE_UtAssert_MSGID_EQ(mid1, mid2) \ + UtAssert_GenericUnsignedCompare(CFE_SB_MsgIdToValue(mid1), UtAssert_Compare_EQ, CFE_SB_MsgIdToValue(mid2), \ + UtAssert_Radix_HEX, __FILE__, __LINE__, "MsgId Check: ", #mid1, #mid2) #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 030789a7b..ef5a7bb8d 100644 --- a/modules/core_private/ut-stubs/src/ut_support.c +++ b/modules/core_private/ut-stubs/src/ut_support.c @@ -686,39 +686,6 @@ void UT_AddSubTest(void (*Test)(void), void (*Setup)(void), void (*Teardown)(voi UtTest_Add(Test, Setup, Teardown, strdup(CompleteTestName)); } -const char *CFE_UtAssert_GetOpText(CFE_UtAssert_Compare_t CompareType) -{ - const char *OpText; - - 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; - } - - return OpText; -} - bool CFE_UtAssert_SuccessCheck_Impl(CFE_Status_t Status, UtAssert_CaseType_t CaseType, const char *File, uint32 Line, const char *Text) { @@ -732,93 +699,6 @@ bool CFE_UtAssert_SuccessCheck_Impl(CFE_Status_t Status, UtAssert_CaseType_t Cas return Result; } -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) -{ - 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); -} - -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) -{ - 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); -} - bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line, const char *Desc, const char *FormatString) { @@ -851,99 +731,6 @@ bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line, ScrubbedFormat[FormatLen] = '\''; ScrubbedFormat[FormatLen + 1] = 0; - return CFE_UtAssert_GenericSignedCompare_Impl(Status, CFE_UtAssert_Compare_GT, 0, File, Line, Desc, ScrubbedFormat, - ""); -} - -bool CFE_UtAssert_StringBufCheck_Impl(const char *String1, size_t String1Max, const char *String2, size_t String2Max, - const char *File, uint32 Line) -{ - char ScrubbedString1[256]; - char ScrubbedString2[256]; - const char *EndPtr1; - const char *EndPtr2; - size_t FormatLen1; - size_t FormatLen2; - bool Result; - - /* Locate the actual end of both strings */ - if (String1 == NULL) - { - EndPtr1 = NULL; - } - else - { - EndPtr1 = memchr(String1, 0, String1Max); - } - - if (EndPtr1 != NULL) - { - FormatLen1 = EndPtr1 - String1; - } - else - { - FormatLen1 = String1Max; - } - - if (String2 == NULL) - { - EndPtr2 = NULL; - } - else - { - EndPtr2 = memchr(String2, 0, String2Max); - } - - if (EndPtr2 != NULL) - { - FormatLen2 = EndPtr2 - String2; - } - else - { - FormatLen2 = String2Max; - } - - if (FormatLen1 != FormatLen2) - { - /* This means the strings have different termination/length, and therefore must not be equal (content doesn't - * matter) */ - Result = false; - } - else if (FormatLen1 == 0) - { - /* Two empty strings are considered equal */ - Result = true; - } - else - { - /* If the effective lengths are the same, use memcmp to check content */ - Result = (memcmp(String1, String2, FormatLen1) == 0); - } - - /* Now make "safe" copies of the strings */ - /* Check for a newline within the string, and if present, end the string there instead */ - if (FormatLen1 > 0) - { - EndPtr1 = memchr(String1, '\n', FormatLen1); - if (EndPtr1 != NULL) - { - FormatLen1 = EndPtr1 - String1; - } - memcpy(ScrubbedString1, String1, FormatLen1); - } - ScrubbedString1[FormatLen1] = 0; - - if (FormatLen2 > 0) - { - EndPtr2 = memchr(String2, '\n', FormatLen2); - if (EndPtr2 != NULL) - { - FormatLen2 = EndPtr2 - String2; - } - memcpy(ScrubbedString2, String2, FormatLen2); - } - ScrubbedString2[FormatLen2] = 0; - - return UtAssertEx(Result, UTASSERT_CASETYPE_FAILURE, File, Line, "String: \'%s\' == \'%s\'", ScrubbedString1, - ScrubbedString2); + return UtAssert_GenericSignedCompare(Status, UtAssert_Compare_GT, 0, UtAssert_Radix_DECIMAL, File, Line, Desc, + ScrubbedFormat, ""); } diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index ca7156b5c..f883c45a1 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -1143,8 +1143,8 @@ void TestApps(void) /* Check operation of the CFE_ES_CheckAppIdSlotUsed() helper function */ CFE_ES_Global.AppTable[1].AppId = CFE_ES_APPID_C(ES_UT_MakeAppIdForIndex(1)); CFE_ES_Global.AppTable[2].AppId = CFE_ES_APPID_UNDEFINED; - CFE_UtAssert_TRUE(CFE_ES_CheckAppIdSlotUsed(ES_UT_MakeAppIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_ES_CheckAppIdSlotUsed(ES_UT_MakeAppIdForIndex(2))); + UtAssert_TRUE(CFE_ES_CheckAppIdSlotUsed(ES_UT_MakeAppIdForIndex(1))); + UtAssert_FALSE(CFE_ES_CheckAppIdSlotUsed(ES_UT_MakeAppIdForIndex(2))); /* Test application loading and creation where the entry point symbol * cannot be found @@ -1237,7 +1237,7 @@ void TestApps(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppControlRequest = 0x12345; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_PCR_ERR2_EID); /* Test a successful control action request to exit an application */ @@ -1246,7 +1246,7 @@ void TestApps(void) ES_UT_SetupAppStartParams(&UtAppRecPtr->StartParams, "/ram/Filename", "NotNULL", 8192, 255, 0); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_EXIT_APP_INF_EID); /* Test a control action request to exit an application where the @@ -1257,7 +1257,7 @@ void TestApps(void) UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_CleanUpApp), 1, -1); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_EXIT_APP_ERR_EID); /* Test a control action request to stop an application where the @@ -1268,7 +1268,7 @@ void TestApps(void) UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_DELETE; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_CleanUpApp), 1, -1); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_ERR3_EID); /* Test a control action request to restart an application where the @@ -1279,7 +1279,7 @@ void TestApps(void) UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RESTART; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_CleanUpApp), 1, -1); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR4_EID); /* Test a control action request to restart an application where the @@ -1291,7 +1291,7 @@ void TestApps(void) OS_ModuleLoad(&UtAppRecPtr->LoadStatus.ModuleId, NULL, NULL, 0); UT_SetDefaultReturnValue(UT_KEY(OS_TaskCreate), OS_ERROR); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR3_EID); /* Test a control action request to reload an application where the @@ -1302,7 +1302,7 @@ void TestApps(void) UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_CleanUpApp), 1, -1); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR4_EID); /* Test a control action request to reload an application where the @@ -1314,7 +1314,7 @@ void TestApps(void) OS_ModuleLoad(&UtAppRecPtr->LoadStatus.ModuleId, NULL, NULL, 0); UT_SetDefaultReturnValue(UT_KEY(OS_TaskCreate), OS_ERROR); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR3_EID); /* Test a successful control action request to exit an application that @@ -1326,7 +1326,7 @@ void TestApps(void) UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_ERROR; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_ERREXIT_APP_INF_EID); /* Test a control action request to exit an application that @@ -1337,7 +1337,7 @@ void TestApps(void) UT_SetDeferredRetcode(UT_KEY(CFE_EVS_CleanUpApp), 1, -1); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_ERROR; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_ERREXIT_APP_ERR_EID); /* Test a successful control action request to stop an application */ @@ -1346,7 +1346,7 @@ void TestApps(void) ES_UT_SetupAppStartParams(&UtAppRecPtr->StartParams, "/ram/FileName", "NULL", 8192, 255, 0); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_DELETE; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_INF_EID); /* Test a successful control action request to restart an application */ @@ -1355,7 +1355,7 @@ void TestApps(void) ES_UT_SetupAppStartParams(&UtAppRecPtr->StartParams, "/ram/FileName", "NULL", 8192, 255, 0); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RESTART; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_INF_EID); /* Test a successful control action request to reload an application */ @@ -1364,7 +1364,7 @@ void TestApps(void) ES_UT_SetupAppStartParams(&UtAppRecPtr->StartParams, "/ram/FileName", "NULL", 8192, 255, 0); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_INF_EID); /* Test a control action request for an application that has an invalid @@ -1375,7 +1375,7 @@ void TestApps(void) ES_UT_SetupAppStartParams(&UtAppRecPtr->StartParams, "/ram/FileName", "NULL", 8192, 255, 0); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_EXCEPTION; AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - CFE_UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); + UtAssert_VOIDCALL(CFE_ES_ProcessControlRequest(AppId)); CFE_UtAssert_EVENTSENT(CFE_ES_PCR_ERR1_EID); /* Test populating the application information structure with data */ @@ -1609,8 +1609,8 @@ void TestApps(void) ES_UT_SetupChildTaskId(UtAppRecPtr, NULL, NULL); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); CFE_UtAssert_SUCCESS(CFE_ES_CleanUpApp(AppId)); - CFE_UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); - CFE_UtAssert_FALSE(CFE_ES_MemPoolRecordIsUsed(UtPoolRecPtr)); + UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); + UtAssert_FALSE(CFE_ES_MemPoolRecordIsUsed(UtPoolRecPtr)); /* Test deleting an application and cleaning up its resources where the * main task and child task need to be swapped @@ -1636,7 +1636,7 @@ void TestApps(void) UtPoolRecPtr->PoolID = CFE_ES_MEMHANDLE_C(CFE_ResourceId_FromInteger(99999)); /* Mismatch */ AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); UtAssert_INT32_EQ(CFE_ES_CleanUpApp(AppId), CFE_ES_APP_CLEANUP_ERR); - CFE_UtAssert_TRUE(CFE_ES_MemPoolRecordIsUsed(UtPoolRecPtr)); + UtAssert_TRUE(CFE_ES_MemPoolRecordIsUsed(UtPoolRecPtr)); /* Test deleting an application and cleaning up its resources where the * application ID doesn't match the main task ID @@ -1656,7 +1656,7 @@ void TestApps(void) UT_SetDefaultReturnValue(UT_KEY(OS_TaskDelete), OS_ERROR); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); UtAssert_INT32_EQ(CFE_ES_CleanUpApp(AppId), CFE_ES_APP_CLEANUP_ERR); - CFE_UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); + UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); /* Test deleting an application and cleaning up its resources where the * application ID doesn't match and the application is a core application @@ -1675,7 +1675,7 @@ void TestApps(void) CFE_UtAssert_SUCCESS(CFE_ES_CleanUpApp(AppId)); - CFE_UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); + UtAssert_TRUE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); UtAssert_UINT32_EQ(CFE_ES_Global.RegisteredExternalApps, 1); /* Test successfully deleting an application and cleaning up its resources @@ -1687,7 +1687,7 @@ void TestApps(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, &UtTaskRecPtr); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); CFE_UtAssert_SUCCESS(CFE_ES_CleanUpApp(AppId)); - CFE_UtAssert_FALSE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); + UtAssert_FALSE(CFE_ES_TaskRecordIsUsed(UtTaskRecPtr)); UtAssert_UINT32_EQ(CFE_ES_Global.RegisteredExternalApps, 0); /* Test cleaning up the OS resources for a task with failure to @@ -1767,7 +1767,7 @@ void TestLibs(void) UtLibRecPtr = CFE_ES_LocateLibRecordByID(Id); UtAssert_NOT_NULL(UtLibRecPtr); - CFE_UtAssert_TRUE(CFE_ES_LibRecordIsUsed(UtLibRecPtr)); + UtAssert_TRUE(CFE_ES_LibRecordIsUsed(UtLibRecPtr)); /* Try loading same library again, should return the DUPLICATE code */ UtAssert_INT32_EQ(CFE_ES_LoadLibrary(&Id, "TST_LIB", &LoadParams), CFE_ES_ERR_DUPLICATE_NAME); @@ -1827,8 +1827,8 @@ void TestLibs(void) /* check operation of the CFE_ES_CheckLibIdSlotUsed() function */ CFE_ES_Global.LibTable[1].LibId = CFE_ES_LIBID_C(ES_UT_MakeLibIdForIndex(1)); CFE_ES_Global.LibTable[2].LibId = CFE_ES_LIBID_UNDEFINED; - CFE_UtAssert_TRUE(CFE_ES_CheckLibIdSlotUsed(ES_UT_MakeLibIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_ES_CheckLibIdSlotUsed(ES_UT_MakeLibIdForIndex(2))); + UtAssert_TRUE(CFE_ES_CheckLibIdSlotUsed(ES_UT_MakeLibIdForIndex(1))); + UtAssert_FALSE(CFE_ES_CheckLibIdSlotUsed(ES_UT_MakeLibIdForIndex(2))); /* * Test public Name+ID query/lookup API */ @@ -1861,9 +1861,9 @@ void TestERLog(void) CFE_ES_Global.ResetDataPtr->ERLogIndex = CFE_PLATFORM_ES_ER_LOG_ENTRIES + 1; CFE_UtAssert_SUCCESS(CFE_ES_WriteToERLog(CFE_ES_LogEntryType_CORE, CFE_PSP_RST_TYPE_POWERON, 1, NULL)); UtAssert_UINT32_EQ(CFE_ES_Global.ResetDataPtr->ERLogIndex, 1); - CFE_UtAssert_STRINGBUF_EQ(CFE_ES_Global.ResetDataPtr->ERLog[0].BaseInfo.Description, - sizeof(CFE_ES_Global.ResetDataPtr->ERLog[0].BaseInfo.Description), - "No Description String Given.", SIZE_MAX); + UtAssert_STRINGBUF_EQ(CFE_ES_Global.ResetDataPtr->ERLog[0].BaseInfo.Description, + sizeof(CFE_ES_Global.ResetDataPtr->ERLog[0].BaseInfo.Description), + "No Description String Given.", SIZE_MAX); /* Test non-rolling over log entry, * null description, @@ -1880,18 +1880,18 @@ void TestERLog(void) LocalBufSize = 0; UT_SetDeferredRetcode(UT_KEY(CFE_PSP_Exception_CopyContext), 1, 128); - CFE_UtAssert_FALSE(CFE_ES_BackgroundERLogFileDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_FALSE(CFE_ES_BackgroundERLogFileDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); CFE_UtAssert_MEMOFFSET_EQ(State.EntryBuffer.ContextSize, 128); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); memset(&State.EntryBuffer, 0xEE, sizeof(State.EntryBuffer)); UT_SetDeferredRetcode(UT_KEY(CFE_PSP_Exception_CopyContext), 1, -1); - CFE_UtAssert_TRUE( + UtAssert_TRUE( CFE_ES_BackgroundERLogFileDataGetter(&State, CFE_PLATFORM_ES_ER_LOG_ENTRIES - 1, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(State.EntryBuffer.ContextSize); - CFE_UtAssert_TRUE( + UtAssert_TRUE( CFE_ES_BackgroundERLogFileDataGetter(&State, CFE_PLATFORM_ES_ER_LOG_ENTRIES, &LocalBuffer, &LocalBufSize)); UtAssert_NULL(LocalBuffer); UtAssert_ZERO(LocalBufSize); @@ -1962,19 +1962,19 @@ void TestGenericPool(void) /* Allocate buffers until no space left */ CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool1, &Offset1, 44)); UtAssert_NONZERO(Offset1); - CFE_UtAssert_ATMOST(Offset1, OffsetEnd - 44); + UtAssert_UINT32_ATMOST(Offset1, OffsetEnd - 44); UtAssert_True((Offset1 & 0x1F) == 0, "Offset1(%lu) 32 byte alignment", (unsigned long)Offset1); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool1, &Offset2, 72)); - CFE_UtAssert_ATLEAST(Offset2, Offset1 + 44); - CFE_UtAssert_ATMOST(Offset2, OffsetEnd - 72); + UtAssert_UINT32_ATLEAST(Offset2, Offset1 + 44); + UtAssert_UINT32_ATMOST(Offset2, OffsetEnd - 72); UtAssert_True((Offset2 & 0x1F) == 0, "Offset2(%lu) 32 byte alignment", (unsigned long)Offset2); UtAssert_INT32_EQ(CFE_ES_GenPoolGetBlock(&Pool1, &Offset3, 72), CFE_ES_ERR_MEM_BLOCK_SIZE); CFE_UtAssert_SUCCESS(CFE_ES_GenPoolGetBlock(&Pool1, &Offset3, 6)); - CFE_UtAssert_ATLEAST(Offset3, Offset2 + 72); - CFE_UtAssert_ATMOST(Offset3, OffsetEnd - 6); + UtAssert_UINT32_ATLEAST(Offset3, Offset2 + 72); + UtAssert_UINT32_ATMOST(Offset3, OffsetEnd - 6); UtAssert_True((Offset3 & 0x1F) == 0, "Offset3(%lu) 32 byte alignment", (unsigned long)Offset3); /* Free a buffer and attempt to reallocate */ @@ -2118,10 +2118,10 @@ void TestGenericPool(void) * Check other validation */ UtAssert_INT32_EQ(CFE_ES_GenPoolPutBlock(&Pool1, &BlockSize, 0), CFE_ES_BUFFER_NOT_IN_POOL); - CFE_UtAssert_TRUE(CFE_ES_GenPoolValidateState(&Pool1)); + UtAssert_TRUE(CFE_ES_GenPoolValidateState(&Pool1)); Pool1.TailPosition = 0xFFFFFF; - CFE_UtAssert_FALSE(CFE_ES_GenPoolValidateState(&Pool1)); + UtAssert_FALSE(CFE_ES_GenPoolValidateState(&Pool1)); } void TestTask(void) @@ -2174,13 +2174,13 @@ void TestTask(void) /* Set up buffer for first cycle, pipe failure is on 2nd */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); - CFE_UtAssert_VOIDCALL(CFE_ES_TaskMain()); + UtAssert_VOIDCALL(CFE_ES_TaskMain()); CFE_UtAssert_PRINTF(UT_OSP_MESSAGES[UT_OSP_COMMAND_PIPE]); /* Test task main process with a CFE_ES_TaskInit() error */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, -1); - CFE_UtAssert_VOIDCALL(CFE_ES_TaskMain()); + UtAssert_VOIDCALL(CFE_ES_TaskMain()); CFE_UtAssert_PRINTF("Application Init Failed"); /* Test task main process loop with bad checksum information */ @@ -3093,7 +3093,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, NULL, NULL, NULL); CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = 1; UT_SetDeferredRetcode(UT_KEY(CFE_EVS_SendEvent), 3, CFE_EVS_INVALID_PARAMETER); - CFE_UtAssert_VOIDCALL(CFE_ES_TaskInit()); + UtAssert_VOIDCALL(CFE_ES_TaskInit()); CFE_UtAssert_PRINTF("Error sending mission version event"); } /* end TestTask */ @@ -3599,21 +3599,21 @@ void TestAPI(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); RunStatus = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; - CFE_UtAssert_TRUE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_TRUE(CFE_ES_RunLoop(&RunStatus)); /* Test successful run loop app stop request */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); RunStatus = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; - CFE_UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); /* Test successful run loop app exit request */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); RunStatus = CFE_ES_RunStatus_APP_EXIT; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; - CFE_UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); /* Test run loop with bad app ID */ ES_ResetUnitTest(); @@ -3621,27 +3621,27 @@ void TestAPI(void) RunStatus = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; CFE_ES_TaskRecordSetFree(UtTaskRecPtr); /* make it so task ID is bad */ - CFE_UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); /* Test run loop with an invalid run status */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); RunStatus = 1000; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; - CFE_UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); /* Test run loop with a NULL run status */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; - CFE_UtAssert_TRUE(CFE_ES_RunLoop(NULL)); + UtAssert_TRUE(CFE_ES_RunLoop(NULL)); /* Test run loop with startup sync code */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_LATE_INIT, NULL, &UtAppRecPtr, NULL); RunStatus = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; - CFE_UtAssert_TRUE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_TRUE(CFE_ES_RunLoop(&RunStatus)); UtAssert_UINT32_EQ(UtAppRecPtr->AppState, CFE_ES_AppState_RUNNING); /* Test getting the cFE application and task ID by context */ @@ -3921,7 +3921,7 @@ void TestAPI(void) /* Note - CFE_ES_WaitForStartupSync() returns void, nothing to check for * here. This is for code coverage */ - CFE_UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99)); + UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99)); /* Test waiting for apps to initialize as an external app */ @@ -3932,7 +3932,7 @@ void TestAPI(void) /* Note - CFE_ES_WaitForStartupSync() returns void, nothing to check for * here. This is for code coverage */ - CFE_UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99)); + UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99)); /* Test adding a time-stamped message to the system log using an invalid * log mode @@ -3958,14 +3958,14 @@ void TestAPI(void) CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_ES_LogMode_OVERWRITE; CFE_UtAssert_SUCCESS(CFE_ES_WriteToSysLog("SysLogText")); - CFE_UtAssert_ATMOST(CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx, CFE_PLATFORM_ES_SYSTEM_LOG_SIZE - 1); + UtAssert_UINT32_ATMOST(CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx, CFE_PLATFORM_ES_SYSTEM_LOG_SIZE - 1); /* Test run loop with an application error status */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "UT", &UtAppRecPtr, NULL); RunStatus = CFE_ES_RunStatus_APP_ERROR; UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_ERROR; - CFE_UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); + UtAssert_FALSE(CFE_ES_RunLoop(&RunStatus)); /* * Test public Name+ID query/lookup API for tasks @@ -4023,8 +4023,8 @@ void TestGenericCounterAPI(void) /* Check operation of the CFE_ES_CheckCounterIdSlotUsed() helper function */ CFE_ES_Global.CounterTable[1].CounterId = CFE_ES_COUNTERID_C(ES_UT_MakeCounterIdForIndex(1)); CFE_ES_Global.CounterTable[2].CounterId = CFE_ES_COUNTERID_UNDEFINED; - CFE_UtAssert_TRUE(CFE_ES_CheckCounterIdSlotUsed(ES_UT_MakeCounterIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_ES_CheckCounterIdSlotUsed(ES_UT_MakeCounterIdForIndex(2))); + UtAssert_TRUE(CFE_ES_CheckCounterIdSlotUsed(ES_UT_MakeCounterIdForIndex(1))); + UtAssert_FALSE(CFE_ES_CheckCounterIdSlotUsed(ES_UT_MakeCounterIdForIndex(2))); /* Test getting a registered generic counter that doesn't exist */ UtAssert_INT32_EQ(CFE_ES_GetGenCounterIDByName(&CounterId, "Counter999"), CFE_ES_ERR_NAME_NOT_FOUND); @@ -4206,8 +4206,8 @@ void TestCDS() /* Check operation of the CFE_ES_CheckCDSHandleSlotUsed() helper function */ CFE_ES_Global.CDSVars.Registry[1].BlockID = CFE_ES_CDSHANDLE_C(ES_UT_MakeCDSIdForIndex(1)); CFE_ES_Global.CDSVars.Registry[2].BlockID = CFE_ES_CDS_BAD_HANDLE; - CFE_UtAssert_TRUE(CFE_ES_CheckCDSHandleSlotUsed(ES_UT_MakeCDSIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_ES_CheckCDSHandleSlotUsed(ES_UT_MakeCDSIdForIndex(2))); + UtAssert_TRUE(CFE_ES_CheckCDSHandleSlotUsed(ES_UT_MakeCDSIdForIndex(1))); + UtAssert_FALSE(CFE_ES_CheckCDSHandleSlotUsed(ES_UT_MakeCDSIdForIndex(2))); /* Test CDS registering using a bad app ID */ ES_ResetUnitTest(); @@ -4593,7 +4593,7 @@ void TestESMempool(void) /* Test handle validation using a handle with an invalid memory address */ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, -1); - CFE_UtAssert_FALSE(CFE_ES_ValidateHandle(PoolID2)); + UtAssert_FALSE(CFE_ES_ValidateHandle(PoolID2)); /* Test handle validation using a handle where the first pool structure * field is not the pool start address @@ -4607,7 +4607,7 @@ void TestESMempool(void) */ *((uint32 *)&PoolPtr->PoolID) ^= 10; /* cause it to fail validation */ - CFE_UtAssert_FALSE(CFE_ES_ValidateHandle(PoolID2)); + UtAssert_FALSE(CFE_ES_ValidateHandle(PoolID2)); /* Test allocating a pool buffer where the memory handle is not the pool * start address @@ -4678,8 +4678,8 @@ void TestESMempool(void) /* Check operation of the CFE_ES_CheckCounterIdSlotUsed() helper function */ CFE_ES_Global.MemPoolTable[1].PoolID = CFE_ES_MEMHANDLE_C(ES_UT_MakePoolIdForIndex(1)); CFE_ES_Global.MemPoolTable[2].PoolID = CFE_ES_MEMHANDLE_UNDEFINED; - CFE_UtAssert_TRUE(CFE_ES_CheckMemPoolSlotUsed(ES_UT_MakePoolIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_ES_CheckMemPoolSlotUsed(ES_UT_MakePoolIdForIndex(2))); + UtAssert_TRUE(CFE_ES_CheckMemPoolSlotUsed(ES_UT_MakePoolIdForIndex(1))); + UtAssert_FALSE(CFE_ES_CheckMemPoolSlotUsed(ES_UT_MakePoolIdForIndex(2))); /* * Test creating a memory pool with a semaphore error @@ -4820,7 +4820,7 @@ void TestESMempool(void) UtAssert_INT32_EQ(CFE_ES_GetPoolBuf(&addressp2, PoolID1, 99000), CFE_ES_ERR_MEM_BLOCK_SIZE); /* Test handle validation using a null handle */ - CFE_UtAssert_FALSE(CFE_ES_ValidateHandle(CFE_ES_MEMHANDLE_UNDEFINED)); + UtAssert_FALSE(CFE_ES_ValidateHandle(CFE_ES_MEMHANDLE_UNDEFINED)); /* Test returning a pool buffer using a null handle */ UtAssert_INT32_EQ(CFE_ES_PutPoolBuf(CFE_ES_MEMHANDLE_UNDEFINED, addressp2), CFE_ES_ERR_RESOURCEID_NOT_VALID); @@ -4865,7 +4865,7 @@ void TestESMempool(void) } UtAssert_NONZERO(i); - CFE_UtAssert_ATMOST(i, 20); + UtAssert_UINT32_ATMOST(i, 20); /* Test getting the size of a pool buffer that is not in the pool */ UtAssert_INT32_EQ(CFE_ES_GetPoolBufInfo(PoolID1, CFE_ES_MEMPOOLBUF_C((cpuaddr)addressp1 + 400)), @@ -4946,7 +4946,7 @@ void TestSysLog(void) CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1; - CFE_UtAssert_VOIDCALL(CFE_ES_SysLogDump("fakefilename")); + UtAssert_VOIDCALL(CFE_ES_SysLogDump("fakefilename")); /* Test "message got truncated" */ ES_ResetUnitTest(); diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 9bedb5003..04b89cba6 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -663,8 +663,8 @@ void Test_Format(void) /* Note implementation initializes both short and long message */ UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_MSG_Init)), 2); UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)), 1); - CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(MsgData.MsgId, ShortFmtSnapshotData.MsgId)); - CFE_UtAssert_FALSE(CFE_SB_MsgId_Equal(MsgData.MsgId, LongFmtSnapshotData.MsgId)); + UtAssert_TRUE(CFE_SB_MsgId_Equal(MsgData.MsgId, ShortFmtSnapshotData.MsgId)); + UtAssert_FALSE(CFE_SB_MsgId_Equal(MsgData.MsgId, LongFmtSnapshotData.MsgId)); /* Confirm the right message was sent */ UtAssert_ADDRESS_EQ(MsgSend, MsgData.MsgPtr); @@ -868,7 +868,7 @@ void Test_Logging(void) } CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Log overfill event discard"); - CFE_UtAssert_TRUE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); + UtAssert_TRUE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogMode, CFE_EVS_LogMode_DISCARD); /* Test setting the logging mode to overwrite */ @@ -877,7 +877,7 @@ void Test_Logging(void) UT_EVS_DoDispatchCheckEvents(&CmdBuf.modecmd, sizeof(CmdBuf.modecmd), UT_TPID_CFE_EVS_CMD_SET_LOG_MODE_CC, &UT_EVS_EventBuf); CFE_EVS_SendEvent(0, CFE_EVS_EventType_INFORMATION, "Log overfill event overwrite"); - CFE_UtAssert_TRUE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); + UtAssert_TRUE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogMode, CFE_EVS_LogMode_OVERWRITE); /* Test sending a no op command */ @@ -890,7 +890,7 @@ void Test_Logging(void) UT_InitData(); CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true; UT_EVS_DoDispatchCheckEvents(&CmdBuf.cmd, sizeof(CmdBuf.cmd), UT_TPID_CFE_EVS_CMD_CLEAR_LOG_CC, &UT_EVS_EventBuf); - CFE_UtAssert_FALSE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); + UtAssert_FALSE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag); /* Test setting the logging mode to overwrite */ UT_InitData(); diff --git a/modules/fs/ut-coverage/fs_UT.c b/modules/fs/ut-coverage/fs_UT.c index 79affdcf3..99d4162a1 100644 --- a/modules/fs/ut-coverage/fs_UT.c +++ b/modules/fs/ut-coverage/fs_UT.c @@ -266,8 +266,7 @@ void Test_CFE_FS_ParseInputFileNameEx(void) CFE_UtAssert_SUCCESS(CFE_FS_ParseInputFileNameEx(OutBuffer, TEST_XTRA_SEPARATOR_EXT, sizeof(OutBuffer), sizeof(TEST_XTRA_SEPARATOR_EXT) - 5, TEST_DEFAULT_INPUT, TEST_DEFAULT_PATH, TEST_DEFAULT_EXTENSION)); - CFE_UtAssert_STRINGBUF_EQ(OutBuffer, sizeof(OutBuffer), TEST_XTRA_SEPARATOR_EXT, - sizeof(TEST_XTRA_SEPARATOR_EXT) - 5); + UtAssert_STRINGBUF_EQ(OutBuffer, sizeof(OutBuffer), TEST_XTRA_SEPARATOR_EXT, sizeof(TEST_XTRA_SEPARATOR_EXT) - 5); /* Same but as a default input, rather than in the buffer */ /* tests 3 variations of "no input" - null ptr, zero size, empty string */ @@ -530,11 +529,11 @@ void Test_CFE_FS_BackgroundFileDump(void) memset(&CFE_FS_Global.FileDump, 0, sizeof(CFE_FS_Global.FileDump)); /* Nominal with nothing pending - should accumulate credit */ - CFE_UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(1, NULL)); - CFE_UtAssert_ATLEAST(CFE_FS_Global.FileDump.Current.Credit, 1); - CFE_UtAssert_ATMOST(CFE_FS_Global.FileDump.Current.Credit, CFE_FS_BACKGROUND_MAX_CREDIT); + UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(1, NULL)); + UtAssert_INT32_ATLEAST(CFE_FS_Global.FileDump.Current.Credit, 1); + UtAssert_INT32_ATMOST(CFE_FS_Global.FileDump.Current.Credit, CFE_FS_BACKGROUND_MAX_CREDIT); - CFE_UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100000, NULL)); + UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100000, NULL)); UtAssert_INT32_EQ(CFE_FS_Global.FileDump.Current.Credit, CFE_FS_BACKGROUND_MAX_CREDIT); UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(NULL), CFE_FS_BAD_ARGUMENT); @@ -548,7 +547,7 @@ void Test_CFE_FS_BackgroundFileDump(void) State.OnEvent = UT_FS_OnEvent; UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&State), CFE_FS_BAD_ARGUMENT); - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); UtAssert_STUB_COUNT(CFE_ES_BackgroundWakeup, 0); /* confirm CFE_ES_BackgroundWakeup() was not invoked */ /* Set the data except file name and description */ @@ -556,7 +555,7 @@ void Test_CFE_FS_BackgroundFileDump(void) State.GetData = UT_FS_DataGetter; State.OnEvent = UT_FS_OnEvent; UtAssert_INT32_EQ(CFE_FS_BackgroundFileDumpRequest(&State), CFE_FS_INVALID_PATH); - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); UtAssert_STUB_COUNT(CFE_ES_BackgroundWakeup, 0); /* confirm CFE_ES_BackgroundWakeup() was not invoked */ /* Set up remainder of fields, so entry is valid */ @@ -564,7 +563,7 @@ void Test_CFE_FS_BackgroundFileDump(void) strncpy(State.Description, "UT", sizeof(State.Description)); CFE_UtAssert_SUCCESS(CFE_FS_BackgroundFileDumpRequest(&State)); - CFE_UtAssert_TRUE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_TRUE(CFE_FS_BackgroundFileDumpIsPending(&State)); UtAssert_STUB_COUNT(CFE_ES_BackgroundWakeup, 1); /* confirm CFE_ES_BackgroundWakeup() was invoked */ /* @@ -574,20 +573,20 @@ void Test_CFE_FS_BackgroundFileDump(void) MyBuffer[0] = 10; MyBuffer[1] = 20; UT_SetDataBuffer(UT_KEY(UT_FS_DataGetter), MyBuffer, sizeof(MyBuffer), false); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(1, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(1, NULL)); UtAssert_STUB_COUNT(OS_OpenCreate, 1); /* confirm OS_open() was invoked */ - CFE_UtAssert_ATMOST(CFE_FS_Global.FileDump.Current.Credit, 0); + UtAssert_INT32_ATMOST(CFE_FS_Global.FileDump.Current.Credit, 0); UtAssert_STUB_COUNT(OS_close, 0); /* confirm OS_close() was not invoked */ UT_SetDeferredRetcode(UT_KEY(UT_FS_DataGetter), 2, true); /* return EOF */ - CFE_UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); UtAssert_STUB_COUNT(OS_OpenCreate, 1); /* confirm OS_open() was not invoked again */ UtAssert_STUB_COUNT(OS_close, 1); /* confirm OS_close() was invoked */ /* No more pending requests */ UtAssert_UINT32_EQ(CFE_FS_Global.FileDump.CompleteCount, CFE_FS_Global.FileDump.RequestCount); /* complete event was sent */ UtAssert_UINT32_EQ(UT_FS_FileWriteEventCount[CFE_FS_FileWriteEvent_COMPLETE], 1); - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); UT_ResetState(UT_KEY(UT_FS_DataGetter)); @@ -595,10 +594,10 @@ void Test_CFE_FS_BackgroundFileDump(void) CFE_UtAssert_SETUP(CFE_FS_BackgroundFileDumpRequest(&State)); UT_SetDeferredRetcode(UT_KEY(OS_OpenCreate), 1, OS_ERROR); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); UtAssert_UINT32_EQ(UT_FS_FileWriteEventCount[CFE_FS_FileWriteEvent_CREATE_ERROR], 1); /* create error event was sent */ - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); /* No more pending requests */ UtAssert_UINT32_EQ(CFE_FS_Global.FileDump.CompleteCount, CFE_FS_Global.FileDump.RequestCount); @@ -606,10 +605,10 @@ void Test_CFE_FS_BackgroundFileDump(void) CFE_UtAssert_SETUP(CFE_FS_BackgroundFileDumpRequest(&State)); UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); UtAssert_UINT32_EQ(UT_FS_FileWriteEventCount[CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR], 1); /* header error event was sent */ - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); /* No more pending requests */ UtAssert_UINT32_EQ(CFE_FS_Global.FileDump.CompleteCount, CFE_FS_Global.FileDump.RequestCount); @@ -617,10 +616,10 @@ void Test_CFE_FS_BackgroundFileDump(void) CFE_UtAssert_SETUP(CFE_FS_BackgroundFileDumpRequest(&State)); UT_SetDeferredRetcode(UT_KEY(OS_write), 2, OS_ERROR); UT_SetDataBuffer(UT_KEY(UT_FS_DataGetter), MyBuffer, sizeof(MyBuffer), false); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); /* record error event was sent */ UtAssert_UINT32_EQ(UT_FS_FileWriteEventCount[CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR], 1); - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(&State)); /* No more pending requests */ UtAssert_UINT32_EQ(CFE_FS_Global.FileDump.CompleteCount, CFE_FS_Global.FileDump.RequestCount); @@ -642,15 +641,15 @@ void Test_CFE_FS_BackgroundFileDump(void) (CFE_FS_Global.FileDump.CompleteCount + CFE_FS_MAX_BACKGROUND_FILE_WRITES - 1)); /* Confirm null arg handling in CFE_FS_BackgroundFileDumpIsPending() */ - CFE_UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(NULL)); + UtAssert_FALSE(CFE_FS_BackgroundFileDumpIsPending(NULL)); /* this catches the branch where Meta->IsPending is false */ - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); - CFE_UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); - CFE_UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_TRUE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); CFE_UtAssert_SETUP(CFE_FS_BackgroundFileDumpRequest(&State)); UT_SetDeferredRetcode(UT_KEY(UT_FS_DataGetter), 2, true); /* avoid infinite loop */ - CFE_UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); + UtAssert_FALSE(CFE_FS_RunBackgroundFileDump(100, NULL)); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c index 4bafd46ad..6babaa69b 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c @@ -233,7 +233,7 @@ void Test_MSG_HasSecondaryHeader(void) UtPrintf("Bad parameter tests, Null pointers"); memset(&msg, 0, sizeof(msg)); UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(CFE_MSG_GetHasSecondaryHeader(&msg, NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); UtAssert_INT32_EQ(CFE_MSG_SetHasSecondaryHeader(NULL, false), CFE_MSG_BAD_ARGUMENT); @@ -241,35 +241,35 @@ void Test_MSG_HasSecondaryHeader(void) UtPrintf("Set to all F's, true and false inputs"); memset(&msg, 0xFF, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(&msg, true)); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(Test_MSG_NotF(&msg), 0); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(&msg, false)); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_FALSE(actual); + UtAssert_FALSE(actual); UtAssert_INT32_EQ(Test_MSG_NotF(&msg), MSG_HASSEC_FLAG); UtPrintf("Set to all 0, true and false inputs"); memset(&msg, 0, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_FALSE(actual); + UtAssert_FALSE(actual); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(&msg, false)); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_FALSE(actual); + UtAssert_FALSE(actual); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), 0); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(&msg, true)); UT_DisplayPkt(&msg, sizeof(msg)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &actual)); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_checksum.c b/modules/msg/ut-coverage/test_cfe_msg_checksum.c index e36e94144..38c4f1b41 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_checksum.c +++ b/modules/msg/ut-coverage/test_cfe_msg_checksum.c @@ -45,14 +45,14 @@ void Test_MSG_Checksum(void) actual = true; UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(NULL, &actual), CFE_MSG_BAD_ARGUMENT); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, NULL), CFE_MSG_BAD_ARGUMENT); UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), 0); UtPrintf("Bad message, no secondary header"); CFE_UtAssert_SUCCESS(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd)); UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_TYPE_FLAG); @@ -60,7 +60,7 @@ void Test_MSG_Checksum(void) CFE_UtAssert_SUCCESS(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Tlm)); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(msgptr, true)); UtAssert_INT32_EQ(CFE_MSG_ValidateChecksum(msgptr, &actual), CFE_MSG_WRONG_MSG_TYPE); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(CFE_MSG_GenerateChecksum(msgptr), CFE_MSG_WRONG_MSG_TYPE); UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_HASSEC_FLAG); @@ -68,11 +68,11 @@ void Test_MSG_Checksum(void) memset(&cmd, 0xFF, sizeof(cmd)); CFE_UtAssert_SUCCESS(CFE_MSG_SetSize(msgptr, sizeof(cmd))); CFE_UtAssert_SUCCESS(CFE_MSG_ValidateChecksum(msgptr, &actual)); - CFE_UtAssert_FALSE(actual); + UtAssert_FALSE(actual); CFE_UtAssert_SUCCESS(CFE_MSG_GenerateChecksum(msgptr)); UT_DisplayPkt(msgptr, sizeof(cmd)); CFE_UtAssert_SUCCESS(CFE_MSG_ValidateChecksum(msgptr, &actual)); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(Test_MSG_NotF(msgptr), MSG_LENGTH_FLAG); UtPrintf("Set to all 0 except secheader and type, validate/generate/validate"); @@ -81,10 +81,10 @@ void Test_MSG_Checksum(void) CFE_UtAssert_SUCCESS(CFE_MSG_SetType(msgptr, CFE_MSG_Type_Cmd)); CFE_UtAssert_SUCCESS(CFE_MSG_SetHasSecondaryHeader(msgptr, true)); CFE_UtAssert_SUCCESS(CFE_MSG_ValidateChecksum(msgptr, &actual)); - CFE_UtAssert_FALSE(actual); + UtAssert_FALSE(actual); CFE_UtAssert_SUCCESS(CFE_MSG_GenerateChecksum(msgptr)); UT_DisplayPkt(msgptr, sizeof(cmd)); CFE_UtAssert_SUCCESS(CFE_MSG_ValidateChecksum(msgptr, &actual)); - CFE_UtAssert_TRUE(actual); + UtAssert_TRUE(actual); UtAssert_INT32_EQ(Test_MSG_NotZero(msgptr), MSG_LENGTH_FLAG | MSG_HASSEC_FLAG | MSG_TYPE_FLAG); } diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c index 2efeee5cf..5723285d5 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -111,7 +111,7 @@ void Test_MSG_Init(void) CFE_UtAssert_SUCCESS(CFE_MSG_GetApId(&cmd.Msg, &apid)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHeaderVersion(&cmd.Msg, &hdrver)); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&cmd.Msg, &hassec)); - CFE_UtAssert_TRUE(hassec); + UtAssert_TRUE(hassec); if (!is_v1) { UtAssert_INT32_EQ(apid & TEST_DEFAULT_APID_MASK, CFE_PLATFORM_DEFAULT_APID & TEST_DEFAULT_APID_MASK); 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 8a0a6a5ae..4601fca0c 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c @@ -79,7 +79,7 @@ void Test_MSG_MsgId(void) CFE_UtAssert_SUCCESS(CFE_MSG_GetType(&msg, &type)); UtAssert_INT32_EQ(type, CFE_MSG_Type_Cmd); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec)); - CFE_UtAssert_TRUE(hassec); + UtAssert_TRUE(hassec); UtPrintf("Set ApId msgid bits only and verify"); CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(TEST_MAX_APID))); @@ -93,7 +93,7 @@ void Test_MSG_MsgId(void) CFE_UtAssert_SUCCESS(CFE_MSG_GetMsgId(&msg, &msgid)); UtAssert_INT32_EQ(Test_MSG_NotZero(&msg), MSG_HASSEC_FLAG); CFE_UtAssert_SUCCESS(CFE_MSG_GetHasSecondaryHeader(&msg, &hassec)); - CFE_UtAssert_TRUE(hassec); + UtAssert_TRUE(hassec); UtPrintf("Set type msgid bit only and verify"); CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0x1000))); diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 6e741708a..b4843c927 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -715,12 +715,11 @@ void Test_SB_Cmds_RoutingInfoDataGetter(void) LocalBuffer = NULL; LocalBufSize = 0; - CFE_UtAssert_FALSE(CFE_SB_WriteRouteInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_FALSE(CFE_SB_WriteRouteInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - CFE_UtAssert_TRUE( - CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + UtAssert_TRUE(CFE_SB_WriteRouteInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -837,18 +836,17 @@ void Test_SB_Cmds_PipeInfoDataGetter(void) LocalBufSize = 0; /* Note that CFE_SB_CreatePipe() fills entry 1 first, so entry 0 is unused */ - CFE_UtAssert_FALSE(CFE_SB_WritePipeInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_FALSE(CFE_SB_WritePipeInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); - CFE_UtAssert_FALSE(CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize)); + UtAssert_FALSE(CFE_SB_WritePipeInfoDataGetter(&State, 1, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - CFE_UtAssert_TRUE( - CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize)); + UtAssert_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES - 1, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); - CFE_UtAssert_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize)); + UtAssert_TRUE(CFE_SB_WritePipeInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_PIPES, &LocalBuffer, &LocalBufSize)); UtAssert_ZERO(LocalBufSize); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -921,12 +919,11 @@ void Test_SB_Cmds_MapInfoDataGetter(void) LocalBuffer = NULL; LocalBufSize = 0; - CFE_UtAssert_FALSE(CFE_SB_WriteMsgMapInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); + UtAssert_FALSE(CFE_SB_WriteMsgMapInfoDataGetter(&State, 0, &LocalBuffer, &LocalBufSize)); UtAssert_NOT_NULL(LocalBuffer); UtAssert_NONZERO(LocalBufSize); - CFE_UtAssert_TRUE( - CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); + UtAssert_TRUE(CFE_SB_WriteMsgMapInfoDataGetter(&State, CFE_PLATFORM_SB_MAX_MSG_IDS, &LocalBuffer, &LocalBufSize)); UtAssert_NULL(LocalBuffer); UtAssert_ZERO(LocalBufSize); @@ -1494,7 +1491,7 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Event count is only exact if there were no collisions */ if (UT_EventIsInHistory(CFE_SB_HASHCOLLISION_EID)) { - CFE_UtAssert_ATLEAST(UT_GetNumEventsSent(), NumEvts + 1); + UtAssert_UINT32_ATLEAST(UT_GetNumEventsSent(), NumEvts + 1); } else { @@ -1536,7 +1533,7 @@ void Test_SB_Cmds_SendPrevSubs(void) /* Event count is only exact if there were no collisions */ if (UT_EventIsInHistory(CFE_SB_HASHCOLLISION_EID)) { - CFE_UtAssert_ATLEAST(UT_GetNumEventsSent(), NumEvts + 1); + UtAssert_UINT32_ATLEAST(UT_GetNumEventsSent(), NumEvts + 1); } else { @@ -1869,8 +1866,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; - CFE_UtAssert_TRUE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(1))); - CFE_UtAssert_FALSE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(2))); + UtAssert_TRUE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(1))); + UtAssert_FALSE(CFE_SB_CheckPipeDescSlotUsed(UT_SB_MakePipeIdForIndex(2))); } /* end Test_CreatePipe_MaxPipes */ @@ -3643,7 +3640,7 @@ void Test_TransmitMsgValidate_NoSubscribers(void) CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsgValidate(&TlmPkt.Hdr.Msg, &MsgIdRtn, &SizeRtn, &RouteIdRtn)); CFE_UtAssert_MSGID_EQ(MsgIdRtn, MsgId); UtAssert_INT32_EQ(SizeRtn, Size); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(RouteIdRtn)); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(RouteIdRtn)); CFE_UtAssert_EVENTCOUNT(1); @@ -4006,7 +4003,7 @@ void Test_CFE_SB_MsgHdrSize(void) * The function is called for coverage, but the result is not verified * due to this mismatch. */ - CFE_UtAssert_VOIDCALL(CFE_SB_MsgHdrSize(NULL)); + UtAssert_VOIDCALL(CFE_SB_MsgHdrSize(NULL)); } /* end Test_CFE_SB_MsgHdrSize */ @@ -4130,15 +4127,15 @@ void Test_CFE_SB_SetGetUserDataLength(void) * The function is called for coverage, but the result is not verified * due to this mismatch. */ - CFE_UtAssert_VOIDCALL(CFE_SB_GetUserDataLength(NULL)); + UtAssert_VOIDCALL(CFE_SB_GetUserDataLength(NULL)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(&msg, 0)); - CFE_UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(NULL, 0)); + UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(&msg, 0)); + UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(NULL, 0)); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetHasSecondaryHeader), &hassec, sizeof(hassec), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &type, sizeof(type), false); - CFE_UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(&msg, CFE_MISSION_SB_MAX_SB_MSG_SIZE + 1)); + UtAssert_VOIDCALL(CFE_SB_SetUserDataLength(&msg, CFE_MISSION_SB_MAX_SB_MSG_SIZE + 1)); } /* end Util_CFE_SB_SetGetUserDataLength */ @@ -4251,7 +4248,7 @@ void Test_ReqToSendEvent_ErrLogic(void) /* if called from an invalid task ID, should be denied */ UT_SetDefaultReturnValue(UT_KEY(CFE_ES_TaskID_ToIndex), -1); UtAssert_INT32_EQ(CFE_SB_RequestToSendEvent(TaskId, Bit), CFE_SB_DENIED); - CFE_UtAssert_VOIDCALL(CFE_SB_FinishSendEvent(TaskId, Bit)); /* should be no-op */ + UtAssert_VOIDCALL(CFE_SB_FinishSendEvent(TaskId, Bit)); /* should be no-op */ UT_ClearDefaultReturnValue(UT_KEY(CFE_ES_TaskID_ToIndex)); CFE_UtAssert_EVENTCOUNT(0); @@ -4639,50 +4636,50 @@ void Test_MessageString(void) /* Test setting string where the destination size > source string size */ CFE_SB_MessageStringSet(DestString, SrcString, sizeof(DestString), sizeof(SrcString)); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); /* Test setting string where the source string is empty */ memset(SrcString, 0, sizeof(SrcString)); memset(DestString, 'q', sizeof(DestString)); CFE_SB_MessageStringSet(DestString, SrcString, sizeof(DestString), sizeof(SrcString)); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); SrcString[0] = 'a'; CFE_SB_MessageStringSet(DestString, SrcString, sizeof(DestString), 1); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); /* Test setting string where the destination size < source string size */ strcpy(SrcString, "abcdefg"); memset(DestString, 'q', sizeof(DestString)); CFE_SB_MessageStringSet(DestString, SrcString, 4, sizeof(SrcString)); - CFE_UtAssert_STRINGBUF_EQ(DestString, 4, SrcString, 4); + UtAssert_STRINGBUF_EQ(DestString, 4, SrcString, 4); /* Test getting string where the destination size > source string size */ strcpy(SrcString, "abcdefg"); memset(DestString, 'q', sizeof(DestString)); CFE_SB_MessageStringGet(DestString, SrcString, DefString, sizeof(DestString), 5); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, 5); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, 5); /* Test getting string where the destination size is zero */ memset(DestString, 'q', sizeof(DestString)); memset(SrcString, 'k', sizeof(SrcString)); CFE_SB_MessageStringGet(DestString, SrcString, DefString, 0, sizeof(SrcString)); memset(SrcString, 'q', sizeof(SrcString)); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), SrcString, sizeof(SrcString)); /* Test getting string where the default string is NULL */ memset(DestString, 'q', sizeof(DestString)); CFE_SB_MessageStringGet(DestString, SrcString, NULL, sizeof(DestString), 0); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), "", 0); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), "", 0); /* Test getting string where the source string size is zero */ CFE_SB_MessageStringGet(DestString, SrcString, DefString, sizeof(DestString), 0); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), DefString, sizeof(DefString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), DefString, sizeof(DefString)); CFE_SB_MessageStringGet(DestString, "", DefString, sizeof(DestString), 1); - CFE_UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), DefString, sizeof(DefString)); + UtAssert_STRINGBUF_EQ(DestString, sizeof(DestString), DefString, sizeof(DefString)); /* Test getting string where the destination size < source string size */ strcpy(SrcString, "abcdefg"); memset(DestString, 'q', sizeof(DestString)); CFE_SB_MessageStringGet(DestString, SrcString, DefString, 4, sizeof(SrcString)); - CFE_UtAssert_STRINGBUF_EQ(DestString, 4, SrcString, 3); + UtAssert_STRINGBUF_EQ(DestString, 4, SrcString, 3); } /* end Test_MessageString */ 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 38800a178..09ec880b7 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c @@ -42,7 +42,7 @@ void Test_SBR_Map_Direct(void) UtPrintf("Invalid msg checks"); UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); UtPrintf("Initialize map"); CFE_SBR_Init_Map(); @@ -87,7 +87,7 @@ void Test_SBR_Map_Direct(void) routeid = CFE_SBR_INVALID_ROUTE_ID; UtAssert_INT32_EQ(CFE_SBR_SetRouteId(msgid, routeid), 0); UtAssert_INT32_EQ(CFE_SBR_GetRouteId(msgid).RouteId, routeid.RouteId); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(msgid))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(msgid))); /* 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 1f173584a..20246a884 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c @@ -61,7 +61,7 @@ void Test_SBR_Map_Hash(void) UtPrintf("Invalid msg checks"); UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0)))); UtPrintf("Initialize routing and map"); CFE_SBR_Init(); 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 0b654041c..566805f0e 100644 --- a/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c @@ -51,8 +51,8 @@ void Test_SBR_Route_Unsort_General(void) CFE_SBR_Init(); UtPrintf("Invalid msg checks"); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL))); - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions))); UtAssert_INT32_EQ(collisions, 0); /* @@ -71,7 +71,7 @@ void Test_SBR_Route_Unsort_General(void) msgid = CFE_SB_ValueToMsgId(CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); routeid = CFE_SBR_AddRoute(msgid, &collisions); UtAssert_INT32_EQ(collisions, 0); - CFE_UtAssert_TRUE(CFE_SBR_IsValidRouteId(routeid)); + UtAssert_TRUE(CFE_SBR_IsValidRouteId(routeid)); UtPrintf("Callback test with one route"); count = 0; @@ -89,7 +89,7 @@ void Test_SBR_Route_Unsort_General(void) UtAssert_INT32_EQ(count + 1, CFE_PLATFORM_SB_MAX_MSG_IDS); /* Try one more for good luck */ - CFE_UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(count), NULL))); + UtAssert_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(count), NULL))); /* Check that maximum msgid is still in the table */ UtAssert_INT32_EQ(CFE_SB_MsgIdToValue(CFE_SBR_GetMsgId(routeid)), CFE_PLATFORM_SB_HIGHEST_VALID_MSGID); @@ -128,7 +128,7 @@ void Test_SBR_Route_Unsort_GetSet(void) routeid[1] = CFE_SBR_ValueToRouteId(CFE_PLATFORM_SB_MAX_MSG_IDS); for (i = 0; i < 2; i++) { - CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(CFE_SBR_GetMsgId(routeid[i]), CFE_SB_INVALID_MSG_ID)); + 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); UtAssert_INT32_EQ(CFE_SBR_GetSequenceCounter(routeid[i]), 0); } @@ -171,7 +171,7 @@ void Test_SBR_Route_Unsort_GetSet(void) UT_SetDefaultReturnValue(UT_KEY(CFE_MSG_GetNextSequenceCount), seqcntexpected[0]); for (i = 0; i < 3; i++) { - CFE_UtAssert_TRUE(CFE_SB_MsgId_Equal(msgid[i], CFE_SBR_GetMsgId(routeid[i]))); + UtAssert_TRUE(CFE_SB_MsgId_Equal(msgid[i], CFE_SBR_GetMsgId(routeid[i]))); CFE_SBR_IncrementSequenceCounter(routeid[0]); } UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 3); diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index de0ebf422..93bc34378 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -504,7 +504,7 @@ void Test_CFE_TBL_AbortLoadCmd(void) CFE_TBL_Global.Registry[0].DoubleBuffered = true; CFE_TBL_Global.LoadBuffs[0].Taken = true; CFE_TBL_AbortLoad(&CFE_TBL_Global.Registry[0]); - CFE_UtAssert_TRUE(CFE_TBL_Global.LoadBuffs[0].Taken); + UtAssert_TRUE(CFE_TBL_Global.LoadBuffs[0].Taken); /* Restore values for subsequent tests */ CFE_TBL_Global.Registry[0].LoadInProgress = load; @@ -940,7 +940,7 @@ void Test_CFE_TBL_DumpRegCmd(void) CFE_TBL_Global.Registry[0].DoubleBuffered = true; LocalBuf = NULL; LocalSize = 0; - CFE_UtAssert_FALSE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, 0, &LocalBuf, &LocalSize)); + UtAssert_FALSE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, 0, &LocalBuf, &LocalSize)); UtAssert_NOT_NULL(LocalBuf); UtAssert_NONZERO(LocalSize); @@ -949,14 +949,14 @@ void Test_CFE_TBL_DumpRegCmd(void) CFE_TBL_Global.Handles[2].NextLink = CFE_TBL_END_OF_LIST; LocalBuf = NULL; LocalSize = 0; - CFE_UtAssert_TRUE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, CFE_PLATFORM_TBL_MAX_NUM_TABLES - 1, - &LocalBuf, &LocalSize)); + UtAssert_TRUE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, CFE_PLATFORM_TBL_MAX_NUM_TABLES - 1, + &LocalBuf, &LocalSize)); UtAssert_NOT_NULL(LocalBuf); UtAssert_NONZERO(LocalSize); /* Test with record numb beyond EOF (should be ignored, return null) */ - CFE_UtAssert_TRUE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, CFE_PLATFORM_TBL_MAX_NUM_TABLES + 1, - &LocalBuf, &LocalSize)); + UtAssert_TRUE(CFE_TBL_DumpRegistryGetter(&CFE_TBL_Global.RegDumpState, CFE_PLATFORM_TBL_MAX_NUM_TABLES + 1, + &LocalBuf, &LocalSize)); UtAssert_NULL(LocalBuf); UtAssert_ZERO(LocalSize); } @@ -1813,7 +1813,7 @@ void Test_CFE_TBL_Register(void) CFE_SEVERITY_ERROR); AccessDescPtr = &CFE_TBL_Global.Handles[TblHandle2]; RegRecPtr = &CFE_TBL_Global.Registry[AccessDescPtr->RegIndex]; - CFE_UtAssert_FALSE(RegRecPtr->DoubleBuffered); + UtAssert_FALSE(RegRecPtr->DoubleBuffered); UtAssert_ZERO(RegRecPtr->ActiveBufferIndex); CFE_TBL_Global.Handles[0].UsedFlag = true; } @@ -3417,7 +3417,7 @@ void Test_CFE_TBL_Internal(void) CFE_TBL_CleanUpApp(UT_TBL_APPID_1); UtAssert_INT32_EQ(CFE_TBL_Global.DumpControlBlocks[3].State, CFE_TBL_DUMP_FREE); CFE_UtAssert_RESOURCEID_EQ(RegRecPtr->OwnerAppId, CFE_TBL_NOT_OWNED); - CFE_UtAssert_FALSE(CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].Taken); + UtAssert_FALSE(CFE_TBL_Global.LoadBuffs[RegRecPtr->LoadInProgress].Taken); UtAssert_INT32_EQ(RegRecPtr->LoadInProgress, CFE_TBL_NO_LOAD_IN_PROGRESS); /* Test response to an attempt to use an invalid table handle */ diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index fd8bea75d..921d45d8e 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -844,7 +844,7 @@ void Test_Print(void) if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:00.00000"); - CFE_UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); + UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else { @@ -863,7 +863,7 @@ void Test_Print(void) if (usingDefaultEpoch) { strcpy(expectedBuf, "1980-001-00:00:59.00000"); - CFE_UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); + UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else { @@ -880,7 +880,7 @@ void Test_Print(void) if (usingDefaultEpoch) { strcpy(expectedBuf, "2013-001-02:03:04.00005"); - CFE_UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); + UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else { @@ -897,7 +897,7 @@ void Test_Print(void) if (usingDefaultEpoch) { strcpy(expectedBuf, "2116-038-06:28:15.99999"); - CFE_UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); + UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedBuf, sizeof(expectedBuf)); } else { @@ -2245,7 +2245,7 @@ void Test_1Hz(void) CFE_TIME_Global.MaxLocalClock.Seconds = CFE_PLATFORM_TIME_CFG_LATCH_FLY - 1; CFE_TIME_Global.MaxLocalClock.Subseconds = 0; CFE_TIME_Local1HzStateMachine(); - CFE_UtAssert_TRUE(CFE_TIME_Global.AutoStartFly); + UtAssert_TRUE(CFE_TIME_Global.AutoStartFly); /* Test local 1Hz interrupt when enough time has elapsed since receiving a * time update to automatically update the MET @@ -2282,7 +2282,7 @@ void Test_1Hz(void) CFE_TIME_Global.ToneSignalLatch.Seconds = 1; CFE_TIME_Global.ToneSignalLatch.Subseconds = 0; CFE_TIME_Tone1HzISR(); - CFE_UtAssert_FALSE(CFE_TIME_Global.IsToneGood); + UtAssert_FALSE(CFE_TIME_Global.IsToneGood); /* Test the tone signal ISR call to the application synch callback * function by verifying the number of callbacks made matches the number @@ -2334,7 +2334,7 @@ void Test_1Hz(void) CFE_TIME_Global.ToneSignalLatch.Seconds = 0; CFE_TIME_Global.ToneSignalLatch.Subseconds = 0; CFE_TIME_Tone1HzISR(); - CFE_UtAssert_FALSE(CFE_TIME_Global.IsToneGood); + UtAssert_FALSE(CFE_TIME_Global.IsToneGood); /* Test the tone 1Hz task with the tone signal within the time limits */ UT_InitData(); @@ -2343,7 +2343,7 @@ void Test_1Hz(void) CFE_TIME_Global.ToneSignalLatch.Seconds = 0; CFE_TIME_Global.ToneSignalLatch.Subseconds = 0; CFE_TIME_Tone1HzISR(); - CFE_UtAssert_TRUE(CFE_TIME_Global.IsToneGood); + UtAssert_TRUE(CFE_TIME_Global.IsToneGood); /* Test the tone 1Hz task with the tone signal under the time limit */ UT_InitData(); @@ -2352,7 +2352,7 @@ void Test_1Hz(void) CFE_TIME_Global.ToneSignalLatch.Seconds = 0; CFE_TIME_Global.ToneSignalLatch.Subseconds = 0; CFE_TIME_Tone1HzISR(); - CFE_UtAssert_FALSE(CFE_TIME_Global.IsToneGood); + UtAssert_FALSE(CFE_TIME_Global.IsToneGood); /* Test local 1Hz interrupt when enough time has elapsed (subseconds) since * receiving a time update to automatically change the state to flywheel @@ -2368,7 +2368,7 @@ void Test_1Hz(void) CFE_TIME_FinishReferenceUpdate(RefState); UT_SetBSP_Time(0, 0); CFE_TIME_Local1HzStateMachine(); - CFE_UtAssert_TRUE(CFE_TIME_Global.AutoStartFly); + UtAssert_TRUE(CFE_TIME_Global.AutoStartFly); /* Test local 1Hz interrupt when enough time has not elapsed since * receiving a time update to automatically change the state to flywheel