-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add fault injection unittest to increase coverage #49
Conversation
Signed-off-by: Stephen Brawner <brawner@gmail.com>
Signed-off-by: Stephen Brawner <brawner@gmail.com>
5bc3249
to
49ce56f
Compare
Signed-off-by: Stephen Brawner <brawner@gmail.com>
RCUTILS_FAULT_INJECTION_TEST( | ||
{ | ||
if (RCL_LOGGING_RET_OK == rcl_logging_external_initialize(nullptr, allocator)) { | ||
EXPECT_EQ(RCL_LOGGING_RET_OK, rcl_logging_external_shutdown()); |
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.
@brawner what if rcl_logging_external_shutdown()
fails because of fault injection?
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.
rcl_logging_external_shutdown()
is currently very simple and doesn't call any external functions. The EXPECT_EQ
will help notify people this test needs to be fixed should that function be modified.
rpr build fails because rcutils needs a new release in order for the fault injection macros to be included. |
CI builds all pass though, so this is good |
* Add fault injection unittest to increase coverage Signed-off-by: Stephen Brawner <brawner@gmail.com> * Update with recent rcutils changes Signed-off-by: Stephen Brawner <brawner@gmail.com> * target definitions Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Add fault injection unittest to increase coverage Signed-off-by: Stephen Brawner <brawner@gmail.com> * Update with recent rcutils changes Signed-off-by: Stephen Brawner <brawner@gmail.com> * target definitions Signed-off-by: Stephen Brawner <brawner@gmail.com> * PR Fixup Signed-off-by: Stephen Brawner <brawner@gmail.com>
This redoes #48 and adds unit tests and fault injection macros to rcl_logging_spdlog. Coverage can get to 99% with this. I'll post CI tests soon.