-
Notifications
You must be signed in to change notification settings - Fork 206
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 #471, improve SB coverage test #1668
Fix #471, improve SB coverage test #1668
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.
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. |
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. |
@skliper are we good to merge this one? |
nasa/cFE#1668, improve SB coverage test nasa/cFE#1694, correct function name in UT_BSP_Unlock
**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]>
CCB:2021-07-21 APPROVED |
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
switch
statements 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.