Skip to content

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

@skliper

Description

@skliper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    coverageunit-testTickets related to the OSAL unit testing (functional and/or coverage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions