Skip to content

Added tests for bounded sequences serialization - #193

Merged
hidmic merged 10 commits into
ros2:masterfrom
eProsima:test-bounded-serialization
Aug 10, 2021
Merged

hidmic merged 10 commits into
ros2:masterfrom
eProsima:test-bounded-serialization

Conversation

@MiguelCompany

Copy link
Copy Markdown
Contributor

@hidmic hidmic left a comment

Copy link
Copy Markdown

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?

Comment on lines +168 to +172
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;

Copy link
Copy Markdown

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.

@MiguelCompany

Copy link
Copy Markdown
Contributor Author

Why wouldn't test_msgs/msg/BoundedSequences work?

Because it has strings, which are unbounded

it doesn't seem like test_msgs/msg/UnboundedSequencesNoStrings is used at all

I just added it for symmetry

@MiguelCompany
MiguelCompany force-pushed the test-bounded-serialization branch 2 times, most recently from f2851b5 to 72223af Compare June 8, 2021 15:20
Signed-off-by: Miguel Company <[email protected]>
@MiguelCompany
MiguelCompany force-pushed the test-bounded-serialization branch from 72223af to f2031b0 Compare June 8, 2021 15:21

@hidmic hidmic left a comment

Copy link
Copy Markdown

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;

Copy link
Copy Markdown

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.


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)};

Copy link
Copy Markdown

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

Suggested change
ROSIDL_GET_MSG_TYPE_SUPPORT(test_msgs, msg, BoundedSequencesNoStrings)};
ROSIDL_GET_MSG_TYPE_SUPPORT(test_msgs, msg, BoundedPlainSequences)};

? Same elsewhere.

Copy link
Copy Markdown
Contributor Author

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 <[email protected]>
@MiguelCompany
MiguelCompany force-pushed the test-bounded-serialization branch from 6b5d8f6 to f776a16 Compare June 16, 2021 13:33
@hidmic

hidmic commented Jun 16, 2021

Copy link
Copy Markdown

CI up to rmw_fastrtps_cpp, rmw_fastrtps_dynamic_cpp, rcl_interfaces and test_rmw_implementation:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status


#include <gtest/gtest.h>

#include "osrf_testing_tools_cpp/scope_exit.hpp"

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@hidmic

hidmic commented Jun 17, 2021 •

Copy link
Copy Markdown

Once again, CI up to rmw_fastrtps_cpp, rmw_fastrtps_dynamic_cpp, rosidl_typesupport_fastrtps, rcl_interfaces, and test_rmw_implementation:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Miguel Company <[email protected]>
@MiguelCompany

Copy link
Copy Markdown
Contributor Author

@hidmic I fixed the linter issues. Would you mind running CI again?

@hidmic

hidmic commented Jun 18, 2021

Copy link
Copy Markdown

Third's the charm hopefully:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Miguel Company <[email protected]>
@MiguelCompany

Copy link
Copy Markdown
Contributor Author

@hidmic Last linter issue fixed.

@hidmic

hidmic commented Jun 22, 2021 •

Copy link
Copy Markdown

Ok, let's start small this time Alright, let's go.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

ASSERT_EQ(
RMW_RET_OK, rmw_serialized_message_init(
&serialized_message, 0lu, &default_allocator)) << rmw_get_error_string().str;

Copy link
Copy Markdown
Collaborator

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.

Suggested change
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
EXPECT_EQ(
RMW_RET_OK, rmw_serialized_message_fini(
&serialized_message)) << rmw_get_error_string().str;
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown

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

CLASSNAME(
TestSerializeDeserialize,
RMW_IMPLEMENTATION), clean_round_trip_for_cpp_bounded_message) {
using test_message = test_msgs::msg::BoundedPlainSequences;

Copy link
Copy Markdown

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.

@hidmic

hidmic commented Jul 30, 2021

Copy link
Copy Markdown

MacOS CI, one more time:

  • macOS Build Status

Signed-off-by: Miguel Company <[email protected]>
@hidmic

hidmic commented Aug 4, 2021

Copy link
Copy Markdown

CI again as it's been a while:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic

hidmic commented Aug 4, 2021

Copy link
Copy Markdown

Almost there. We'll need to release a few packages for the Rpr job to pass here.

@hidmic

hidmic commented Aug 9, 2021

Copy link
Copy Markdown

@ros-pull-request-builder retest this please

1 similar comment
@hidmic

hidmic commented Aug 10, 2021

Copy link
Copy Markdown

@ros-pull-request-builder retest this please

@hidmic

hidmic commented Aug 10, 2021

Copy link
Copy Markdown

Alright, finally green. Going in!

@hidmic
hidmic merged commit 0fcac11 into ros2:master Aug 10, 2021
@MiguelCompany
MiguelCompany deleted the test-bounded-serialization branch July 8, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants