Skip to content

Add parameter validation macro - #5670

Merged
thomas-bc merged 1 commit into
nasa:develfrom
ryux1:5573-param-validation-macro
Aug 17, 2026
Merged

thomas-bc merged 1 commit into
nasa:develfrom
ryux1:5573-param-validation-macro

Conversation

@ryux1

@ryux1 ryux1 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Related Issue(s) Closes #5573
Has Unit Tests (y/n) y
Documentation Included (y/n) y (API documentation)
Generative AI was used in this contribution (y/n) AI

Change Description

Add FW_PARAM_OK, a shared macro that reports whether an Fw::ParamValid value is VALID or DEFAULT. Replace the existing equivalent checks throughout the framework and service components, and add unit coverage for all four parameter-validity states.

Rationale

Parameter consumers repeatedly spell out the same validity condition. Centralizing it removes boilerplate and gives parameter checks one consistent expression.

Testing/Review Recommendations

  • fprime-util format --check on all changed C++ files
  • fprime-util check --all (129/129 tests passed)
  • Review that FW_PARAM_OK accepts only VALID and DEFAULT

Future Work

None.

AI Usage (see policy)

OpenAI Codex was used to inspect the issue and repository, implement the macro and unit test, refactor existing checks, run formatting and the full test suite, and prepare this pull request. The submitted code and prose were generated by the AI agent and validated against the repository's pinned toolchain.

IAMAI

@ryux1
ryux1 marked this pull request as ready for review August 12, 2026 23:50
@ryux1

ryux1 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@bocchino This implements #5573 and is ready for maintainer review. GitHub is holding the Actions workflows for first-time-contributor approval; please approve the runs when convenient. The branch is current with devel, the repository-pinned format check passes, and fprime-util check --all passes 129/129 tests locally.

@thomas-bc
thomas-bc requested a review from bocchino August 13, 2026 00:01
@LeStarch

Copy link
Copy Markdown
Collaborator

This PR is addressing an issue that has been approved for development by the CCB. We welcome this PR to be reopened if and when the CCB approves the issue.

@LeStarch LeStarch closed this Aug 13, 2026
@LeStarch LeStarch reopened this Aug 14, 2026
@LeStarch

Copy link
Copy Markdown
Collaborator

This was approved by the CCB!

@ryux1
ryux1 force-pushed the 5573-param-validation-macro branch from 8bbe562 to f391264 Compare August 15, 2026 14:05
@ryux1

ryux1 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @LeStarch for confirming the CCB approval and reopening this.

I rebased the contribution cleanly onto current devel (1013197e99) and pushed the updated head (f391264d86). Fresh local validation on the rebased branch:

  • repository format check on all eight changed C/C++ files: passed
  • fprime-util check --all: 131/131 tests passed

@bocchino, this is ready for maintainer review. GitHub currently shows no check runs on the new head, so the first-time-contributor workflows still need maintainer approval before the automated gates can report.

@thomas-bc
thomas-bc merged commit 4b95ebb into nasa:devel Aug 17, 2026
73 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a macro for the standard pattern of checking parameters

3 participants