Skip to content

Commit

Permalink
fix leak in test_get_actual_qos (#445)
Browse files Browse the repository at this point in the history
Signed-off-by: Abby Xu <abbyxu@amazon.com>
  • Loading branch information
xabxx authored and dirk-thomas committed May 20, 2019
1 parent 82f93af commit 2a9b297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rcl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function(test_target_function)
ENV ${rmw_implementation_env_var}
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
LIBRARIES ${PROJECT_NAME}
AMENT_DEPENDENCIES ${rmw_implementation} "test_msgs"
AMENT_DEPENDENCIES ${rmw_implementation} "test_msgs" "osrf_testing_tools_cpp"
)

rcl_add_custom_gtest(test_init${target_suffix}
Expand Down
4 changes: 4 additions & 0 deletions rcl/test/rcl/test_get_actual_qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "rcl/rcl.h"
#include "rcl/publisher.h"

#include "osrf_testing_tools_cpp/scope_exit.hpp"
#include "rcutils/logging_macros.h"
#include "rcutils/macros.h"

Expand Down Expand Up @@ -82,6 +83,9 @@ class TEST_FIXTURE_P_RMW (TestGetActualQoS)
*this->context_ptr = rcl_get_zero_initialized_context();
ret = rcl_init(0, nullptr, &init_options, this->context_ptr);
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_get_error_string().str;
});
this->node_ptr = new rcl_node_t;
*this->node_ptr = rcl_get_zero_initialized_node();
const char * name = "test_get_actual_qos_node";
Expand Down

0 comments on commit 2a9b297

Please sign in to comment.