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 condition for while loop in hs_custom.c #33

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

Uncovered condition for while loop in hs_custom.c #33

skliper opened this issue Jun 13, 2022 · 0 comments · Fixed by #34
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jun 13, 2022

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I reviewed the README 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.
There will always be room within the DiagValue/Count array here, so it'll match before j >= the limit. The conditions are not independent:

HS/fsw/src/hs_custom.c

Lines 319 to 336 in 2fc0dd9

while ((MatchFound == false) && (j < HS_UTIL_TIME_DIAG_ARRAY_LENGTH))
{
if (ThisValue == DiagValue[j])
{
DiagCount[j]++;
MatchFound = true;
}
else if (DiagValue[j] == 0xFFFFFFFF)
{
DiagValue[j] = ThisValue;
DiagCount[j]++;
MatchFound = true;
}
else
{
j++;
}
}

Describe the solution you'd like
Refactor

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSF

@skliper skliper added this to the Draco milestone Jun 13, 2022
@skliper skliper self-assigned this Jun 13, 2022
skliper added a commit to skliper/HS that referenced this issue Jun 13, 2022
- Replace direct use of config value in conditional w/ global
- Replace redundant condition in search for empty diag slot
dzbaker 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