From 0811425dc2a4e8518f1ffa4539430329c16da65f Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Wed, 11 Dec 2024 14:36:48 +0100 Subject: [PATCH] Fix #445, Coverage Test typos + bugs --- fsw/modules/rtems_sysmon/rtems_sysmon.c | 4 ++-- fsw/pc-rtems/src/cfe_psp_memory.c | 2 +- .../modules/port_direct/coveragetest-port_direct.c | 2 +- .../modules/ram_direct/coveragetest-ram_direct.c | 2 +- .../modules/rtems_sysmon/coveragetest-rtems_sysmon.c | 4 ++-- .../vxworks_sysmon/src/coveragetest-vxworks_sysmon.c | 6 +++--- .../shared/src/coveragetest-cfe-psp-memrange.c | 1 - 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fsw/modules/rtems_sysmon/rtems_sysmon.c b/fsw/modules/rtems_sysmon/rtems_sysmon.c index 8b9b355a..a44188a5 100644 --- a/fsw/modules/rtems_sysmon/rtems_sysmon.c +++ b/fsw/modules/rtems_sysmon/rtems_sysmon.c @@ -127,7 +127,7 @@ void rtems_sysmon_Init(uint32_t local_module_id) rtems_sysmon_global.local_module_id = local_module_id; } -static bool rtems_cpu_usage_vistor(Thread_Control *the_thread, void *arg) +static bool rtems_cpu_usage_visitor(Thread_Control *the_thread, void *arg) { rtems_sysmon_cpuload_state_t *state = (rtems_sysmon_cpuload_state_t *)arg; rtems_sysmon_cpuload_core_t* core_p = &state->per_core[state->num_cpus]; @@ -213,7 +213,7 @@ static bool rtems_cpu_usage_vistor(Thread_Control *the_thread, void *arg) void rtems_sysmon_update_stat(rtems_sysmon_cpuload_state_t *state) { state->num_cpus = 0; - rtems_task_iterate( rtems_cpu_usage_vistor, state); + rtems_task_iterate(rtems_cpu_usage_visitor, state); } rtems_task rtems_sysmon_Task(rtems_task_argument arg) diff --git a/fsw/pc-rtems/src/cfe_psp_memory.c b/fsw/pc-rtems/src/cfe_psp_memory.c index e8bb018c..af87f2b9 100644 --- a/fsw/pc-rtems/src/cfe_psp_memory.c +++ b/fsw/pc-rtems/src/cfe_psp_memory.c @@ -182,7 +182,7 @@ int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumByt return_code = OS_ERROR; } - } /* end if PtrToDataToWrite == NULL */ + } /* end if PtrToDataToRead == NULL */ return return_code; } diff --git a/unit-test-coverage/modules/port_direct/coveragetest-port_direct.c b/unit-test-coverage/modules/port_direct/coveragetest-port_direct.c index a0cc90a3..d2593549 100644 --- a/unit-test-coverage/modules/port_direct/coveragetest-port_direct.c +++ b/unit-test-coverage/modules/port_direct/coveragetest-port_direct.c @@ -176,7 +176,7 @@ void Test_CFE_PSP_PortRead32(void) UtAddress2 = (cpuaddr)&UT_RAM_BLOCK.u32[4]; UT_RAM_BLOCK.u32[3] = 0xAABBCCDD; - UT_RAM_BLOCK.u32[3] = 0x44556677; + UT_RAM_BLOCK.u32[4] = 0x44556677; UtAssert_INT32_EQ(CFE_PSP_PortRead32(UtAddress1, NULL), CFE_PSP_INVALID_POINTER); UtAssert_INT32_EQ(CFE_PSP_PortRead32(UtAddress1, &Value1), CFE_PSP_SUCCESS); diff --git a/unit-test-coverage/modules/ram_direct/coveragetest-ram_direct.c b/unit-test-coverage/modules/ram_direct/coveragetest-ram_direct.c index c5de0979..2cda9b3e 100644 --- a/unit-test-coverage/modules/ram_direct/coveragetest-ram_direct.c +++ b/unit-test-coverage/modules/ram_direct/coveragetest-ram_direct.c @@ -164,7 +164,7 @@ void Test_CFE_PSP_MemRead32(void) UtAddress2 = (cpuaddr)&UT_RAM_BLOCK.u32[4]; UT_RAM_BLOCK.u32[3] = 0xAABBCCDD; - UT_RAM_BLOCK.u32[3] = 0x44556677; + UT_RAM_BLOCK.u32[4] = 0x44556677; UtAssert_INT32_EQ(CFE_PSP_MemRead32(UtAddress1, &Value1), CFE_PSP_SUCCESS); UtAssert_INT32_EQ(CFE_PSP_MemRead32(UtAddress2, &Value2), CFE_PSP_SUCCESS); diff --git a/unit-test-coverage/modules/rtems_sysmon/coveragetest-rtems_sysmon.c b/unit-test-coverage/modules/rtems_sysmon/coveragetest-rtems_sysmon.c index 14875710..78aea0bb 100644 --- a/unit-test-coverage/modules/rtems_sysmon/coveragetest-rtems_sysmon.c +++ b/unit-test-coverage/modules/rtems_sysmon/coveragetest-rtems_sysmon.c @@ -376,7 +376,7 @@ void rtems_sysmon_Init(uint32_t local_module_id) rtems_sysmon_global.local_module_id = local_module_id; } -static bool rtems_cpu_usage_vistor(Thread_Control *the_thread, void *arg) +static bool rtems_cpu_usage_visitor(Thread_Control *the_thread, void *arg) { rtems_sysmon_cpuload_state_t *state = (rtems_sysmon_cpuload_state_t *)arg; rtems_sysmon_cpuload_core_t * core_p = &state->per_core[state->num_cpus]; @@ -466,7 +466,7 @@ static bool rtems_cpu_usage_vistor(Thread_Control *the_thread, void *arg) void rtems_sysmon_update_stat(rtems_sysmon_cpuload_state_t *state) { state->num_cpus = 0; - rtems_task_iterate(rtems_cpu_usage_vistor, state); + rtems_task_iterate(rtems_cpu_usage_visitor, state); } rtems_task rtems_sysmon_Task(rtems_task_argument arg) diff --git a/unit-test-coverage/modules/vxworks_sysmon/src/coveragetest-vxworks_sysmon.c b/unit-test-coverage/modules/vxworks_sysmon/src/coveragetest-vxworks_sysmon.c index 310a4e82..5803793c 100644 --- a/unit-test-coverage/modules/vxworks_sysmon/src/coveragetest-vxworks_sysmon.c +++ b/unit-test-coverage/modules/vxworks_sysmon/src/coveragetest-vxworks_sysmon.c @@ -98,10 +98,10 @@ void Test_Aggregate_Nominal(void) { int32 StatusCode; int32 IsRunningStatus; - ; + CFE_PSP_IODriver_AdcCode_t Sample; CFE_PSP_IODriver_AnalogRdWr_t RdWr = {.NumChannels = 1, .Samples = &Sample}; - ; + CFE_PSP_IODriver_Direction_t QueryDirArg; CFE_PSP_IODriver_API_t * EntryAPI = TgtAPI->ExtendedApi; @@ -181,7 +181,7 @@ void Test_Aggregate_Error(void) int32 IsRunningStatus; CFE_PSP_IODriver_AdcCode_t Sample; CFE_PSP_IODriver_AnalogRdWr_t RdWr = {.NumChannels = 1, .Samples = &Sample}; - ; + /* Error Case: Look Up Subsystem Not Found */ StatusCode = EntryAPI->DeviceCommand(CFE_PSP_IODriver_LOOKUP_SUBSYSTEM, 0, 0, CFE_PSP_IODriver_CONST_STR("Empty")); diff --git a/unit-test-coverage/shared/src/coveragetest-cfe-psp-memrange.c b/unit-test-coverage/shared/src/coveragetest-cfe-psp-memrange.c index 3ccf1a70..899c4307 100644 --- a/unit-test-coverage/shared/src/coveragetest-cfe-psp-memrange.c +++ b/unit-test-coverage/shared/src/coveragetest-cfe-psp-memrange.c @@ -84,7 +84,6 @@ void Test_CFE_PSP_MemRangeSet(void) UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(UINT32_MAX, CFE_PSP_MEM_RAM, 0, 32, 1, 0), CFE_PSP_INVALID_MEM_RANGE); UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, 0, 0, 32, 1, 0), CFE_PSP_INVALID_MEM_TYPE); UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, CFE_PSP_MEM_RAM, 0, 32, 1, 0), CFE_PSP_INVALID_MEM_ATTR); - UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, CFE_PSP_MEM_RAM, 0, 32, 1, 0), CFE_PSP_INVALID_MEM_ATTR); UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, CFE_PSP_MEM_RAM, 0, 32, 2, CFE_PSP_MEM_ATTR_READWRITE), CFE_PSP_SUCCESS); UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, CFE_PSP_MEM_RAM, 0, 32, 4, CFE_PSP_MEM_ATTR_READWRITE), CFE_PSP_SUCCESS); UtAssert_INT32_EQ(CFE_PSP_MemRangeSet(0, CFE_PSP_MEM_RAM, 0, 32, 8, CFE_PSP_MEM_ATTR_READWRITE),