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

Refactor "Compiled-out" code (ifdef) #69

Closed
2 tasks done
jphickey opened this issue Feb 22, 2023 · 0 comments · Fixed by #72
Closed
2 tasks done

Refactor "Compiled-out" code (ifdef) #69

jphickey opened this issue Feb 22, 2023 · 0 comments · Fixed by #72

Comments

@jphickey
Copy link
Contributor

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
HS contains a significant amount of code that can be compiled-out via #if HS_MAX_EXEC_CNT_SLOTS != 0

To comply with coding standards this should be refactored so it does not need to be compiled out.

To Reproduce
N/A

Expected behavior
Should not remove entire functions via #if as this can negatively affect unit testing. Switches like this increases the testing permutations required - technically should test it both ways, but we are not currently doing so.

System observed on:
N/A

Additional context
In this case the default value of HS_MAX_EXEC_CNT_SLOTS is 32, so this is compiled-in by default, but we never actually test the compiled-out option to see if it works correctly.

Requirement for this feature should be revisited first (i.e. is there a reason why we really need to have the option to set HS_MAX_EXEC_CNT_SLOTS to 0, as other configurable parameters do not have such an option).

If it is required to compile this out entirely, then a source-selection would be preferable over chunks of #if code.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/HS that referenced this issue Feb 22, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
jphickey added a commit to jphickey/HS that referenced this issue Feb 22, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
jphickey added a commit to jphickey/HS that referenced this issue Feb 22, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
jphickey added a commit to jphickey/HS that referenced this issue Feb 22, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
jphickey added a commit to jphickey/HS that referenced this issue Feb 23, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
jphickey added a commit to jphickey/HS that referenced this issue Feb 23, 2023
Do not conditionally compile code based on HS_MAX_EXEC_CNT_SLOTS being
0.  It will now be required that the option is >0.  Note that a
configuration of 0 was not being tested/validated, so this removes an
untested option.
dzbaker added a commit that referenced this issue Feb 23, 2023
Fix #69, Fix #73, remove conditional compiles from code
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants