-
Notifications
You must be signed in to change notification settings - Fork 232
Description
Is your feature request related to a problem? Please describe.
Recently the software bus unit tests were updated to employ macros for common code bits, but this only amplifies the fact that the SB unit tests don't follow the typical UT assert model.
In particular, they "collect" a bunch of conditions together and then assert at the end that all the conditions where true. There is no reason to do this deferred reporting with UT assert, and it only serves to obfuscate the true failure because the UT assert failure message line number can be quite different than what actually failed.
Describe the solution you'd like
Now that the macros/wrappers are in place, rather than having them only mimic the old test logic, have them implement the preferred UT assert patterns.
- Remove
TestStatglobal variable. Do not keep global state outside UT assert. - Remove separate text messages inside "if" conditionals and replace with UT assert statements. That's what the UT assert API is for, after all.
- Remove
VERBOSEcompile-time option. The UT assert has a runtime verbosity flag, just callUtDebugand the message will only be printed when set to verbose mode.
Additional context
This really just the next step along the path to using UT assert as it was intended, and removing the "compatibility crutches" that were put into place because CFE (and SB in particular) didn't employ the same test patterns as other apps/modules.
Requester Info
Joseph Hickey, Vantage Systems, Inc.