Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18 #19, Remove TODOs and minor cleanup #20

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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