-
Notifications
You must be signed in to change notification settings - Fork 49
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
Added tests for bounded sequences serialization #193
Conversation
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM but for one comment
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MiguelCompany an OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT
block finalizing serialized_message
is missing here.
Signed-off-by: Miguel Company <miguelcompany@eProsima.com>
@@ -112,6 +119,67 @@ TEST_F(CLASSNAME(TestSerializeDeserialize, RMW_IMPLEMENTATION), clean_round_trip | |||
rmw_get_error_string().str; | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups! Fixed on f776a16
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
6b5d8f6
to
f776a16
Compare
@@ -14,8 +14,12 @@ | |||
|
|||
#include <gtest/gtest.h> | |||
|
|||
#include "osrf_testing_tools_cpp/scope_exit.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we need an ament_target_dependencies
on osrf_testing_tools_cpp
for this test now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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