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

ES missing coverage in cfe_es_apps.c, CFE_ES_CleanupTaskResources #1696

Closed
pepepr08 opened this issue Jul 20, 2021 · 0 comments · Fixed by #1936 or #1939
Closed

ES missing coverage in cfe_es_apps.c, CFE_ES_CleanupTaskResources #1696

pepepr08 opened this issue Jul 20, 2021 · 0 comments · Fixed by #1936 or #1939
Assignees
Milestone

Comments

@pepepr08
Copy link
Contributor

pepepr08 commented Jul 20, 2021

Is your feature request related to a problem? Please describe.
CFE_ES_CleanupTaskResources function contains a hard to reach line (1723 below) that remains untested, preventing us from reaching 100% coverage in file.

        -: 1709:    /*
        -: 1710:    ** Delete the task itself
        -: 1711:    **
        -: 1712:    ** Note, if the task self exited, then the ID becomes invalid.
        -: 1713:    ** In this case the OS_ERR_INVALID_ID status is returned, but
        -: 1714:    ** that is OK, there is nothing else needed to do.
        -: 1715:    */
       74: 1716:    Result = OS_TaskDelete(OsalId);
       74: 1717:    if (Result == OS_SUCCESS || Result == OS_ERR_INVALID_ID)
        -: 1718:    {
       66: 1719:        Result = CleanState.OverallStatus;
      132: 1720:        if (Result == CFE_SUCCESS && CleanState.FoundObjects > 0)
        -: 1721:        {
        -: 1722:            /* Objects leftover after cleanup -- resource leak */
    #####: 1723:            Result = CFE_ES_APP_CLEANUP_ERR;
        -: 1724:        }
        -: 1725:    }

Describe the solution you'd like
Add coverage for line to complete 100% coverage in file.

Additional context
It's really difficult to recreate a case were CleanState.FoundObjects is greater than 0 since it always gets set to 0 in while(1)

https://github.com/nasa/cFE/blob/main/modules/es/fsw/src/cfe_es_apps.c#L1667-L1732

Requester Info
Jose F. Martinez Pedraza / NASA GSFC

@skliper skliper changed the title Missing coverage in cfe_es_apps.c Missing coverage in cfe_es_apps.c, CFE_ES_CleanupTaskResources Aug 24, 2021
@skliper skliper changed the title Missing coverage in cfe_es_apps.c, CFE_ES_CleanupTaskResources ES missing coverage in cfe_es_apps.c, CFE_ES_CleanupTaskResources Aug 27, 2021
@skliper skliper self-assigned this Sep 2, 2021
@skliper skliper added this to the 7.0.0 milestone Sep 2, 2021
skliper added a commit to skliper/cFE that referenced this issue Sep 6, 2021
astrogeco added a commit that referenced this issue Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants