-
Notifications
You must be signed in to change notification settings - Fork 206
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
CFE_EVS_SendEvent stub should provide full context #603
Comments
Thinking about this more, I'd also be fine with the Context getting the string as passed into |
I think @jphickey has examples for getting format and arguments. |
Yes, this stub will need an update to pass through more context if UT test cases need this. The framework has the facility to do this, via the I'd still recommend against passing it to [v]snprintf, as that is now crossing the bridge of no longer validating the direct outputs of the unit, but rather mimicking/duplicating something that the FSW might do and validating that. Very different thing. (stubs shouldn't duplicate FSW logic). |
I agree. Disregard that preference in the original description. Would this look like |
I completely agree with not passing it to [v]snprintf, but I would like to see the default implementation of the CFE_EVS_SendEvent stub make the arguments available for checking without having to use a hook. |
The "Fixed" arguments, up to and including the spec string, can be registered using calls to The use For an example of a stub that uses this mechanism, see Usage with hook function example is in sample_lib: https://github.com/nasa/sample_lib/blob/master/unit-test/coveragetest/coveragetest_sample_lib.c |
CCB 20200415 - Ok to add and pass it through |
@gilliganeric - can you confirm #673 does what you need, or clarify what would still be necessary? |
Correct, we can leave this open until that's implemented:
|
Ahh yes, sorry I overlooked that during my review of the change. If you want to have the actual data available in your hook this needs to use the |
Add a va_list to capture the full set of variable arguments on all CFE_EVS event calls.
Add a va_list to capture the full set of variable arguments on all CFE_EVS event calls. Also add va_list for CFE_ES_WriteToSyslog
Fix #603, Full context info for EVS event stubs
Describe the bug
The CFE_EVS_SendEvent stub for ut-assert does not provide its full context. It only provides the first argument, EventId, providing no way to for unit tests to verify the correct EventType or event message text was sent.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The CFE_EVS_SendEvent stub should provide its full context for unit testing purposes, including the EventID, EventType, and the event message string.
My preference would be that the event message text provided would not include the format specifiers and instead be the resulting string with the format specifiers replaced with the appropriate text.I've been convinced and also talked myself out of that preference.Code snips
System observed on:
Additional context
n/a
Reporter Info
Eric Gilligan NASA/GSFC-5820
The text was updated successfully, but these errors were encountered: