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_PoolCreateEx, requires alternate config #1932

Open
skliper opened this issue Sep 5, 2021 · 2 comments
Open

Comments

@skliper
Copy link
Contributor

skliper commented Sep 5, 2021

Is your feature request related to a problem? Please describe.
Branch/line below uncovered since it would require an alternate configuration:

     284                 :         11 :     Alignment = ALIGN_OF(CFE_ES_PoolAlign_t); /* memory mapped pools should be aligned */
     285         [ -  + ]:         11 :     if (Alignment < CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN)
     286                 :            :     {
     287                 :            :         /*
     288                 :            :          * Note about path coverage testing - depending on the
     289                 :            :          * system architecture and configuration this line may be
     290                 :            :          * unreachable.  This is OK.
     291                 :            :          */
     292                 :          0 :         Alignment = CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN;
     293                 :            :     }

here:

Alignment = ALIGN_OF(CFE_ES_PoolAlign_t); /* memory mapped pools should be aligned */
if (Alignment < CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN)
{
/*
* Note about path coverage testing - depending on the
* system architecture and configuration this line may be
* unreachable. This is OK.
*/
Alignment = CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN;
}

Describe the solution you'd like
Test with alternate configurations

Describe alternatives you've considered
None

Additional context
Jacob Hageman - NASA/GSFC

Requester Info
Full name and company/organization if applicable

@avan989
Copy link
Contributor

avan989 commented Jun 12, 2023

code coverage is not possible without changing the configuration.

Currently: Ran on docker with ubuntu 22.10 on windows

  1. Alignment = 16
  2. CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN = 4

@jphickey
Copy link
Contributor

You could add the minimum alignment as a passed-in parameter - then this new function could be called from unit test with a larger value. However because CFE_ES_PoolCreateEx() is part of the API, you'd need to rename the existing function to add the param, then make a compatible CFE_ES_PoolCreateEx() that calls the new function with CFE_PLATFORM_ES_MEMPOOL_ALIGN_SIZE_MIN.

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

3 participants