Added tests for bounded sequences serialization#193
Conversation
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
hidmic
left a comment
There was a problem hiding this comment.
About ros2/test_interface_files#14 and ros2/rcl_interfaces#123, it doesn't seem like test_msgs/msg/UnboundedSequencesNoStrings is used at all. Also, why is test_msgs/msg/BoundedSequencesNoStrings necessary? Why wouldn't test_msgs/msg/BoundedSequences work?
| test_msgs__msg__BoundedSequencesNoStrings__fini(&input_message); | ||
| test_msgs__msg__BoundedSequencesNoStrings__fini(&output_message); | ||
|
|
||
| EXPECT_EQ(RMW_RET_OK, rmw_serialized_message_fini(&serialized_message)) << | ||
| rmw_get_error_string().str; |
There was a problem hiding this comment.
@MiguelCompany consider moving these lines to OSRF_TESTING_SCOPE_EXIT blocks.
Because it has strings, which are unbounded
I just added it for symmetry |
f2851b5 to
72223af
Compare
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
72223af to
f2031b0
Compare
| ASSERT_EQ( | ||
| RMW_RET_OK, rmw_serialized_message_init( | ||
| &serialized_message, 0lu, &default_allocator)) << rmw_get_error_string().str; | ||
|
|
There was a problem hiding this comment.
@MiguelCompany an OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT block finalizing serialized_message is missing here.
Signed-off-by: Miguel Company <miguelcompany@eProsima.com>
|
|
||
| TEST_F(CLASSNAME(TestSerializeDeserialize, RMW_IMPLEMENTATION), clean_round_trip_for_c_bounded_message) { | ||
| const rosidl_message_type_support_t * ts{ | ||
| ROSIDL_GET_MSG_TYPE_SUPPORT(test_msgs, msg, BoundedSequencesNoStrings)}; |
There was a problem hiding this comment.
@MiguelCompany hmm, did you mean
| ROSIDL_GET_MSG_TYPE_SUPPORT(test_msgs, msg, BoundedSequencesNoStrings)}; | |
| ROSIDL_GET_MSG_TYPE_SUPPORT(test_msgs, msg, BoundedPlainSequences)}; |
? Same elsewhere.
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
6b5d8f6 to
f776a16
Compare
|
|
||
| #include <gtest/gtest.h> | ||
|
|
||
| #include "osrf_testing_tools_cpp/scope_exit.hpp" |
There was a problem hiding this comment.
It looks like we need an ament_target_dependencies on osrf_testing_tools_cpp for this test now.
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
|
@hidmic I fixed the linter issues. Would you mind running CI again? |
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
|
@hidmic Last linter issue fixed. |
| ASSERT_EQ( | ||
| RMW_RET_OK, rmw_serialized_message_init( | ||
| &serialized_message, 0lu, &default_allocator)) << rmw_get_error_string().str; | ||
|
|
There was a problem hiding this comment.
nit, but i would also use OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT.
| OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( | |
| { | |
| EXPECT_EQ( | |
| RMW_RET_OK, rmw_serialized_message_fini( | |
| &serialized_message)) << rmw_get_error_string().str; | |
| }); |
There was a problem hiding this comment.
@MiguelCompany nit: check block indentation
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
| CLASSNAME( | ||
| TestSerializeDeserialize, | ||
| RMW_IMPLEMENTATION), clean_round_trip_for_cpp_bounded_message) { | ||
| using test_message = test_msgs::msg::BoundedPlainSequences; |
There was a problem hiding this comment.
@MiguelCompany nit: use camel case for C++ type names, as per GSG.
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
|
Almost there. We'll need to release a few packages for the Rpr job to pass here. |
|
@ros-pull-request-builder retest this please |
1 similar comment
|
@ros-pull-request-builder retest this please |
|
Alright, finally green. Going in! |
Regression test for ros2/rmw_fastrtps#540
Depends on ros2/rcl_interfaces#123
Depends on ros2/test_interface_files#14