Conversation
Contributor
Love it, great catch on the UT bug in |
Contributor
Author
Cheers Jake. Yeah |
19b4cc2 to
d0b4430
Compare
jphickey
approved these changes
Nov 14, 2025
Contributor
jphickey
left a comment
There was a problem hiding this comment.
I rebased this one and confirmed its working.
This is an improvement to future maintainability and seems to also fix a few problems in the process.
Contributor
Author
Thanks for updating it Joe. |
This was referenced Dec 17, 2025
dzbaker
added a commit
to nasa/cFS
that referenced
this pull request
Dec 17, 2025
*Combines:* cFE equuleus-rc1+dev275 psp equuleus-rc1+dev85 **Includes:** *cFE* - nasa/cFE#2347 - nasa/cFE#2611 - nasa/cFE#2613 - nasa/cFE#2619 - nasa/cFE#2621 - nasa/cFE#2624 - nasa/cFE#2670 *osal* *PSP* - nasa/PSP#459 - nasa/PSP#460 - nasa/PSP#463 Co-authored by: Joseph Hickey <[email protected]> Co-authored by: Avi Weiss <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Describe the contribution
While looking at this, I realised that lots of tests were checking events related the 'setup', not the actual function that is the focus of the test.
For example, there are dozens of asserts for
CFE_SB_PIPE_ADDED_EIDandCFE_SB_SUBSCRIPTION_RCVD_EID- even thoughCFE_SB_CreatePipe()andCFE_SB_Subscribe()have their own tests...These asserts are largely redundant and just add clutter to the tests - I've removed the obvious cases from the tests I was already updating with
UT_ClearEventHistory().Test_SB_Cmds_MapInfoDefwas checking forCFE_SB_PIPE_ADDED_EIDandCFE_SB_SUBSCRIPTION_RCVD_EIDwhich are part of the setup, not the function under test. I changed this to check for the command counter being incremented instead.Test_Unsubscribe_Basic,Test_Unsubscribe_AppIdandTest_Unsubscribe_Localwere checking forCFE_SB_SUBSCRIPTION_RCVD_EID. They should really be checking forCFE_SB_SUBSCRIPTION_REMOVED_EIDgiven thatCFE_SB_Unsubscribe()is the focus of these tests.Test_Unsubscribe_Local, it was actually sending aCFE_SB_UNSUB_NO_SUBS_EIDevent. The reason this wasn't noticed may be becauseCFE_SB_UnsubscribeLocal()returnsCFE_SUCCESS(and sends theCFE_SB_UNSUB_NO_SUBS_EIDevent) if the pipe is not subscribed to theMsgId.CFE_SB_SubscribeLocal(), instead ofCFE_SB_Subscribe(), and now the call toCFE_SB_UnsubscribeLocal()in the test actually works and returnsCFE_SUCCESSwhile sending theCFE_SB_SUBSCRIPTION_REMOVED_EIDevent.Even though these are coverage tests, they should still be clear and at least check for what they are testing...
Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Unit/Functional Tests etc.).
Local testing confirms net coverage unchanged.
Expected behavior changes
No change to code behavior. Test behavior updated as described above.
System(s) tested on
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS bundle.
Contributor Info
Avi Weiss @thnkslprpt