From 3ae587ce48172c4ae06126ecf0a6ee20e0b31f7c Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 24 Aug 2020 17:53:54 -0400 Subject: [PATCH] Fix #165, Add CFE_PSP_GetProcessorName stub --- ut-stubs/ut_psp_stubs.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ut-stubs/ut_psp_stubs.c b/ut-stubs/ut_psp_stubs.c index eb6e1d53..9687417f 100644 --- a/ut-stubs/ut_psp_stubs.c +++ b/ut-stubs/ut_psp_stubs.c @@ -143,6 +143,37 @@ uint32 CFE_PSP_GetSpacecraftId(void) return status; } +/*****************************************************************************/ +/** +** \brief CFE_PSP_GetProcessorName stub function +** +** \par Description +** This function is used as a placeholder for the PSP function +** CFE_PSP_GetProcessorName. It is set to return a fixed value for the +** unit tests. +** +** \par Assumptions, External Events, and Notes: +** None +** +** \returns +** Returns Default_CpuName or passed in address from buffer +** +******************************************************************************/ +const char *CFE_PSP_GetProcessorName(void) +{ + int32 status; + const char *ptr = GLOBAL_CONFIGDATA.Default_CpuName; + + status = UT_DEFAULT_IMPL(CFE_PSP_GetProcessorName); + + if (status >= 0) + { + UT_Stub_CopyToLocal(UT_KEY(CFE_PSP_GetProcessorName), &ptr, sizeof(ptr)); + } + + return ptr; +} + /*****************************************************************************/ /** v** \brief CFE_PSP_GetTime stub function