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

many unit tests report event count errors as hex #418

Closed
CDKnightNASA opened this issue Nov 22, 2019 · 9 comments · Fixed by #698
Closed

many unit tests report event count errors as hex #418

CDKnightNASA opened this issue Nov 22, 2019 · 9 comments · Fixed by #698
Assignees
Milestone

Comments

@CDKnightNASA
Copy link
Contributor

Describe the bug
Unit tests check the number of events sent during the test, many of these in sb_UT.c are reported as hex...Such as in Test_SB_Cmds_SendPrevSubs (line 2704.)

To Reproduce
Uncovered when I was changing GetPipeName to produce events (as part of making it a public API) and the unit test event counts had to be updated. A simple test is to change the "ExpRtn" for a test.

Expected behavior
Event counts should reported in decimal.

Code snips
See above.

System observed on:
Linux VM

Additional context
N/A

Reporter Info
[email protected]

@CDKnightNASA
Copy link
Contributor Author

In reviewing the error reporting in general, I'm wondering if we want to use some macros and some global variables rather than having so much duplicated code in each fn.

@jphickey
Copy link
Contributor

Yes, I am a big fan of macro-izing many of the repetitive unit test constructs. In particular there should be a at least macro to call a function and check its int32 return code (very common). I have an example of such a macro in nasa/sample_lib#11

But updating all the existing test cases is extremely tedious and time consuming....

@CDKnightNASA
Copy link
Contributor Author

But updating all the existing test cases is extremely tedious and time consuming....

Raises hand to volunteer to do at least sb_UT.c as a "demo"

@jphickey
Copy link
Contributor

jphickey commented Nov 22, 2019

Raises hand to volunteer to do at least sb_UT.c as a "demo"

Great!! No complaints from me about that!

@CDKnightNASA CDKnightNASA self-assigned this Nov 25, 2019
@CDKnightNASA
Copy link
Contributor Author

Point of interest: my sample of sb_UT.c went from 10,487 lines of code to 6,878 lines, a roughly 35% reduction in code size for the UT. Check it out! :D

@CDKnightNASA
Copy link
Contributor Author

@skliper would like to review the sb_UT.c changes at an upcoming CCB meeting.

@skliper
Copy link
Contributor

skliper commented Jan 22, 2020

@CDKnightNASA could you write an issue (Macro-ize unit test enhancement) and go ahead and put your changes in as a pull request to facilitate review?

@CDKnightNASA
Copy link
Contributor Author

@CDKnightNASA could you write an issue (Macro-ize unit test enhancement) and go ahead and put your changes in as a pull request to facilitate review?

see #492

@skliper
Copy link
Contributor

skliper commented Jan 6, 2021

Fixed in #698

@skliper skliper linked a pull request Jan 6, 2021 that will close this issue
@skliper skliper closed this as completed Jan 6, 2021
@skliper skliper added this to the 6.8.0 milestone Sep 24, 2021
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