Skip to content

Commit

Permalink
Merge pull request #271 from ros2/bouncy_patch1
Browse files Browse the repository at this point in the history
backport #263 to bouncy
  • Loading branch information
mikaelarguedas authored Jul 17, 2018
2 parents d13a902 + 3de8677 commit ea72dae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rcl/src/rcl/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ rcl_node_init(
}
char * remapped_namespace = NULL;
ret = rcl_remap_node_namespace(
&(node->impl->options.arguments), global_args, local_namespace_,
&(node->impl->options.arguments), global_args, name,
*allocator, &remapped_namespace);
if (RCL_RET_OK != ret) {
goto fail;
Expand Down
16 changes: 16 additions & 0 deletions rcl/test/rcl/test_remap_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,19 @@ TEST_F(CLASSNAME(TestRemapIntegrationFixture, RMW_IMPLEMENTATION), remap_relativ

EXPECT_EQ(RCL_RET_OK, rcl_node_fini(&node));
}

TEST_F(CLASSNAME(TestRemapIntegrationFixture, RMW_IMPLEMENTATION), remap_using_node_rules) {
int argc;
char ** argv;
SCOPE_GLOBAL_ARGS(
argc, argv, "process_name", "original_name:__ns:=/new_ns");

rcl_node_t node = rcl_get_zero_initialized_node();
rcl_node_options_t default_options = rcl_node_get_default_options();
ASSERT_EQ(RCL_RET_OK, rcl_node_init(&node, "original_name", "", &default_options));

{ // Node namespace gets remapped
EXPECT_STREQ("/new_ns", rcl_node_get_namespace(&node));
}
EXPECT_EQ(RCL_RET_OK, rcl_node_fini(&node));
}

0 comments on commit ea72dae

Please sign in to comment.