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

Uninitialized variables in UT, potential test failure #44

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

Uninitialized variables in UT, potential test failure #44

skliper opened this issue Aug 17, 2022 · 0 comments · Fixed by #45
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Aug 17, 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.
The destination file table and filter table are not consistently initialized in unit tests. Example where DestFileTable isn't fully initialized:

void DS_FileCreateDest_Test_StringTerminate(void)
{
uint32 FileIndex = 0;
DS_DestFileTable_t DestFileTable;
/* Setup for DS_FileCreateName to succeed */
DS_AppData.DestFileTblPtr = &DestFileTable;
DS_AppData.FileStatus[FileIndex].FileName[0] = DS_STRING_TERMINATOR;
/* Execute the function being tested */
UtAssert_VOIDCALL(DS_FileCreateDest(FileIndex));

Observed test failure:

[BEGIN] 16 DS_FileCreateDest_Test_StringTerminate
[ PASS] 16.001 ds_file_tests.c:740 - DS_FileCreateDest(FileIndex)
[ FAIL] 16.002 ds_file_tests.c:743 - CallCount OS_OpenCreate() (1) == 0 (0)
[  END] 16 DS_FileCreateDest_Test_StringTerminate TOTAL::2     PASS::1     FAIL::1     MIR::0     TSF::0     TTF::0     WARN::0

Assuming there's a combination of random file name components that pass, which then cause OS_OpenCreate to be called.

Describe the solution you'd like
Implement a consistent initialization scheme for commonly used elements

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the Draco milestone Aug 17, 2022
@skliper skliper self-assigned this Aug 17, 2022
skliper added a commit to skliper/DS that referenced this issue Aug 17, 2022
dzbaker added a commit that referenced this issue Aug 17, 2022
Fix #44, Standardize UT table initialization
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.

2 participants