-
Notifications
You must be signed in to change notification settings - Fork 163
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 macros and unit tests to rcl_action #730
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -972,14 +972,31 @@ TEST_F(TestActionServer, action_server_init_fini_maybe_fail) | |
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options(); | ||
rcl_ret_t ret = rcl_init_options_init(&init_options, allocator); | ||
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; | ||
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( | ||
{ | ||
EXPECT_EQ(RCL_RET_OK, rcl_init_options_fini(&init_options)); | ||
}); | ||
|
||
rcl_context_t context = rcl_get_zero_initialized_context(); | ||
ret = rcl_init(0, nullptr, &init_options, &context); | ||
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brawner missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( | ||
{ | ||
EXPECT_EQ(RCL_RET_OK, rcl_shutdown(&context)); | ||
EXPECT_EQ(RCL_RET_OK, rcl_context_fini(&context)); | ||
}); | ||
|
||
rcl_node_t node = rcl_get_zero_initialized_node(); | ||
rcl_node_options_t node_options = rcl_node_get_default_options(); | ||
ret = rcl_node_init(&node, "test_action_server_node", "", &context, &node_options); | ||
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brawner missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( | ||
{ | ||
EXPECT_EQ(RCL_RET_OK, rcl_node_fini(&node)); | ||
EXPECT_EQ(RCL_RET_OK, rcl_node_options_fini(&node_options)); | ||
} | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brawner There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uncrustify was happy, but combined lines 997 and 998. |
||
|
||
rcl_clock_t clock; | ||
ret = rcl_clock_init(RCL_STEADY_TIME, &clock, &allocator); | ||
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; | ||
|
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 missing
fini
counterpart?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.
Added.