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

Remove conditionally-compiled code in TBL #2545

Open
jphickey opened this issue Apr 4, 2024 · 0 comments
Open

Remove conditionally-compiled code in TBL #2545

jphickey opened this issue Apr 4, 2024 · 0 comments
Assignees

Comments

@jphickey
Copy link
Contributor

jphickey commented Apr 4, 2024

Is your feature request related to a problem? Please describe.
There are some code chunks that are within #if blocks, based on the configuration parameters CFE_PLATFORM_TBL_VALID_SCID_COUNT and CFE_PLATFORM_TBL_VALID_PRID_COUNT.

Describe the solution you'd like
Refactor code so it is not conditionally compiled. (limit preprocessor logic usage to data structure initializers, not runtime instructions)

Describe alternatives you've considered
N/A

Additional context
Conditionally-compiled code is not in accordance with current coding standards. Runtime loops of 0 size are OK. The unit test/coverage test must be able to execute the code, which is not possible if it has been compiled out.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Apr 4, 2024
jphickey added a commit to jphickey/cFE that referenced this issue May 17, 2024
Improve the config module to handle platform-specific definitions
from the "cfe_platform_cfg.h" file.  Specifically this can generate
static tables/lists for items that cannot be simply handled via the
C preprocessor.  Notable examples are the mem pool size lists and
the allowable processor/spacecraft IDs in table services.
jphickey added a commit to jphickey/cFE that referenced this issue May 21, 2024
Utilize the compile-time generated list feature of the config module
to replace hardcoded lists of items in ES, SB, and TBL.  In particular
this applies to the ES mempool sizes, SB mempool sizes, and the
spacecraft and processor ID lists in TBL.

Note that the TBL code was not in accordance with coding standards as
it was (by default) compiled out via an #if directive, and thus not
being tested as it should be.  This fixes that, by removing the
conditional compile and always testing the code.
jphickey added a commit to jphickey/cFE that referenced this issue Oct 1, 2024
Utilize the compile-time generated list feature of the config module
to replace hardcoded lists of items in ES, SB, and TBL.  In particular
this applies to the ES mempool sizes, SB mempool sizes, and the
spacecraft and processor ID lists in TBL.

Note that the TBL code was not in accordance with coding standards as
it was (by default) compiled out via an #if directive, and thus not
being tested as it should be.  This fixes that, by removing the
conditional compile and always testing the code.
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

1 participant