From 7126b4987f28e26572d5610a237febcb2a4a70c4 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 1 May 2019 11:50:52 -0500 Subject: [PATCH] Fix tests for new APIs. Signed-off-by: Michael Carroll --- rcl/test/rcl/test_publisher.cpp | 9 ++++----- rcl/test/rcl/test_subscription.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/rcl/test/rcl/test_publisher.cpp b/rcl/test/rcl/test_publisher.cpp index c6f815c66..96d40bf44 100644 --- a/rcl/test/rcl/test_publisher.cpp +++ b/rcl/test/rcl/test_publisher.cpp @@ -83,7 +83,6 @@ TEST_F(CLASSNAME(TestPublisherFixture, RMW_IMPLEMENTATION), test_publisher_nomin const char * topic_name = "chatter"; const char * expected_topic_name = "/chatter"; rcl_publisher_options_t publisher_options = rcl_publisher_get_default_options(); - publisher_options.preallocate = true; ret = rcl_publisher_init(&publisher, this->node_ptr, ts, topic_name, &publisher_options); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({ @@ -94,7 +93,7 @@ TEST_F(CLASSNAME(TestPublisherFixture, RMW_IMPLEMENTATION), test_publisher_nomin test_msgs__msg__BasicTypes msg; test_msgs__msg__BasicTypes__init(&msg); msg.int64_value = 42; - ret = rcl_publish(&publisher, &msg); + ret = rcl_publish(&publisher, &msg, nullptr); test_msgs__msg__BasicTypes__fini(&msg); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; } @@ -117,7 +116,7 @@ TEST_F(CLASSNAME(TestPublisherFixture, RMW_IMPLEMENTATION), test_publisher_nomin test_msgs__msg__Strings msg; test_msgs__msg__Strings__init(&msg); ASSERT_TRUE(rosidl_generator_c__String__assign(&msg.string_value, "testing")); - ret = rcl_publish(&publisher, &msg); + ret = rcl_publish(&publisher, &msg, nullptr); test_msgs__msg__Strings__fini(&msg); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; } @@ -161,14 +160,14 @@ TEST_F(CLASSNAME(TestPublisherFixture, RMW_IMPLEMENTATION), test_publishers_diff test_msgs__msg__BasicTypes msg_int; test_msgs__msg__BasicTypes__init(&msg_int); msg_int.int64_value = 42; - ret = rcl_publish(&publisher, &msg_int); + ret = rcl_publish(&publisher, &msg_int, nullptr); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; test_msgs__msg__BasicTypes__fini(&msg_int); test_msgs__msg__Strings msg_string; test_msgs__msg__Strings__init(&msg_string); ASSERT_TRUE(rosidl_generator_c__String__assign(&msg_string.string_value, "testing")); - ret = rcl_publish(&publisher_in_namespace, &msg_string); + ret = rcl_publish(&publisher_in_namespace, &msg_string, nullptr); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; } diff --git a/rcl/test/rcl/test_subscription.cpp b/rcl/test/rcl/test_subscription.cpp index 261b24eda..03cd5de87 100644 --- a/rcl/test/rcl/test_subscription.cpp +++ b/rcl/test/rcl/test_subscription.cpp @@ -163,7 +163,7 @@ TEST_F(CLASSNAME(TestSubscriptionFixture, RMW_IMPLEMENTATION), test_subscription test_msgs__msg__BasicTypes msg; test_msgs__msg__BasicTypes__init(&msg); msg.int64_value = 42; - ret = rcl_publish(&publisher, &msg); + ret = rcl_publish(&publisher, &msg, nullptr); test_msgs__msg__BasicTypes__fini(&msg); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; } @@ -176,7 +176,7 @@ TEST_F(CLASSNAME(TestSubscriptionFixture, RMW_IMPLEMENTATION), test_subscription OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({ test_msgs__msg__BasicTypes__fini(&msg); }); - ret = rcl_take(&subscription, &msg, nullptr); + ret = rcl_take(&subscription, &msg, nullptr, nullptr); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; ASSERT_EQ(42, msg.int64_value); } @@ -214,7 +214,7 @@ TEST_F(CLASSNAME(TestSubscriptionFixture, RMW_IMPLEMENTATION), test_subscription test_msgs__msg__Strings msg; test_msgs__msg__Strings__init(&msg); ASSERT_TRUE(rosidl_generator_c__String__assign(&msg.string_value, test_string)); - ret = rcl_publish(&publisher, &msg); + ret = rcl_publish(&publisher, &msg, nullptr); test_msgs__msg__Strings__fini(&msg); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; } @@ -227,7 +227,7 @@ TEST_F(CLASSNAME(TestSubscriptionFixture, RMW_IMPLEMENTATION), test_subscription OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({ test_msgs__msg__Strings__fini(&msg); }); - ret = rcl_take(&subscription, &msg, nullptr); + ret = rcl_take(&subscription, &msg, nullptr, nullptr); ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str; ASSERT_EQ(std::string(test_string), std::string(msg.string_value.data, msg.string_value.size)); }