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

Implicit default case in CF_WriteHistoryEntryToFile prevents full branch coverage #266

Closed
3 tasks done
skliper opened this issue Jun 17, 2022 · 0 comments · Fixed by #267
Closed
3 tasks done

Implicit default case in CF_WriteHistoryEntryToFile prevents full branch coverage #266

skliper opened this issue Jun 17, 2022 · 0 comments · Fixed by #267
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jun 17, 2022

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I reviewed the CF README.md file to see if the feature is in the major future work.
  • I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.
This will show up with the implicit default case uncovered since it's unreachable:

CF/fsw/src/cf_utils.c

Lines 190 to 206 in 593d61a

for (i = 0; i < 3; ++i)
{
switch (i)
{
case 0:
CF_Assert(h->dir < CF_Direction_NUM);
snprintf(linebuf, sizeof(linebuf), "SEQ (%lu, %lu)\tDIR: %s\tPEER %lu\tCC: %u\t",
(unsigned long)h->src_eid, (unsigned long)h->seq_num, CF_DSTR[h->dir],
(unsigned long)h->peer_eid, (unsigned int)h->cc);
break;
case 1:
snprintf(linebuf, sizeof(linebuf), "SRC: %s\t", h->fnames.src_filename);
break;
case 2:
snprintf(linebuf, sizeof(linebuf), "DST: %s\n", h->fnames.dst_filename);
break;
}

Describe the solution you'd like
Add the default case explicitly

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the Draco milestone Jun 17, 2022
@skliper skliper self-assigned this Jun 17, 2022
skliper added a commit to skliper/CF that referenced this issue Jun 17, 2022
skliper added a commit to skliper/CF that referenced this issue Jun 17, 2022
astrogeco added a commit that referenced this issue Jun 22, 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.

1 participant