Skip to content

Fix #150, removes conditionally compiled code with runtime logic - #154

Merged
chillfig merged 1 commit into
nasa:devfrom
chillfig:fix-150-cond-comp-code
Nov 10, 2026
Merged

chillfig merged 1 commit into
nasa:devfrom
chillfig:fix-150-cond-comp-code

Conversation

@chillfig

@chillfig chillfig commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

name: FSW Code Change
about: Flight Software code changes
labels: fsw

Description of Change

Replaces conditional compilation for CS_PRESERVE_STATES_ON_PROCESSOR_RESET with runtime checks, allowing both enabled and disabled behaviors to be tested in a single build while preserving configured behavior.
This reduces test maintenance by eliminating separate builds for each behavior and keeps nondefault paths compiled and covered by tests.

CS_AppData.PreserveStatesOnProcessorReset as both false and true for:

  • Initialization: verifying CDS operations are skipped or performed.
  • Enable/disable commands: verifying CS_UpdateCDS() is skipped or called.

Linked Issue

Closes #150

Requirements Impact

  • Requirement ID(s):
  • Requirements updated as necessary
  • Existing requirements are still satisfied by this change

Testing Evidence

CI build, unit tests

Unit Tests (UT Assert)

11: [  END] 128 SUMMARY              TOTAL::558   PASS::558   FAIL::0     MIR::0     TSF::0     TTF::0   
11: COMPLETE: 128 tests Segment(s) executed
11: 
11: OS_BSP_Initialize():Maximum user msg queue depth = 10
11/11 Test #11: coverage-cs-cs_dispatch ...........   Passed    0.02 sec

100% tests passed, 0 tests failed out of 11

Total Test time (real) =   0.21 sec

COSMOS Test Suite

N/A

Areas of Expertise Touched

  • ASTRO
  • CI/CD
  • COSMOS
  • Cybersecurity
  • Docker
  • EDS
  • Git
  • PSPs
  • SBN
  • SMP
  • Tables
  • TSN
  • Unit Tests
  • Other

Author Checklist

  • Linked GitHub issue is referenced above
  • Code has been formatted with .clang-format
  • Static analysis workflows ran and passed
  • Unit tests (UT Assert) updated/added to cover code changes
  • Unit test workflows ran and passed
  • COSMOS test suite was run; tests updated/added if relevant changes were made
  • Requirements have been reviewed; updated or confirmed still satisfied (see above)
  • Testing evidence is included above
  • Self-review of the diff completed

Reviewer Checklist

  • Code logic is correct and matches the stated intent
  • Code is readable, maintainable, and follows project conventions (ask your lead if you are unsure of where to find these conventions)
  • .clang-format has been applied
  • Static analysis results reviewed and acceptable
  • The change has been exercised by the unit tests (not just that tests pass — the new/changed code paths are actually covered)
  • COSMOS test suite was executed against this change and results reviewed (or confirmed N/A with justification)
  • Reviewer has independently verified the change behaves as described (e.g., by running the tests locally, reviewing CI output in detail, or performing additional ad-hoc testing as warranted)
  • Memory safety reviewed (allocation, bounds, lifetime, stack usage)
  • Requirements impact reviewed and appropriate
  • Error handling is appropriate
  • Appropriate Expert areas have been reviewed

Reviewer Testing Notes

@chillfig chillfig self-assigned this Oct 22, 2026
Comment thread unit-test/cs_app_tests.c Resolved
@chillfig
chillfig merged commit ce7e833 into nasa:dev Nov 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove conditionally compiled code

2 participants