From ed598758fd43fc7e3f77dff984effd54945aeac3 Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Thu, 4 May 2023 14:40:19 +1000 Subject: [PATCH] Fix #2323, Remove unnecessary asserts in TIME invalid command length UT --- modules/time/ut-coverage/time_UT.c | 80 ------------------------------ 1 file changed, 80 deletions(-) diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 3a4961ac1..2bc25bb6e 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -1399,13 +1399,8 @@ void Test_PipeCmds(void) /* Noop with bad size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending the reset counters command */ UT_InitData(); @@ -1436,13 +1431,8 @@ void Test_PipeCmds(void) /* Reset counters with bad size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending the request diagnostics command */ UT_InitData(); @@ -1453,13 +1443,8 @@ void Test_PipeCmds(void) /* Request diagnostics with bad size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SEND_DIAGNOSTIC_TLM_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a clock state = invalid command */ UT_InitData(); @@ -1493,13 +1478,8 @@ void Test_PipeCmds(void) /* Set state with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_STATE_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending the set time source = internal command */ UT_InitData(); @@ -1536,13 +1516,8 @@ void Test_PipeCmds(void) /* Set time source with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_SOURCE_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a set tone signal source = primary command */ UT_InitData(); @@ -1593,13 +1568,8 @@ void Test_PipeCmds(void) /* Set tone signal source with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_SIGNAL_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a time tone add delay command */ UT_InitData(); @@ -1622,13 +1592,8 @@ void Test_PipeCmds(void) /* Time tone add delay with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_DELAY_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a time tone subtract delay command */ UT_InitData(); @@ -1649,13 +1614,8 @@ void Test_PipeCmds(void) /* Time tone subtract delay with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_DELAY_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a set time command */ UT_InitData(); @@ -1676,13 +1636,8 @@ void Test_PipeCmds(void) /* Set time with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_TIME_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a set MET command */ UT_InitData(); @@ -1703,13 +1658,8 @@ void Test_PipeCmds(void) /* Set MET with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_MET_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending a set STCF command */ UT_InitData(); @@ -1730,13 +1680,8 @@ void Test_PipeCmds(void) /* Set STCF with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_STCF_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending an adjust STCF positive command */ UT_InitData(); @@ -1757,13 +1702,8 @@ void Test_PipeCmds(void) /* Adjust STCF positive with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_ADJUST_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending an adjust STCF negative command */ UT_InitData(); @@ -1784,13 +1724,8 @@ void Test_PipeCmds(void) /* Adjust STCF negative with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_ADJUST_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending an adjust STCF 1 Hz positive command */ UT_InitData(); @@ -1812,13 +1747,8 @@ void Test_PipeCmds(void) /* Adjust STCF 1Hz positive with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_ADD_1HZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test sending an adjust STCF 1 Hz negative command */ UT_InitData(); @@ -1840,13 +1770,8 @@ void Test_PipeCmds(void) /* Adjust STCF 1 Hz negative with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SUB_1HZ_ADJUSTMENT_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test response to sending a tone delay command using an invalid time */ UT_InitData(); @@ -1904,13 +1829,8 @@ void Test_PipeCmds(void) /* Set leap seconds with invalid size */ UT_InitData(); - memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_TIME_Global.CommandCounter = 0; - CFE_TIME_Global.CommandErrorCounter = 0; UT_CallTaskPipe(CFE_TIME_TaskPipe, &CmdBuf.message, 0, UT_TPID_CFE_TIME_CMD_SET_LEAP_SECONDS_CC); CFE_UtAssert_EVENTSENT(CFE_TIME_LEN_ERR_EID); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandCounter, 0); - UtAssert_UINT32_EQ(CFE_TIME_Global.CommandErrorCounter, 1); /* Test response to sending an invalid command */ UT_InitData();