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 #125, Adds utassert macro for logging function calls #126

Merged
merged 1 commit into from
Feb 15, 2024
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
22 changes: 11 additions & 11 deletions unit-test/ds_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void DS_AppMain_Test_Nominal(void)
UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &forced_Size, sizeof(forced_Size), false);

/* Execute the function being tested */
DS_AppMain();
UtAssert_VOIDCALL(DS_AppMain());

/* Verify results */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
Expand All @@ -95,7 +95,7 @@ void DS_AppMain_Test_AppInitializeError(void)
UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, -1);

/* Execute the function being tested */
DS_AppMain();
UtAssert_VOIDCALL(DS_AppMain());

/* Verify results */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
Expand All @@ -115,7 +115,7 @@ void DS_AppMain_Test_SBError(void)
UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_PIPE_RD_ERR);

/* Execute the function being tested */
DS_AppMain();
UtAssert_VOIDCALL(DS_AppMain());

/* Verify results */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
Expand All @@ -135,7 +135,7 @@ void DS_AppMain_Test_SBTimeout(void)
UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_TIME_OUT);

/* Execute the function being tested */
DS_AppMain();
UtAssert_VOIDCALL(DS_AppMain());

/* Verify results */
UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
Expand Down Expand Up @@ -259,7 +259,7 @@ void DS_AppSendHkCmd_Test(void)
}

/* Execute the function being tested */
DS_AppSendHkCmd();
UtAssert_VOIDCALL(DS_AppSendHkCmd());

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.FileStatus[0].FileRate, 99 / DS_SECS_PER_HK_CYCLE);
Expand Down Expand Up @@ -293,7 +293,7 @@ void DS_AppSendHkCmd_Test_SnprintfFail(void)
UT_SetDeferredRetcode(UT_KEY(stub_snprintf), 1, -1);

/* Execute the function being tested */
DS_AppSendHkCmd();
UtAssert_VOIDCALL(DS_AppSendHkCmd());

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.FileStatus[0].FileRate, 99 / DS_SECS_PER_HK_CYCLE);
Expand Down Expand Up @@ -329,7 +329,7 @@ void DS_AppSendHkCmd_Test_TblFail(void)
UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_GetInfo), -1);

/* Execute the function being tested */
DS_AppSendHkCmd();
UtAssert_VOIDCALL(DS_AppSendHkCmd());

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.FileStatus[0].FileRate, 99 / DS_SECS_PER_HK_CYCLE);
Expand Down Expand Up @@ -363,7 +363,7 @@ void DS_AppStorePacket_Test_Nominal(void)
DS_AppData.AppEnableState = DS_ENABLED;

/* Execute the function being tested */
DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf);
UtAssert_VOIDCALL(DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf));

/* Verify results -- IgnoredPktCounter increments in call to DS_FileStorePacket() */
UtAssert_UINT32_EQ(DS_AppData.IgnoredPktCounter, 0);
Expand All @@ -387,7 +387,7 @@ void DS_AppStorePacket_Test_DSDisabled(void)
DS_AppData.AppEnableState = DS_DISABLED;

/* Execute the function being tested */
DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf);
UtAssert_VOIDCALL(DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf));

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.DisabledPktCounter, 1);
Expand All @@ -410,7 +410,7 @@ void DS_AppStorePacket_Test_FilterTableNotLoaded(void)
DS_AppData.FilterTblPtr = 0;

/* Execute the function being tested */
DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf);
UtAssert_VOIDCALL(DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf));

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.IgnoredPktCounter, 1);
Expand All @@ -433,7 +433,7 @@ void DS_AppStorePacket_Test_DestFileTableNotLoaded(void)
DS_AppData.DestFileTblPtr = 0;

/* Execute the function being tested */
DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf);
UtAssert_VOIDCALL(DS_AppStorePacket(MessageID, &UT_CmdBuf.Buf));

/* Verify results */
UtAssert_UINT32_EQ(DS_AppData.IgnoredPktCounter, 1);
Expand Down
Loading
Loading