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 branch coverage in ES_QueryAllCmd, alternate config #1935

Open
skliper opened this issue Sep 6, 2021 · 1 comment
Open

ES missing branch coverage in ES_QueryAllCmd, alternate config #1935

skliper opened this issue Sep 6, 2021 · 1 comment

Comments

@skliper
Copy link
Contributor

skliper commented Sep 6, 2021

Is your feature request related to a problem? Please describe.
Would need a configuration where CFE_ES_QUERY_ALL_MAX_ENTRIES doesn't fit all the apps/libs:

    1297 [ +  + ][ +  - ]:        231 :     for (i = 0; i < CFE_PLATFORM_ES_MAX_APPLICATIONS && NumResources < CFE_ES_QUERY_ALL_MAX_ENTRIES; ++i)
    1298                 :            :     {
    1299         [ +  + ]:        224 :         if (CFE_ES_AppRecordIsUsed(AppRecPtr))
    1300                 :            :         {
    1301                 :          4 :             ResourceList[NumResources] = CFE_RESOURCEID_UNWRAP(CFE_ES_AppRecordGetID(AppRecPtr));
    1302                 :          4 :             ++NumResources;
    1303                 :            :         }
    1304                 :        224 :         ++AppRecPtr;
    1305                 :            :     }
    1306                 :          7 :     LibRecPtr = CFE_ES_Global.LibTable;
    1307 [ +  + ][ +  - ]:         77 :     for (i = 0; i < CFE_PLATFORM_ES_MAX_LIBRARIES && NumResources < CFE_ES_QUERY_ALL_MAX_ENTRIES; ++i)

here:

for (i = 0; i < CFE_PLATFORM_ES_MAX_APPLICATIONS && NumResources < CFE_ES_QUERY_ALL_MAX_ENTRIES; ++i)
{
if (CFE_ES_AppRecordIsUsed(AppRecPtr))
{
ResourceList[NumResources] = CFE_RESOURCEID_UNWRAP(CFE_ES_AppRecordGetID(AppRecPtr));
++NumResources;
}
++AppRecPtr;
}
LibRecPtr = CFE_ES_Global.LibTable;
for (i = 0; i < CFE_PLATFORM_ES_MAX_LIBRARIES && NumResources < CFE_ES_QUERY_ALL_MAX_ENTRIES; ++i)

Describe the solution you'd like
Coverage test with multiple configurations.

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@avan989
Copy link
Contributor

avan989 commented Jun 13, 2023

Code coverage is not possible without changing the configuration.

"i" will at least increment faster or at the same rate as "NumResources" and ...MAX_ENTRIES is larger than ...MAX_APPLICATION. Not possible for NumResource >= ...MAX_ENTRIES before i >= ...MAX_APPLICATION.

#define CFE_ES_QUERY_ALL_MAX_ENTRIES (CFE_PLATFORM_ES_MAX_APPLICATIONS + CFE_PLATFORM_ES_MAX_LIBRARIES)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants