Skip to content
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

initialize memory before sending a message #277

Merged
merged 3 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rcl/test/rcl/client_fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ int main(int argc, char ** argv)

// Initialize a request.
test_msgs__srv__Primitives_Request client_request;
memset(&client_request, 0, sizeof(test_msgs__srv__Primitives_Request));
test_msgs__srv__Primitives_Request__init(&client_request);
client_request.uint8_value = 1;
client_request.uint32_value = 2;
Expand All @@ -178,6 +179,7 @@ int main(int argc, char ** argv)

// Initialize the response owned by the client and take the response.
test_msgs__srv__Primitives_Response client_response;
memset(&client_response, 0, sizeof(test_msgs__srv__Primitives_Response));
test_msgs__srv__Primitives_Response__init(&client_response);

if (!wait_for_client_to_be_ready(&client, 1000, 100)) {
Expand Down
2 changes: 2 additions & 0 deletions rcl/test/rcl/service_fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ int main(int argc, char ** argv)

// Initialize a response.
test_msgs__srv__Primitives_Response service_response;
memset(&service_response, 0, sizeof(test_msgs__srv__Primitives_Response));
test_msgs__srv__Primitives_Response__init(&service_response);
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
test_msgs__srv__Primitives_Response__fini(&service_response);
Expand All @@ -139,6 +140,7 @@ int main(int argc, char ** argv)

// Take the pending request.
test_msgs__srv__Primitives_Request service_request;
memset(&service_request, 0, sizeof(test_msgs__srv__Primitives_Request));
test_msgs__srv__Primitives_Request__init(&service_request);
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
test_msgs__srv__Primitives_Request__fini(&service_request);
Expand Down