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

Add serialize/deserialize API test coverage. #118

Merged
merged 5 commits into from
Aug 14, 2020

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Aug 10, 2020

Connected to ros2/rmw#258.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested a review from Blast545 August 10, 2020 22:12
Copy link
Contributor

@Blast545 Blast545 left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments

ASSERT_TRUE(test_msgs__msg__BasicTypes__init(&input_message));
rcutils_allocator_t failing_allocator = get_failing_allocator();
rmw_serialized_message_t serialized_message = rmw_get_zero_initialized_serialized_message();
ASSERT_EQ(RMW_RET_OK, rmw_serialized_message_init(
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing fini here and below

rcutils_allocator_t failing_allocator = get_failing_allocator();
rmw_serialized_message_t serialized_message = rmw_get_zero_initialized_serialized_message();
ASSERT_EQ(RMW_RET_OK, rmw_serialized_message_init(
&serialized_message, 0lu, &failing_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.

Would this call fail if buffer capacity weren't zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would. Which makes me think we should have separate set of test for rmw_serialized_message_t API, regardless of it being currently an alias for rcutils_uint8_array_t.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, they do but not here. Better in rmw.

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

input_message.bool_value = !output_message.bool_value;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe would be helpful adding a comment here to note those statements are to make them different, at first I was trying to see if the "-1" was to expect some sort of overflow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This reverts commit 5690348.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Aug 11, 2020

Hmm this is curious, I cannot reproduce that Rolling PR job failure locally.

@hidmic
Copy link
Contributor Author

hidmic commented Aug 11, 2020

CI up to test_rmw_implementation and rmw:

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

@hidmic
Copy link
Contributor Author

hidmic commented Aug 12, 2020

@ros-pull-request-builder retest this please.

1 similar comment
@hidmic
Copy link
Contributor Author

hidmic commented Aug 12, 2020

@ros-pull-request-builder retest this please.

@hidmic
Copy link
Contributor Author

hidmic commented Aug 12, 2020

Uh, that test failure's still there.

@hidmic
Copy link
Contributor Author

hidmic commented Aug 14, 2020

Let's try again with ros/rosdistro#26184 merged.

@ros-pull-request-builder retest this please!

@hidmic hidmic merged commit 1de5341 into master Aug 14, 2020
@hidmic hidmic deleted the hidmic/rmw-serialize-tests branch August 14, 2020 17:05
ahcorde pushed a commit that referenced this pull request Oct 9, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde pushed a commit that referenced this pull request Oct 21, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
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.

None yet

2 participants