34 #include "gtest/gtest.h" 36 TEST(PacketTest, Constructor)
39 EXPECT_EQ(static_cast<int>(empty_packet.
nbytes), 0);
40 EXPECT_EQ(empty_packet.
info, std::string(
""));
43 EXPECT_EQ(static_cast<int>(some_packet.
nbytes), 2);
44 EXPECT_EQ(some_packet.
info, std::string(
"test_packet"));
47 TEST(PacketTest, SetValidateAndGetData)
52 const uint16_t some_data = 123;
56 const uint16_t some_data_result = packet.
getData();
57 EXPECT_EQ(some_data_result, some_data);
60 const uint16_t zero_data = 0;
64 const uint16_t zero_data_result = packet.
getData();
65 EXPECT_EQ(zero_data_result, zero_data);
68 const uint16_t do_not_validate_data = 321;
71 const uint16_t unvalidated_data_result = packet.
getData();
72 EXPECT_NE(unvalidated_data_result, do_not_validate_data);
void setDataToValidate(const uint16_t &td)
TEST(PacketTest, Constructor)