Skip to content

Commit

Permalink
Fix #64, add CFE_SB_InitMsg() for housekeeping UT (HOTFIX)
Browse files Browse the repository at this point in the history
The FSW code relies on the message being pre-initalized which
needs to be done explicitly in unit test code.
  • Loading branch information
jphickey committed May 11, 2020
1 parent 8a77aa7 commit 155a3e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,18 @@ void Test_SAMPLE_ReportHousekeeping(void)
SAMPLE_AppData.CmdCounter = 22;
SAMPLE_AppData.ErrCounter = 11;

/*
* CFE_SB_InitMsg() needs to be done to set the emulated MsgId and Length.
*
* The FSW code only does this once during init and relies on it
* remaining during the SAMPLE_ReportHousekeeping(). This does
* not happen during UT so it must be initialized again here.
*/
CFE_SB_InitMsg(&SAMPLE_AppData.HkBuf.MsgHdr,
SAMPLE_APP_HK_TLM_MID,
sizeof(SAMPLE_AppData.HkBuf),
true);

/*
* Set up to "capture" the telemetry message
*/
Expand Down

0 comments on commit 155a3e7

Please sign in to comment.