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

Fix #704, Added stub for CFE_SB_DeletePipe in ut_sb_stubs.c #714

Merged
merged 2 commits into from
Jun 2, 2020

Conversation

asgibson
Copy link
Contributor

Describe the contribution
Fixes #704. Added stub for CFE_SB_DeletePipe.
Stub takes PipeId argument and using UT_Stub_CopyFromLocal, saves it into the data buffer.

Testing performed
Steps taken to test the contribution:

  1. Build steps: 'make ENABLE_UNIT_TESTS=TRUE SIMULATION=native'
    Execution steps:
  2. Created simple unit test in cfs_cf calling CFE_SB_DeletePipe directly.
  3. PipeId was set as the data buffer pointer and given an initial value.
  4. expectedPipeId given a different value than PipeId
  5. UtAssert_True used to show they are not equal(fails)
  6. Call to CFE_SB_DeletePipe with expectedPipeId as argument
  7. UtAssert_True used to show they are equal(pass)
  8. Ran unit test from build/native/apps/cfs_cf/unit-test
    Please note: this test was not saved to any repo.
    Output:
    [BEGIN] 04 Test_check_sb_stubs
    [ FAIL] 04.001 cf_app_tests.c:77 - PipeId = 0x00000005, exp = 0x00000006
    [ PASS] 04.002 cf_app_tests.c:83 - PipeId = 0x00000006, exp = 0x00000006
    [ END] 04 Test_check_sb_stubs TOTAL::2 PASS::1 FAIL::1 MIR::0 TSF::0 N/A::0

Expected behavior changes
A clear and concise description of how this contribution will change behavior and level of impact.

  • API Change: cFE ut_sb_stubs now has CFE_SB_DeletePipe available.
  • Behavior Change: App unit tests requiring this will not fail to build due to undefined reference to `CFE_SB_DeletePipe'

System(s) tested on

  • Hardware: PC
  • OS: RHEL-7.6 (Maipo) Linux 3.10.0-1062.1.2.el7.x86_64
  • Versions: cFE 6.7

Additional context
None.

Third party code
None.

Contributor Info - All information REQUIRED for consideration of pull request
Alan Gibson, NASA, GSFC-0587

@asgibson
Copy link
Contributor Author

asgibson commented May 21, 2020

My apologies, I forgot to test that CFE_SUCCESS was returned by the stub so I checked that too.
[BEGIN] 04 Test_check_sb_stubs
[ FAIL] 04.001 cf_app_tests.c:78 - PipeId = 0x00000005, exp = 0x00000006
[ PASS] 04.002 cf_app_tests.c:84 - CFE_SB_DeletePipe returned 0x00000000, and should have been 0x00000000 (CFE_SUCCESS)
[ PASS] 04.003 cf_app_tests.c:85 - PipeId = 0x00000006, exp = 0x00000006
[ END] 04 Test_check_sb_stubs TOTAL::3 PASS::2 FAIL::1 MIR::0 TSF::0 N/A::0

** None
**
** \returns
** Returns CFE_SUCCESS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless configured not to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that.
Is that what this means?

** \returns
**        Returns either a user-defined status flag or CFE_SUCCESS.

Which is the only example I could see that would be comparable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a better description.

@astrogeco astrogeco changed the title Fix #704. Added stub for CFE_SB_DeletePipe in ut_sb_stubs.c Fix #704, Added stub for CFE_SB_DeletePipe in ut_sb_stubs.c May 27, 2020
@astrogeco astrogeco added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label May 27, 2020
@asgibson
Copy link
Contributor Author

Changed comment for return type on CFE_SB_DeletePipe.

@astrogeco
Copy link
Contributor

CCB 2020-05-27 APPROVED

@astrogeco astrogeco added CCB-20200527 CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels May 28, 2020
@astrogeco astrogeco changed the base branch from master to integration-candidate June 2, 2020 17:56
@astrogeco astrogeco merged commit 086bf1b into nasa:integration-candidate Jun 2, 2020
@skliper skliper added this to the 6.8.0 milestone Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ut_sb_stubs.c needs a stub for CFE_SB_DeletePipe
3 participants