fix leak in test_get_actual_qos (#445)
Signed-off-by: Abby Xu <abbyxu@amazon.com>
This commit is contained in:
parent
82f93afde5
commit
2a9b2979a2
2 changed files with 5 additions and 1 deletions
|
@ -124,7 +124,7 @@ function(test_target_function)
|
||||||
ENV ${rmw_implementation_env_var}
|
ENV ${rmw_implementation_env_var}
|
||||||
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
|
APPEND_LIBRARY_DIRS ${extra_lib_dirs}
|
||||||
LIBRARIES ${PROJECT_NAME}
|
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}
|
rcl_add_custom_gtest(test_init${target_suffix}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "rcl/rcl.h"
|
#include "rcl/rcl.h"
|
||||||
#include "rcl/publisher.h"
|
#include "rcl/publisher.h"
|
||||||
|
|
||||||
|
#include "osrf_testing_tools_cpp/scope_exit.hpp"
|
||||||
#include "rcutils/logging_macros.h"
|
#include "rcutils/logging_macros.h"
|
||||||
#include "rcutils/macros.h"
|
#include "rcutils/macros.h"
|
||||||
|
|
||||||
|
@ -82,6 +83,9 @@ public:
|
||||||
*this->context_ptr = rcl_get_zero_initialized_context();
|
*this->context_ptr = rcl_get_zero_initialized_context();
|
||||||
ret = rcl_init(0, nullptr, &init_options, this->context_ptr);
|
ret = rcl_init(0, nullptr, &init_options, this->context_ptr);
|
||||||
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
|
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 = new rcl_node_t;
|
||||||
*this->node_ptr = rcl_get_zero_initialized_node();
|
*this->node_ptr = rcl_get_zero_initialized_node();
|
||||||
const char * name = "test_get_actual_qos_node";
|
const char * name = "test_get_actual_qos_node";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue