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

Uncovered lines/branches #24

Closed
2 tasks done
havencarlson opened this issue Jun 15, 2022 · 1 comment · Fixed by #28
Closed
2 tasks done

Uncovered lines/branches #24

havencarlson opened this issue Jun 15, 2022 · 1 comment · Fixed by #28

Comments

@havencarlson
Copy link
Contributor

havencarlson commented Jun 15, 2022

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug

To Reproduce
Functions with statements that can never be reached:

md_app.c: MD_ExecRequest
can't hit default case since command codes are already verified by MD_SearchCmdHndlrTbl

MD/fsw/src/md_app.c

Lines 666 to 671 in 853c1e0

default:
/* unknown function code specified - send error event message */
CFE_EVS_SendEvent(MD_CC_NOT_IN_LOOP_ERR_EID, CFE_EVS_EventType_ERROR,
"Command Code %d not found in command processing loop", CommandCode);
MD_AppData.ErrCounter++;
break;

md_app.c: MD_SearchCmdHndlrTbl
can't reach this else statement because the message type can't be anything other than MD_CMD_MSGTYPE or MD_TERM_MSGTYPE

MD/fsw/src/md_app.c

Lines 761 to 766 in 853c1e0

else
/* Message is not a command message with specific command code */
{
/* Matching Message ID is all that is required */
FoundMatch = true;
}

md_dwell_tbl.c: MD_TableValidationFunc

MD/fsw/src/md_dwell_tbl.c

Lines 145 to 149 in 853c1e0

else
{
/* Should not get here, MD_ValidTableEntry only returns the above values */
Status = -1;
}

Expected behavior
100% coverage

Code snips
See above

System observed on:
CI

Additional context
None

Reporter Info
Haven Carlson, NASA

@skliper
Copy link
Contributor

skliper commented Jun 22, 2022

Note the first two would go away if command handling gets updated as part of this enhancement nasa/cFE#2038, or could separate the functions (different c file) to stub and exercise error cases, or could include the HK request MID in the table (refactor to match TBL implementation). Either way these are low risk since it's just defensive programming. The else condition in the dwell table could just be replaced with a comment that there is no action for a case that isn't matched, also low risk.

@dzbaker dzbaker closed this as completed in 9f017c3 Aug 3, 2022
dzbaker added a commit that referenced this issue Aug 3, 2022
@dmknutsen dmknutsen added this to the Draco milestone Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants