-
Notifications
You must be signed in to change notification settings - Fork 227
Description
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:
cFE/modules/es/fsw/src/cfe_es_task.c
Lines 194 to 206 in e5d4ed9
| 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