Skip to content

Commit

Permalink
fixup! TEST- use output on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey committed Nov 17, 2023
1 parent d940cea commit f20ba2f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/sb/ut-coverage/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -3015,8 +3015,8 @@ void Test_TransmitMsg_UpdateHeader(void)

memset(&TlmPkt, 0, sizeof(TlmPkt));

/* Set up hook for checking CFE_MSG_OriginationAction calls */
UT_SetHookFunction(UT_KEY(CFE_MSG_OriginationAction), UT_CheckSetSequenceCount, &SeqCnt);
/* Set up hook for checking CFE_MSG_SetSequenceCount calls */
UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt);

CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "SeqCntTestPipe"));
CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId, PipeId));
Expand All @@ -3029,6 +3029,7 @@ void Test_TransmitMsg_UpdateHeader(void)
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false);

CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true));
UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 1);
UtAssert_STUB_COUNT(CFE_MSG_OriginationAction, 1);
UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1);
UtAssert_INT32_EQ(SeqCnt, SeqCntExpected);
Expand All @@ -3039,6 +3040,7 @@ void Test_TransmitMsg_UpdateHeader(void)
CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), false));

/* Assert sequence count wasn't set */
UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 1);
UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 1);
UtAssert_STUB_COUNT(CFE_MSG_OriginationAction, 1);

Expand All @@ -3049,6 +3051,7 @@ void Test_TransmitMsg_UpdateHeader(void)
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false);
CFE_UtAssert_SUCCESS(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true));
UtAssert_INT32_EQ(SeqCnt, SeqCntExpected);
UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 2);
UtAssert_STUB_COUNT(CFE_MSG_OriginationAction, 2);
UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 2);

Expand All @@ -3063,6 +3066,7 @@ void Test_TransmitMsg_UpdateHeader(void)
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false);
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false);
CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 3 */
UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 3);
UtAssert_STUB_COUNT(CFE_MSG_OriginationAction, 3);
UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 3);

Expand All @@ -3075,6 +3079,7 @@ void Test_TransmitMsg_UpdateHeader(void)
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false);
CFE_UtAssert_SETUP(CFE_SB_TransmitMsg(CFE_MSG_PTR(TlmPkt.TelemetryHeader), true)); /* increment to 4 */
UtAssert_INT32_EQ(SeqCnt, SeqCntExpected);
UtAssert_STUB_COUNT(CFE_MSG_SetSequenceCount, 4);
UtAssert_STUB_COUNT(CFE_MSG_OriginationAction, 4);
UtAssert_STUB_COUNT(CFE_MSG_GetNextSequenceCount, 4);

Expand Down Expand Up @@ -3326,8 +3331,8 @@ void Test_TransmitBuffer_IncrementSeqCnt(void)
CFE_MSG_Size_t Size = sizeof(SB_UT_Test_Tlm_t);
CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm;

/* Set up hook for checking CFE_MSG_OriginationAction calls */
UT_SetHookFunction(UT_KEY(CFE_MSG_OriginationAction), UT_CheckSetSequenceCount, &SeqCnt);
/* Set up hook for checking CFE_MSG_SetSequenceCount calls */
UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt);

CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyTestPipe"));

Expand Down

0 comments on commit f20ba2f

Please sign in to comment.