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

Fix test_rcl_get_publishers_subscription_info_by_topic #571

Merged
merged 1 commit into from
Feb 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions rcl/test/rcl/test_info_by_topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@ class CLASSNAME (TestInfoByTopicFixture, RMW_IMPLEMENTATION) : public ::testing:
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
}

void assert_qos_equality(rmw_qos_profile_t qos_profile1, rmw_qos_profile_t qos_profile2)
void assert_qos_equality(
rmw_qos_profile_t qos_profile1, rmw_qos_profile_t qos_profile2,
bool is_publisher)
{
EXPECT_EQ(qos_profile1.deadline.sec, qos_profile2.deadline.sec);
EXPECT_EQ(qos_profile1.deadline.nsec, qos_profile2.deadline.nsec);
EXPECT_EQ(qos_profile1.lifespan.sec, qos_profile2.lifespan.sec);
EXPECT_EQ(qos_profile1.lifespan.nsec, qos_profile2.lifespan.nsec);
if (is_publisher) {
ivanpauno marked this conversation as resolved.
Show resolved Hide resolved
EXPECT_EQ(qos_profile1.lifespan.sec, qos_profile2.lifespan.sec);
EXPECT_EQ(qos_profile1.lifespan.nsec, qos_profile2.lifespan.nsec);
}
EXPECT_EQ(qos_profile1.reliability, qos_profile2.reliability);
EXPECT_EQ(qos_profile1.liveliness, qos_profile2.liveliness);
EXPECT_EQ(
Expand Down Expand Up @@ -323,7 +327,7 @@ TEST_F(
if (!is_fastrtps) {
GTEST_SKIP();
}
rmw_qos_profile_t default_qos_profile;
rmw_qos_profile_t default_qos_profile = rmw_qos_profile_system_default;
default_qos_profile.history = RMW_QOS_POLICY_HISTORY_KEEP_LAST;
default_qos_profile.depth = 0;
default_qos_profile.reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT;
Expand Down Expand Up @@ -371,7 +375,7 @@ TEST_F(
EXPECT_STREQ(topic_endpoint_info_pub.node_name, this->test_graph_node_name);
EXPECT_STREQ(topic_endpoint_info_pub.node_namespace, "/");
EXPECT_STREQ(topic_endpoint_info_pub.topic_type, "test_msgs/msg/Strings");
assert_qos_equality(topic_endpoint_info_pub.qos_profile, default_qos_profile);
assert_qos_equality(topic_endpoint_info_pub.qos_profile, default_qos_profile, true);

rmw_topic_endpoint_info_array_t topic_endpoint_info_array_sub =
rmw_get_zero_initialized_topic_endpoint_info_array();
Expand All @@ -384,7 +388,7 @@ TEST_F(
EXPECT_STREQ(topic_endpoint_info_sub.node_name, this->test_graph_node_name);
EXPECT_STREQ(topic_endpoint_info_sub.node_namespace, "/");
EXPECT_STREQ(topic_endpoint_info_sub.topic_type, "test_msgs/msg/Strings");
assert_qos_equality(topic_endpoint_info_sub.qos_profile, default_qos_profile);
assert_qos_equality(topic_endpoint_info_sub.qos_profile, default_qos_profile, false);

// clean up
rmw_ret_t rmw_ret =
Expand Down