Fix #471, improve SB coverage test#1668
Merged
astrogeco merged 1 commit intonasa:integration-candidatefrom Jul 21, 2021
Merged
Conversation
Add test cases to exercise all functions, lines, and branches to the extent reasonably possible. Improves the coverage stats significantly: functions 98.9% -> 100% lines 96.4% -> 99.8% branches 87.1% -> 94.9% Remaining uncovered lines/branches are not possible to be reached due to the way the code is structured, or because it would require an alternate implementation of SBR (note that SB+SBR are currently tested as a single unit, even though they are technically separate modules now). For example, the "direct" SBR implementation cannot have collisions, hence the collision handling in SB cannot be reached. Making stubs for SBR may allow this to be tested.
Contributor
|
Could you turn the coverage comments related to SBR/collisions into an issue and mark w/ the coverage tag? That'll help in creating the coverage report/justification. |
Contributor
Author
I noted this under #1462 and added coverage tag to that existing ticket. We can also write a new issue if you think its easier to track that way. |
Contributor
|
@skliper are we good to merge this one? |
skliper
approved these changes
Jul 21, 2021
astrogeco
added a commit
to nasa/cFS
that referenced
this pull request
Jul 21, 2021
nasa/cFE#1668, improve SB coverage test nasa/cFE#1694, correct function name in UT_BSP_Unlock
astrogeco
added a commit
to nasa/cFS
that referenced
this pull request
Jul 21, 2021
**Combines** nasa/cFE#1665, v6.8.0-rc1+dev762 nasa/osal#1113, v5.1.0-rc1+dev573 **Includes** nasa/cFE#1664, remove default .dat extension nasa/cFE#1660, Change CI to use Test Log. nasa/cFE#1670, Update API doxygen list nasa/cFE#1671, update documentation for CFE_ES_GetPoolBufInfo nasa/cFE#1674, CFE_SB_MsgHdrSize returns size_t nasa/cFE#1668, improve SB coverage test nasa/cFE#1694, correct function name in UT_BSP_Unlock nasa/osal#1106, Add independent OS_rename functional test parameter checks Co-authored-by: Jacob Hageman <[email protected]> Co-authored-by: Joseph Hickey <[email protected]> Co-authored-by: Alex Campbell <[email protected]> Co-authored-by: Oliver Hamburger <[email protected]>
Contributor
|
CCB:2021-07-21 APPROVED |
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.
Describe the contribution
Add test cases to exercise all functions, lines, and branches to the extent reasonably possible. Improves the coverage stats
significantly:
functions 98.9% -> 100%
lines 96.4% -> 99.8%
branches 87.1% -> 94.9%
Fixes #471
Testing performed
Build and run coverage test, check LCOV reports
Expected behavior changes
More complete branch/line coverage
System(s) tested on
Ubuntu
Additional context
Remaining uncovered lines/branches are not possible to be reached due to the way the code is structured, or because it would require an alternate implementation of SBR (note that SB+SBR are currently tested as a single unit, even though they are technically separate modules now). For example, the "direct" SBR implementation cannot have collisions, hence the collision handling in SB cannot be reached. Making stubs for SBR may allow this to be tested. For example this conditional is not reachable with direct mode:
cFE/modules/sb/fsw/src/cfe_sb_api.c
Lines 1125 to 1130 in 2afdbc1
Other lines in CFE_SB_AppInit are also not reachable (will report in separate issue ticket).
Additionally, many internal
switchstatements can only be reached with values for which there is a correspondingcase- that is, there is no default case nor is it possible to reach the switch statement with any value other than the listed values. However gcov still reports this as an un-executed branch even though all possible cases are indeed covered.Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.