36 #include <gtest/gtest.h> 51 char* ptr = (
char*)buffer.get();
62 std::string error_msg;
63 ASSERT_TRUE(header.
parse(buffer, total_len, error_msg));
66 ASSERT_TRUE(header.
getValue(
"A", val));
67 ASSERT_STREQ(val.c_str(),
"B");
69 ASSERT_TRUE(header.
getValue(
"AAAAAAAAAAAAA", val));
70 ASSERT_STREQ(val.c_str(),
"BBBBBBB\nBBBBBBB");
77 map[
"fasdf"] =
"aaaaaaaaaaaaaaa";
78 map[
"02490\n254"] =
"idsjowiejf\nioajfoiwje";
84 ASSERT_EQ(len, 4*3 + 3 + strlen(
"haha") + strlen(
"hoho") + strlen(
"fasdf") + strlen(
"aaaaaaaaaaaaaaa") + strlen(
"02490\n254") + strlen(
"idsjowiejf\nioajfoiwje"));
87 std::string error_msg;
88 ASSERT_TRUE(header.
parse(buffer, len, error_msg));
91 ASSERT_TRUE(header.
getValue(
"haha", val));
92 ASSERT_STREQ(val.c_str(),
"hoho");
94 ASSERT_TRUE(header.
getValue(
"fasdf", val));
95 ASSERT_STREQ(val.c_str(),
"aaaaaaaaaaaaaaa");
97 ASSERT_TRUE(header.
getValue(
"02490\n254", val));
98 ASSERT_STREQ(val.c_str(),
"idsjowiejf\nioajfoiwje");
104 testing::InitGoogleTest(&argc, argv);
105 return RUN_ALL_TESTS();
std_msgs::Header * header(M &m)
std::map< std::string, std::string > M_string