nasa / CF

The Core Flight System (cFS) CFDP application.
Apache License 2.0
86 stars 46 forks source link

Fix #213, updated CFDP class validation #303

Closed havencarlson closed 2 years ago

havencarlson commented 2 years ago

Checklist (Please check before submitting)

Describe the contribution Fix #213, add validation to CF_CmdTxFile() and CF_CmdPlaybackDir() to prevent negative CFDP class values.

Testing performed Unit testing

Expected behavior changes Reject command if CFDP class is negative

System(s) tested on

Contributor Info - All information REQUIRED for consideration of pull request Haven Carlson - NASA

dzbaker commented 2 years ago

CCB 3 Aug 2022: Check that it is equal to 1 or 2 in validation.

jphickey commented 2 years ago

Here's another suggestion - define CF_CLASS_MAX in the enum, and check that it is not greater than that. That's the way I often see enums validated, as it avoids the assumption that a certain label is the "last one"