Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete coverage test for cfe_es_api.c #465

Closed
avan989 opened this issue Jan 9, 2020 · 7 comments · Fixed by #1623 or #1632
Closed

Incomplete coverage test for cfe_es_api.c #465

avan989 opened this issue Jan 9, 2020 · 7 comments · Fixed by #1623 or #1632
Assignees
Milestone

Comments

@avan989
Copy link
Contributor

avan989 commented Jan 9, 2020

Is your feature request related to a problem? Please describe.
current coverage: 97.7 %
Missing coverage for the following:

CFE_ES_SetAppState

     197             :         /* Caller error - invalid state */
     198           0 :         return;

CFE_ES_ReloadApp

     314           0 :            CFE_ES_SysLogWrite_Unsync ("CFE_ES_ReloadApp: Cannot Reload Application %s, File %s does not exist.\n",
     315           0 :                                   CFE_ES_Global.AppTable[AppID].StartParams.Name,
     316             :                                   AppFileName);
     317           0 :            ReturnCode = CFE_ES_FILE_IO_ERR;

CFE_ES_ExitApp

     471           0 :           CFE_ES_SysLogWrite_Unsync ("Application %s called CFE_ES_ExitApp\n",
     472           0 :                                  CFE_ES_Global.AppTable[AppID].StartParams.Name);
     473           0 :           CFE_ES_SetAppState(AppID, CFE_ES_AppState_STOPPED);
     474             : 
     475             :           /*
     476             :           ** Unlock the ES Shared data before suspending the app 
     477             :           */
     478           0 :           CFE_ES_UnlockSharedData(__func__,__LINE__);
     479             : 
     480             :           /*
     481             :           ** Suspend the Application until ES kills it.
     482             :           ** It might be better to have a way of suspending the app in the OS
     483             :           */
     484             :           while(1)
     485             :           {
     486           0 :              OS_TaskDelay(500);

CFE_ES_DeleteChildTask

    1272           0 :        CFE_ES_WriteToSysLog("CFE_ES_DeleteChildTask Error: Invalid Task ID: %u\n",(unsigned int)OSTaskId );
    1273           0 :        ReturnCode = CFE_ES_ERR_TASKID;

CFE_ES_GetAppIDInternal

1758 0 : *AppIdPtr = 0;

Requester Info
Anh Van, NASA Goddard

@pepepr08
Copy link
Contributor

CFE_ES_SetAppState no longer in cfe_es_api.c

@pepepr08
Copy link
Contributor

CFE_ES_ReloadApp tests are outdated. Comments don't match the actual test. I will be adding new tests for the whole function.

@pepepr08
Copy link
Contributor

Testing CFE_ES_ExitApp involves an infinite loop. This will be handled separately.

@skliper
Copy link
Contributor

skliper commented Jun 15, 2021

Testing CFE_ES_ExitApp involves an infinite loop. This will be handled separately.

Could you write a separate issue for any infinite loops you encounter? These will be addressed separately. This issue can be closed once the coverage possible with the current implementation is achieved.

@pepepr08
Copy link
Contributor

For CFE_ES_DeleteChildTask, the "invalid Invalid Task ID" error case was already being covered but code will be added to cover the "Task ID is not active" error case.

@pepepr08
Copy link
Contributor

CFE_ES_GetAppIDInternal has been removed, but UT code will be added to cover the null case on CFE_ES_GetAppID, CFE_ES_GetAppIDByName and CFE_ES_RegisterCDS

pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 15, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 15, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 15, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 16, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 16, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 16, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jun 16, 2021
Test CFE_ES_ReloadApp bad AppID, core app, file doesn't exist
Test CFE_ES_GetAppID: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL AppID pointer
Test CFE_ES_GetAppIDByName: NULL name pointer
Test CFE_ES_DeleteChildTask: Task inactive/invalid case
Test CFE_ES_RegisterCDS: NULL handle and NULL name
@pepepr08
Copy link
Contributor

Testing CFE_ES_ExitApp involves an infinite loop. This will be handled separately.

Could you write a separate issue for any infinite loops you encounter? These will be addressed separately. This issue can be closed once the coverage possible with the current implementation is achieved.

Created #1628 for infinite loop test case in CFE_ES_ExitApp

astrogeco added a commit that referenced this issue Jun 23, 2021
Fix #465, Added UT tests for cFE ES Api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants