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_task.c related to GLOBAL_CONFIGDATA defined in psp stubs #1934

Closed
skliper opened this issue Sep 6, 2021 · 1 comment · Fixed by #1980
Closed

Comments

@skliper
Copy link
Contributor

skliper commented Sep 6, 2021

Is your feature request related to a problem? Please describe.
Many cases in cfe_es_task.c where code can't be exercised based on the definition of GLOBAL_CONFIGDATA in the psp. Example:

     194 [ +  + ][ -  + ]:         30 :     if (KeyName != NULL && ConfigList != NULL)
     195                 :            :     {
     196         [ #  # ]:          0 :         while (ConfigList->Key != NULL)
     197                 :            :         {
     198         [ #  # ]:          0 :             if (strcmp(KeyName, ConfigList->Key) == 0)
     199                 :            :             {
     200                 :          0 :                 ValuePtr = ConfigList->Value;
     201                 :          0 :                 break;
     202                 :            :             }
     203                 :            : 
     204                 :          0 :             ++ConfigList;
     205                 :            :         }
     206                 :            :     }

here:

if (KeyName != NULL && ConfigList != NULL)
{
while (ConfigList->Key != NULL)
{
if (strcmp(KeyName, ConfigList->Key) == 0)
{
ValuePtr = ConfigList->Value;
break;
}
++ConfigList;
}
}

Impacts CFE_ES_FindConfigKeyValue, CFE_ES_GenerateSingleVersionEvent, CFE_ES_GenerateVersionEvents, CFE_ES_GenerateBuildInfoEvents

Describe the solution you'd like
Provide a mechanism for overriding or defining GLOBAL_CONFIGDATA from the test code. Some branches require both NULL and non-NULL values for coverage, so likely would need multiple builds.

Describe alternatives you've considered
Coverage could be improved by just exposing a few of the internal routines and/or splitting up code and providing stubs. With 2 versions available from the PSP likely could achieve full coverage, but clunky to cross repos just for coverage...

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@skliper
Copy link
Contributor Author

skliper commented Mar 30, 2022

Resolved in #1980

@skliper skliper closed this as completed Mar 30, 2022
@skliper skliper added this to the Draco milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant