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

Added tests for bounded sequences serialization #193

Merged
merged 10 commits into from
Aug 10, 2021

Conversation

MiguelCompany
Copy link
Contributor

Copy link
Contributor

@hidmic hidmic left a 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?

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
Contributor

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
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]>
Copy link
Contributor

@hidmic hidmic left a 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;

Copy link
Contributor

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.

@@ -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)};
Copy link
Contributor

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
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]>
@hidmic
Copy link
Contributor

hidmic commented Jun 16, 2021

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

@@ -14,8 +14,12 @@

#include <gtest/gtest.h>

#include "osrf_testing_tools_cpp/scope_exit.hpp"
Copy link
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
Contributor

Choose a reason for hiding this comment

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

Indeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@hidmic
Copy link
Contributor

hidmic commented Jun 17, 2021

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
Contributor Author

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

@hidmic
Copy link
Contributor

hidmic commented Jun 18, 2021

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
Contributor Author

@hidmic Last linter issue fixed.

@hidmic
Copy link
Contributor

hidmic commented Jun 22, 2021

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
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
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
Contributor

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
Contributor

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
Copy link
Contributor

hidmic commented Jul 30, 2021

MacOS CI, one more time:

  • macOS Build Status

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

hidmic commented Aug 4, 2021

CI again as it's been a while:

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

@hidmic
Copy link
Contributor

hidmic commented Aug 4, 2021

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

@hidmic
Copy link
Contributor

hidmic commented Aug 9, 2021

@ros-pull-request-builder retest this please

1 similar comment
@hidmic
Copy link
Contributor

hidmic commented Aug 10, 2021

@ros-pull-request-builder retest this please

@hidmic
Copy link
Contributor

hidmic commented Aug 10, 2021

Alright, finally green. Going in!

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