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

Shared module uncovered branch due to run time logic based on compile time config #1111

Open
skliper opened this issue Jul 19, 2021 · 1 comment
Labels
coverage unit-test Tickets related to the OSAL unit testing (functional and/or coverage)

Comments

@skliper
Copy link
Contributor

skliper commented Jul 19, 2021

Is your feature request related to a problem? Please describe.
Run time logic for compile time config example:

OS_static_symbol_record_t *StaticSym = OS_STATIC_SYMTABLE_SOURCE;
while (StaticSym != NULL)

Full branch coverage of while loop requires both OS_STATIC_SYMTABLE_SOURCE set to NULL and non-NULL.

Note by design the build system has a 1 to 1 to 1 relation - code/ut code/test exec, so an extra build would break the pattern.

Describe the solution you'd like
Possibilities:

  • break build pattern and build additional "special" test w/o OS_STATIC_SYMTABLE_SOURCE defined
  • source selection based on compile time config (or utilize preprocessor)
  • add a function to set and/or get the static symbol table pointer
  • build/run twice from the test procedure... once with the definition removed from the unit-test-coverage CMakeLists.txt

Describe alternatives you've considered
None

Additional context
Coverage testing

Requester Info
Jacob Hageman - NASA/GSFC

@jphickey
Copy link
Contributor

IIRC the whole logic behind the separate OS_STATIC_SYMTABLE_SOURCE definition was so that the coverage test could provide its own definition of the static sym table.

"OS_STATIC_SYMTABLE_SOURCE=OS_UT_STATIC_SYMBOL_TABLE"

It should also (theoretically) be possible to make this a pointer which can be NULL as well, so UT can simply have two test cases, one for NULL and one for non-NULL. I can experiment but I think it is probably doable.

@skliper skliper added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Aug 25, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fix nasa#996, Remove CFE_PLATFORM_SB_MAX_PIPE_DEPTH in favor of OS_QUEUE_MAX_DEPTH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
Development

No branches or pull requests

2 participants