-
Notifications
You must be signed in to change notification settings - Fork 112
Fix vsnprintf mocks for Release builds. #274
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
Conversation
Deal with binary API nuances. Signed-off-by: Michel Hidalgo <[email protected]>
|
|
||
| /// Patch vsnprintf with the given `replacement` in the given `scope`. | ||
| #define patch_vsnprintf(scope, replacement) patch( \ | ||
| scope, __vsnprintf_chk, [&](char * __str, size_t, int, size_t __size, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this kind of mocking is really fragile.
I prefer having less coverage and not doing this, but I guess it's not my call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this kind of mocking is really fragile.
Indeed mocking system libraries this way is fragile, but as of today the alternative is not having coverage at all. Perhaps, eventually we can migrate towards fault injection (which has its own share of ifs and buts, like Release binary and Debug binaries not being the same).
I prefer having less coverage
Generally speaking, I don't agree with reducing test coverage simply because it's inconvenient. I'd much rather look for a replacement if this becomes a pain point.
|
Thanks for the reviews! |
|
@hidmic the change introduced here is causing build failures in Release configuration on CentOS: There are several related errors but here's the first one: The failure does not occur in Debug or None configurations, only Release and removing this commit unbreaks the build. However since this is a fix for an issue on tier 1 platforms I am not proposing a revert. |
|
This change also does not appear to address the test failures in the nightly_linux_thread_sanitizer job. |
|
Hmm, this is becoming increasingly painful. I'm surprised about |
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
This pull request deals with binary API nuances. Fixes regressions introduced by #272.
CI up to
rcutils: