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 #813, Add Generic Counter API test #1753

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Aug 3, 2021

Describe the contribution
Add tests for the following APIs:

  • CFE_ES_RegisterGenCounter
  • CFE_ES_CounterID_ToIndex
  • CFE_ES_GetGenCounterIDByName
  • CFE_ES_GetGenCounterName
  • CFE_ES_GetGenCount
  • CFE_ES_SetGenCount
  • CFE_ES_IncrementGenCounter
  • CFE_ES_DeleteGenCounter

Fixes #813

Testing performed
Build and run all functional tests, confirm passing

Expected behavior changes
Additional APIs are tested

System(s) tested on
Ubuntu

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Add tests for the following APIs:

CFE_ES_RegisterGenCounter
CFE_ES_CounterID_ToIndex
CFE_ES_GetGenCounterIDByName
CFE_ES_GetGenCounterName
CFE_ES_GetGenCount
CFE_ES_SetGenCount
CFE_ES_IncrementGenCounter
CFE_ES_DeleteGenCounter
@jphickey
Copy link
Contributor Author

jphickey commented Aug 3, 2021

This also depends on nasa/osal#1125, which is why CI is failing right now. Once the next OSAL merge cycle is complete should be able to re-run CI and confirm success....

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Aug 3, 2021
@astrogeco astrogeco requested a review from zanzaben August 3, 2021 17:16
Copy link
Contributor

@zanzaben zanzaben left a comment

Choose a reason for hiding this comment

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

Every test should have a UtPrintf("Testing: ..."); at the top stating which functions are being tested.

@astrogeco
Copy link
Contributor

CCB:2021-08-04 APPROVED with CHANGES

  • Add UTprintf

@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Aug 4, 2021
@astrogeco astrogeco changed the base branch from main to integration-candidate August 6, 2021 22:20
At UtPrintf statements to indicate the APIs that the test
is focused on.
@jphickey
Copy link
Contributor Author

jphickey commented Aug 9, 2021

Removing dependency label, as the required change is now in OSAL main branch, everything should be fine to merge normally now.

UtAssert_UINT32_LT(Idx, CFE_PLATFORM_ES_MAX_GEN_COUNTERS);

/* Confirm proper rejection of bad args in CFE_ES_CounterID_ToIndex */
UtAssert_INT32_EQ(CFE_ES_CounterID_ToIndex(CFE_ES_COUNTERID_UNDEFINED, &Idx), CFE_ES_ERR_RESOURCEID_NOT_VALID);
Copy link
Contributor

Choose a reason for hiding this comment

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

CFE_ES_CounterID_ToIndex is being tested by #1716 so you don't need to check it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we wrote these tests in parallel. I don't see a real problem with testing it in two places, as they are slightly different variations. It doesn't hurt anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

alright just wanted to make sure we were aware.

@astrogeco astrogeco merged commit 600fd7a into nasa:integration-candidate Aug 9, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 9, 2021
- nasa/cFE#1734, Add table api functional tests
- nasa/cFE#1753, Add Generic Counter API test
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 11, 2021
**Combines**

- nasa/cFE#1772, v6.8.0-rc1+dev844
- nasa/osal#1127, v5.1.0-rc1+dev590

**Includes**

*cFE*

- nasa/cFE#1737, Move global count into test global struct.
- nasa/cFE#1722, Add ES application control API functional tests
- nasa/cFE#1743, Update coverage test to use UtAssert macros
- nasa/cFE#1734, Add table api functional tests
- nasa/cFE#1753, Add Generic Counter API test
- nasa/cFE#1766, finish ES misc API functional test
- nasa/cFE#1764, last char truncated in coverage log output
- nasa/cFE#1728, Mistakes in some copyright headers
- nasa/cFE#1767, Add misc time api functional test cFE
- nasa/cFE#1749, Add Functional Test for EVS Reset Filters API
- nasa/cFE#1781, RTEMS CFE_FT_Global build failure
- nasa/cFE#1796, replace VOIDCALL assert macro

*osal*

- nasa/osal#1117, Add absolute branch coverage check
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 11, 2021
**Combines**

- nasa/cFE#1772, v6.8.0-rc1+dev844
- nasa/osal#1127, v5.1.0-rc1+dev590

**Includes**

*cFE*

- nasa/cFE#1737, Move global count into test global struct.
- nasa/cFE#1722, Add ES application control API functional tests
- nasa/cFE#1743, Update coverage test to use UtAssert macros
- nasa/cFE#1734, Add table api functional tests
- nasa/cFE#1753, Add Generic Counter API test
- nasa/cFE#1766, finish ES misc API functional test
- nasa/cFE#1764, last char truncated in coverage log output
- nasa/cFE#1728, Mistakes in some copyright headers
- nasa/cFE#1767, Add misc time api functional test cFE
- nasa/cFE#1749, Add Functional Test for EVS Reset Filters API
- nasa/cFE#1781, RTEMS CFE_FT_Global build failure
- nasa/cFE#1796, replace VOIDCALL assert macro

*osal*

- nasa/osal#1117, Add absolute branch coverage check

Co-authored-by: Joseph Hickey <[email protected]>
Co-authored-by: Alex Campbell <[email protected]>
Co-authored-by: Niall Mullane <[email protected]>
Co-authored-by: Paul <[email protected]>
@jphickey jphickey deleted the fix-813-counter-tests branch August 11, 2021 19:04
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
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.

Add functional tests for cFE Generic Counter APIs
4 participants