-
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
Makes rcl_action_get_*_name() functions check for empty action names. #329
Conversation
rcl_action/src/rcl_action/names.c
Outdated
@@ -51,6 +57,11 @@ rcl_action_get_cancel_service_name( | |||
{ | |||
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "allocator is invalid", return RCL_RET_INVALID_ARGUMENT); | |||
RCL_CHECK_ARGUMENT_FOR_NULL(action_name, RCL_RET_INVALID_ARGUMENT); | |||
RCL_CHECK_ARGUMENT_FOR_NULL(action_name, RCL_RET_INVALID_ARGUMENT); |
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.
Duplicate of line above?
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.
Argh, fixed in 276aed1.
rcl_action/src/rcl_action/names.c
Outdated
@@ -30,6 +32,10 @@ rcl_action_get_goal_service_name( | |||
{ | |||
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "allocator is invalid", return RCL_RET_INVALID_ARGUMENT); | |||
RCL_CHECK_ARGUMENT_FOR_NULL(action_name, RCL_RET_INVALID_ARGUMENT); | |||
if (0 == strlen(action_name)) { | |||
RCL_SET_ERROR_MSG("invalid empty action name"); | |||
return RCL_RET_INVALID_ARGUMENT; |
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.
Suggest returning RCL_RET_ACTION_NAME_INVALID
. Then it makes it possible for the action client/server to know if the provided name is empty (invalid) vs a null argument. Same for other functions and also update the docs to include the new return type.
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.
Alright, makes sense. Done in 276aed1.
rcl_action/src/rcl_action/names.c
Outdated
@@ -51,6 +57,11 @@ rcl_action_get_cancel_service_name( | |||
{ | |||
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "allocator is invalid", return RCL_RET_INVALID_ARGUMENT); | |||
RCL_CHECK_ARGUMENT_FOR_NULL(action_name, RCL_RET_INVALID_ARGUMENT); | |||
RCL_CHECK_ARGUMENT_FOR_NULL(action_name, RCL_RET_INVALID_ARGUMENT); |
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.
Redundant.
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.
Argh, yeah, fixed in 276aed1.
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.
LGTM pending CI
@apojomovsky could you add CI for Windows and Mac as well ? |
Sure! |
Looks like MSVC complaints come from |
The urdfdom problems should be fixed by ros/urdfdom_headers#48 and the new release (1.0.2). Sorry for the noise. |
@hidmic Since the complaints are not related to this change, I think it is okay to merge. |
This reverts commit d487533.
This reverts commit d487533.
Connected to #306. Tiny PR to check for empty action names upon
rcl_action_get_*_name()
calls.Reported by in #323 (comment).