Skip to content

Commit 51a4b21

Browse files
authored
Initialize integers in test_parameter_event_handler.cpp to avoid undefined behavior (ros2#1609)
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent aa3a65d commit 51a4b21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rclcpp/test/rclcpp/test_parameter_event_handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ TEST_F(TestNode, RegisterParameterCallback)
149149

150150
TEST_F(TestNode, SameParameterDifferentNode)
151151
{
152-
int64_t int_param_node1;
153-
int64_t int_param_node2;
152+
int64_t int_param_node1{0};
153+
int64_t int_param_node2{0};
154154

155155
auto cb1 = [&int_param_node1](const rclcpp::Parameter & p) {
156156
int_param_node1 = p.get_value<int64_t>();

0 commit comments

Comments
 (0)