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

CFE_SB_ValidateChecksum implementation does not match description #733

Closed
skliper opened this issue Jun 3, 2020 · 1 comment · Fixed by #726 or #833
Closed

CFE_SB_ValidateChecksum implementation does not match description #733

skliper opened this issue Jun 3, 2020 · 1 comment · Fixed by #726 or #833
Assignees
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jun 3, 2020

Describe the bug
CFE_SB_ValidateChecksum claims it returns true if not supported:

** \par Assumptions, External Events, and Notes:
** - If the underlying implementation of software bus messages does not
** include a checksum field, then this routine will always return \c true.

but also claims it returns false:

** \return Boolean checksum result
** \retval true The checksum field in the packet is valid.
** \retval false The checksum field in the packet is not valid or the message type is wrong.

and then implements a false return:

/* if msg type is telemetry or there is no secondary hdr... */
if((CCSDS_RD_TYPE(MsgPtr->Hdr) == CCSDS_TLM)||(CCSDS_RD_SHDR(MsgPtr->Hdr) == 0)){
return false;
}/* end if */

To Reproduce
Read the code.

Expected behavior
Consistency

Code snips
See above

System observed on:
N/A

Additional context
None

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug label Jun 3, 2020
@skliper
Copy link
Contributor Author

skliper commented Jun 3, 2020

I'd expect this sort of inconsistency to be uncovered during unit test development.

@skliper skliper self-assigned this Jun 3, 2020
skliper added a commit to skliper/cFE that referenced this issue Aug 14, 2020
- Fix nasa#733: Validate checksum description update
- Fix nasa#597: Remove local endian SID macros
- Updates SB to use msg module
- General cleanup
@astrogeco astrogeco added this to the 7.0.0 milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants