From f50c45fc5a14c1899188a6979dc2de8b3e289b21 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 7 Aug 2024 15:46:21 -0400 Subject: [PATCH] Fix #77, deprecate PSP stubs from MD coverage test The PSP now provides the complete set of stubs. IMPORTANT: This needs to be used in conjunction with nasa/PSP#436 to get the complete set of stubs, otherwise linking will fail. --- unit-test/md_dwell_pkt_tests.c | 10 +------- unit-test/utilities/md_test_utils.c | 40 ----------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/unit-test/md_dwell_pkt_tests.c b/unit-test/md_dwell_pkt_tests.c index 81bcf0d..56b9a96 100644 --- a/unit-test/md_dwell_pkt_tests.c +++ b/unit-test/md_dwell_pkt_tests.c @@ -353,15 +353,7 @@ void MD_DwellLoop_Test_DataError(void) UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); + UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 3); } void MD_GetDwellData_Test_MemRead8Error(void) diff --git a/unit-test/utilities/md_test_utils.c b/unit-test/utilities/md_test_utils.c index 0e25d3b..8201d8c 100644 --- a/unit-test/utilities/md_test_utils.c +++ b/unit-test/utilities/md_test_utils.c @@ -96,43 +96,3 @@ void MD_Test_TearDown(void) { /* cleanup test environment */ } - -int32 CFE_PSP_MemWrite8(cpuaddr MemoryAddress, uint8 ByteValue) -{ - if (!MemoryAddress) - return -1; - else - return CFE_PSP_SUCCESS; -} - -int32 CFE_PSP_MemRead16(cpuaddr MemoryAddress, uint16 *uint16Value) -{ - if (!MemoryAddress) - return -2; - else - return CFE_PSP_SUCCESS; -} - -int32 CFE_PSP_MemWrite16(cpuaddr MemoryAddress, uint16 uint16Value) -{ - if (!MemoryAddress) - return -1; - else - return CFE_PSP_SUCCESS; -} - -int32 CFE_PSP_MemRead32(cpuaddr MemoryAddress, uint32 *uint32Value) -{ - if (!MemoryAddress) - return -3; - else - return CFE_PSP_SUCCESS; -} - -int32 CFE_PSP_MemWrite32(cpuaddr MemoryAddress, uint32 uint32Value) -{ - if (!MemoryAddress) - return -1; - else - return CFE_PSP_SUCCESS; -}