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

Complete tests for geometric type translations #5

Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,56 @@ TEST_F(LaneToRosMessageTest, NullLane) {
ASSERT_EQ(dut.id.id, kNullLaneId);
}

GTEST_TEST(BranchPointIdFromRosMessage, ValidateConversion) {
const std::string kBranchPointId{"branch_point_id"};
maliput_ros_interfaces::msg::BranchPointId msg;
msg.id = kBranchPointId;

const maliput::api::BranchPointId dut = FromRosMessage(msg);

ASSERT_EQ(dut.string(), kBranchPointId);
}

GTEST_TEST(JunctionIdFromRosMessage, ValidateConversion) {
const std::string kJunctionId{"junction_id"};
maliput_ros_interfaces::msg::JunctionId msg;
msg.id = kJunctionId;

const maliput::api::JunctionId dut = FromRosMessage(msg);

ASSERT_EQ(dut.string(), kJunctionId);
}

GTEST_TEST(LaneIdFromRosMessage, ValidateConversion) {
const std::string kLaneId{"lane_id"};
maliput_ros_interfaces::msg::LaneId msg;
msg.id = kLaneId;

const maliput::api::LaneId dut = FromRosMessage(msg);

ASSERT_EQ(dut.string(), kLaneId);
}

GTEST_TEST(RoadGeometryIdFromRosMessage, ValidateConversion) {
const std::string kRoadGeometryId{"road_geometry_id"};
maliput_ros_interfaces::msg::RoadGeometryId msg;
msg.id = kRoadGeometryId;

const maliput::api::RoadGeometryId dut = FromRosMessage(msg);

ASSERT_EQ(dut.string(), kRoadGeometryId);
}

GTEST_TEST(SegmentIdFromRosMessage, ValidateConversion) {
const std::string kSegmentId{"segment_id"};
maliput_ros_interfaces::msg::SegmentId msg;
msg.id = kSegmentId;

const maliput::api::SegmentId dut = FromRosMessage(msg);

ASSERT_EQ(dut.string(), kSegmentId);
}

} // namespace
} // namespace test
} // namespace maliput_ros_translation