diff --git a/src/unit-test-coverage/portable/src/coveragetest-bsd-sockets.c b/src/unit-test-coverage/portable/src/coveragetest-bsd-sockets.c index 9322fa2bc..e3f2ac551 100644 --- a/src/unit-test-coverage/portable/src/coveragetest-bsd-sockets.c +++ b/src/unit-test-coverage/portable/src/coveragetest-bsd-sockets.c @@ -316,10 +316,10 @@ void Test_OS_SocketRecvFrom_Impl(void) void Test_OS_SocketSendTo_Impl(void) { - OS_object_token_t token = {0}; - uint8 buffer[UT_BUFFER_SIZE]; - OS_SockAddr_t addr = {0}; - struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData; + OS_object_token_t token = {0}; + const uint8 buffer[UT_BUFFER_SIZE] = {0}; + OS_SockAddr_t addr = {0}; + struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData; /* Set up token */ token.obj_idx = UT_INDEX_0; @@ -393,9 +393,9 @@ void Test_OS_SocketAddrToString_Impl(void) void Test_OS_SocketAddrFromString_Impl(void) { - char buffer[UT_BUFFER_SIZE]; - OS_SockAddr_t addr = {0}; - struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData; + const char buffer[UT_BUFFER_SIZE] = "UT"; + OS_SockAddr_t addr = {0}; + struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData; /* Bad family */ sa->sa_family = -1; diff --git a/src/unit-test-coverage/shared/src/coveragetest-clock.c b/src/unit-test-coverage/shared/src/coveragetest-clock.c index 244f8b2e1..2490ddbdb 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-clock.c +++ b/src/unit-test-coverage/shared/src/coveragetest-clock.c @@ -50,9 +50,9 @@ void Test_OS_SetLocalTime(void) * Test Case For: * int32 OS_SetLocalTime(OS_time_t *time_struct) */ - OS_time_t time_struct; - int32 expected = OS_SUCCESS; - int32 actual = OS_SetLocalTime(&time_struct); + OS_time_t time_struct = OS_TimeAssembleFromMicroseconds(5, 12345); + int32 expected = OS_SUCCESS; + int32 actual = OS_SetLocalTime(&time_struct); UtAssert_True(actual == expected, "OS_SetLocalTime() (%ld) == OS_SUCCESS", (long)actual); diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-tasks.c b/src/unit-test-coverage/vxworks/src/coveragetest-tasks.c index afd7c3184..c99965219 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-tasks.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-tasks.c @@ -145,7 +145,7 @@ void Test_OS_TaskDetach_Impl(void) * Test Case For: * int32 OS_TaskDetach_Impl(const OS_object_token_t *token) */ - OS_object_token_t token; + OS_object_token_t token = UT_TOKEN_0; /* no-op on VxWorks - always returns success */ OSAPI_TEST_FUNCTION_RC(OS_TaskDetach_Impl(&token), OS_SUCCESS); diff --git a/src/unit-tests/oscore-test/ut_oscore_task_test.c b/src/unit-tests/oscore-test/ut_oscore_task_test.c index 3c4fb1e2e..879cd7093 100644 --- a/src/unit-tests/oscore-test/ut_oscore_task_test.c +++ b/src/unit-tests/oscore-test/ut_oscore_task_test.c @@ -605,7 +605,7 @@ void UT_os_task_get_info_test() **--------------------------------------------------------------------------------*/ void UT_os_task_getid_by_sysdata_test() { - uint8 sysdata; + uint8 sysdata = 0; osal_id_t task_id; /*