From 4dd5bdaad9a984f3de3537271ece0563022a46ee Mon Sep 17 00:00:00 2001 From: Guillaume Lethuillier Date: Fri, 24 Apr 2020 19:52:50 +0200 Subject: [PATCH] Fix #637, Remove old CFE_ARINC653-related tests --- fsw/cfe-core/unit-test/es_UT.c | 173 --------------------------------- fsw/cfe-core/unit-test/es_UT.h | 25 ----- 2 files changed, 198 deletions(-) diff --git a/fsw/cfe-core/unit-test/es_UT.c b/fsw/cfe-core/unit-test/es_UT.c index 065f3a061..6bbfe43e6 100644 --- a/fsw/cfe-core/unit-test/es_UT.c +++ b/fsw/cfe-core/unit-test/es_UT.c @@ -46,10 +46,6 @@ extern CFE_ES_CDSBlockDesc_t CFE_ES_CDSBlockDesc; extern CFE_ES_TaskData_t CFE_ES_TaskData; extern CFE_ES_CDSPool_t CFE_ES_CDSMemPool; -#ifdef CFE_ARINC653 -extern CFE_ES_StaticStartupTable_t CFE_ES_StaticStartupTable[]; -#endif - extern int32 dummy_function(void); /* @@ -294,10 +290,6 @@ void UtTest_Setup(void) UT_ADD_TEST(TestESMempool); UT_ADD_TEST(TestSysLog); UT_ADD_TEST(TestBackground); - -#ifdef CFE_ARINC653 - UT_ADD_TEST(TestStaticApp); -#endif } /* @@ -7006,168 +6998,3 @@ void TestBackground(void) "CFE_ES_BackgroundTask - Nominal, CFE_ES_Global.BackgroundTask.NumJobsRunning (%u) == 1", (unsigned int)CFE_ES_Global.BackgroundTask.NumJobsRunning); } - - - -#ifdef CFE_ARINC653 -void TestStaticApp(void) -{ - int j; - uint32 Id; - uint32 LibraryIdPtr; - CFE_ES_AppMainFuncPtr_t MainFunc = 0; - - /* Test successful static app creation */ - ES_ResetUnitTest(); - CFE_ES_Global.AppTable[0].AppState = CFE_ES_AppState_RUNNING; - CFE_ES_Global.AppTable[1].AppState = CFE_ES_AppState_UNDEFINED; - CFE_ES_Global.TaskTable[1].RecordUsed = false; - UT_Report(__FILE__, __LINE__, - CFE_ES_StaticAppCreate(&Id, - MainFunc, - "AppName", - 170, - 4096, - 1) == CFE_SUCCESS && - CFE_ES_Global.TaskTable[1].RecordUsed == true, - "CFE_ES_StaticAppCreate", - "Create static application; successful"); - - /* Test static app creation with a task create failure */ - ES_ResetUnitTest(); - UT_SetForceFail(UT_KEY(OS_TaskCreate), OS_ERROR); - UT_Report(__FILE__, __LINE__, - CFE_ES_StaticAppCreate(&Id, - MainFunc, - "AppName", - 170, - 4096, - 1) == CFE_ES_ERR_APP_CREATE, - "CFE_ES_StaticAppCreate", - "Task create error"); - - /* Test static app creation specifying a slot already in use */ - ES_ResetUnitTest(); - CFE_ES_Global.TaskTable[0].RecordUsed = true; - UT_Report(__FILE__, __LINE__, - CFE_ES_StaticAppCreate(&Id, - MainFunc, - "AppName", - 170, - 4096, - 1) == CFE_SUCCESS, - "CFE_ES_StaticAppCreate", - "Task slot in use"); - - /* Test static app creation with no free slots available */ - ES_ResetUnitTest(); - - for (j = 0; j < CFE_PLATFORM_ES_MAX_APPLICATIONS; j++) - { - CFE_ES_Global.AppTable[j].AppState = CFE_ES_AppState_RUNNING; - } - - UT_Report(__FILE__, __LINE__, - CFE_ES_StaticAppCreate(&Id, - MainFunc, - "AppName", - 170, - 4096, - 1) == CFE_ES_ERR_APP_CREATE, - "CFE_ES_StaticAppCreate", - "No free application slots available"); - - /* Test successful static shared library initialization */ - ES_ResetUnitTest(); - UT_SetLibInitRtn(CFE_SUCCESS); - LibraryIdPtr = 1; - CFE_ES_Global.LibTable[0].RecordUsed = false; - UT_Report(__FILE__, __LINE__, - CFE_ES_InitStaticLibrary(&LibraryIdPtr, - (CFE_ES_LibInitFuncPtr_t) UT_LibInit, - "LibName") == CFE_SUCCESS && - LibraryIdPtr == 0, - "CFE_ES_InitStaticLibrary", - "Static library initialization; successful"); - - /* Test static shared library initialization with a library load failure */ - ES_ResetUnitTest(); - UT_SetLibInitRtn(CFE_ES_ERR_LOAD_LIB); - CFE_ES_Global.LibTable[0].RecordUsed = false; - UT_Report(__FILE__, __LINE__, - CFE_ES_InitStaticLibrary(&LibraryIdPtr, - (CFE_ES_LibInitFuncPtr_t) UT_LibInit, - "LibName") == CFE_ES_ERR_LOAD_LIB, - "CFE_ES_InitStaticLibrary", - "Shared library initialization failure"); - - /* Test static shared library initialization with no free - * slots available - */ - ES_ResetUnitTest(); - - for (j = 0; j < CFE_PLATFORM_ES_MAX_LIBRARIES; j++) - { - CFE_ES_Global.LibTable[j].RecordUsed = true; - } - - UT_Report(__FILE__, __LINE__, - CFE_ES_InitStaticLibrary(&LibraryIdPtr, - (CFE_ES_LibInitFuncPtr_t) UT_LibInit, - "LibName") == CFE_ES_ERR_LOAD_LIB, - "CFE_ES_InitStaticLibrary", - "No free library slots available"); - - /* Test successful static application initialization */ - ES_ResetUnitTest(); - - for (j = 0; j < CFE_PLATFORM_ES_MAX_LIBRARIES; j++) - { - CFE_ES_Global.LibTable[j].RecordUsed = false; - } - - strncpy(CFE_ES_StaticStartupTable[0].Name, - "StaticAppName", OS_MAX_API_NAME); - CFE_ES_StaticStartupTable[0].Name[OS_MAX_API_NAME - 1] = '\0'; - CFE_ES_StaticStartupTable[0].ObjectType = CFE_ES_STATIC_APP; - CFE_ES_StaticStartupTable[0].ExceptionAction = - CFE_ES_ExceptionAction_RESTART_APP + 1; - CFE_ES_StartStaticApplications(CFE_PSP_RST_TYPE_PROCESSOR); - UT_Report(__FILE__, __LINE__, - CFE_ES_StaticStartupTable[0].ExceptionAction == - CFE_ES_ExceptionAction_PROC_RESTART && - UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_NO_MESSAGE]), - "CFE_ES_StartStaticApplications", - "*Not implemented* Initialize static application; successful"); - - /* Test successful static library initialization */ - ES_ResetUnitTest(); - CFE_ES_StaticStartupTable[0].ObjectType = CFE_ES_STATIC_LIB; - CFE_ES_StartStaticApplications(CFE_PSP_RST_TYPE_PROCESSOR); - UT_Report(__FILE__, __LINE__, - UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_NO_MESSAGE]), - "CFE_ES_StartStaticApplications", - "*Not implemented* Initialize static shared library; successful"); - - /* Test successful static application initialization null action */ - ES_ResetUnitTest(); - CFE_ES_StaticStartupTable[0].ObjectType = CFE_ES_STATIC_NULL; - CFE_ES_StartStaticApplications(CFE_PSP_RST_TYPE_PROCESSOR); - UT_Report(__FILE__, __LINE__, - UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_NO_MESSAGE]), - "CFE_ES_StartStaticApplications", - "*Not implemented* No action"); - - /* Test successful static library initialization with an invalid - * entry type - */ - ES_ResetUnitTest(); - CFE_ES_StaticStartupTable[0].ObjectType = 0xff; - CFE_ES_StartStaticApplications(CFE_PSP_RST_TYPE_PROCESSOR); - UT_Report(__FILE__, __LINE__, - UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_NO_MESSAGE]), - "CFE_ES_StartStaticApplications", - "*Not implemented* Unexpected entry type"); -} -#endif - diff --git a/fsw/cfe-core/unit-test/es_UT.h b/fsw/cfe-core/unit-test/es_UT.h index b597c7a1d..6c35bb802 100644 --- a/fsw/cfe-core/unit-test/es_UT.h +++ b/fsw/cfe-core/unit-test/es_UT.h @@ -355,29 +355,4 @@ void TestESMempool(void); void TestSysLog(void); -#ifdef CFE_ARINC653 -/*****************************************************************************/ -/** -** \brief Perform tests on the cFE applications from statically linked code -** -** \par Description -** This function tests the code for creating and loading cFE -** applications from statically linked code, and for initializing -** static libraries. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** This function does not return a value. -** -** \sa #UT_InitData, #UT_Report, CFE_ES_StaticAppCreate, #UT_SetOSFail -** \sa #UT_SetLibInitRtn, #CFE_ES_InitStaticLibrary -** \sa #CFE_ES_StartStaticApplications -** -******************************************************************************/ -void TestStaticApp(void); -#endif - - #endif /* _es_ut_h_ */