19 #include <gtest/gtest.h> 21 #include <variant_msgs/Test.h> 28 std::vector<MessageType> messageTypes;
31 ros::message_traits::datatype<variant_msgs::Test>(),
32 ros::message_traits::definition<variant_msgs::Test>(),
35 EXPECT_FALSE(messageTypes.empty());
36 EXPECT_EQ(ros::message_traits::datatype<variant_msgs::Test>(),
37 messageTypes[0].getDataType());
38 EXPECT_EQ(ros::message_traits::datatype<std_msgs::Header>(),
39 messageTypes[1].getDataType());
40 EXPECT_EQ(ros::message_traits::definition<std_msgs::Header>(),
41 messageTypes[1].getDefinition());
45 std::string name, type, value;
51 EXPECT_EQ(
"int32", type);
55 EXPECT_EQ(
"int32", type);
59 EXPECT_EQ(
"int32", type);
65 EXPECT_EQ(
"int32", type);
69 EXPECT_EQ(
"int32", type);
70 EXPECT_EQ(
"1", value);
72 "string x= value # Comment ", name, type, value));
74 EXPECT_EQ(
"string", type);
75 EXPECT_EQ(
"value # Comment", value);
79 EXPECT_EQ(
"int32", type);
83 EXPECT_EQ(
"int32[3]", type);
87 EXPECT_EQ(
"int32", type);
92 EXPECT_EQ(
"int32", type);
Header file providing the MessageDefinitionParser class interface.
TEST(MessageDefinitionParser, Parse)