Skip to content

Commit

Permalink
Merge pull request #20 from skliper/fix18_19-minor_cleanup
Browse files Browse the repository at this point in the history
Fix #18 #19, Remove TODOs and minor cleanup
  • Loading branch information
dzbaker committed Aug 3, 2022
2 parents fbb231e + 96fcd78 commit 5be8d11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
6 changes: 1 addition & 5 deletions fsw/src/hk_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,9 @@ void HK_AppPipe(const CFE_SB_Buffer_t *BufPtr)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void HK_SendCombinedHKCmd(const CFE_SB_Buffer_t *BufPtr)
{
CFE_SB_MsgId_t WhichCombinedPacket = CFE_SB_INVALID_MSG_ID;

HK_Send_Out_Msg_t *CmdPtr = (HK_Send_Out_Msg_t *)BufPtr;
WhichCombinedPacket = CmdPtr->OutMsgToSend;

HK_SendCombinedHkPacket(WhichCombinedPacket);

HK_SendCombinedHkPacket(CmdPtr->OutMsgToSend);
} /* end of HK_SendCombinedHKCmd() */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Expand Down
2 changes: 0 additions & 2 deletions fsw/src/hk_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ int32 HK_ProcessNewCopyTable(hk_copy_table_entry_t *CpyTblPtr, hk_runtime_tbl_en
OuterRtEntry->InputMidSubscribed = HK_INPUTMID_NOT_SUBSCRIBED;
OuterRtEntry->DataPresent = HK_DATA_NOT_PRESENT;
}
printf("after first loop\n");

/* Loop thru the table looking for all of the SB packets that need to be built */
for (Loop1 = 0; Loop1 < HK_COPY_TABLE_ENTRIES; Loop1++)
Expand Down Expand Up @@ -494,7 +493,6 @@ int32 HK_CheckStatusOfCopyTable(void)
/* Status should only be CFE_TBL_INFO_UPDATED because we updated it above */
if (Status == CFE_TBL_INFO_UPDATED)
{
printf("Calling HK_ProcessNewCopyTable\n");
Status = HK_ProcessNewCopyTable(HK_AppData.CopyTablePtr, HK_AppData.RuntimeTablePtr);

if (Status == CFE_SUCCESS)
Expand Down
17 changes: 8 additions & 9 deletions unit-test/hk_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,20 +1191,19 @@ void Test_HK_AppPipe_ProcessIncoming(void)
*/
void Test_HK_SendCombinedHKCmd(void)
{
/* Arrange */
CFE_SB_Buffer_t DummyBuf;
uint8 call_count_HK_SendCombinedHkPacket;
union
{
CFE_SB_Buffer_t sbbuf;
HK_Send_Out_Msg_t msg;
} msgbuf;

/* TODO set return value of CFE_SB_GetUserData and check input to
HK_SendCombinedHkPacket */
memset(&msgbuf, 0, sizeof(msgbuf));

/* Act */
HK_SendCombinedHKCmd(&DummyBuf);

call_count_HK_SendCombinedHkPacket = UT_GetStubCount(UT_KEY(HK_SendCombinedHkPacket));
HK_SendCombinedHKCmd(&msgbuf.sbbuf);

/* Assert */
UtAssert_INT32_EQ(call_count_HK_SendCombinedHkPacket, 1);
UtAssert_STUB_COUNT(HK_SendCombinedHkPacket, 1);
}

/**********************************************************************/
Expand Down

0 comments on commit 5be8d11

Please sign in to comment.