| 116 | } |
| 117 | |
| 118 | TEST_F(TestEthLogger, TestEthMessage) { |
| 119 | auto writer = MdfFactory::CreateMdfWriter(MdfWriterType::MdfBusLogger); |
| 120 | ASSERT_TRUE(writer); |
| 121 | |
| 122 | EthMessage msg; |
| 123 | |
| 124 | msg.BusChannel(5); |
| 125 | EXPECT_EQ(msg.BusChannel(), 5); |
| 126 | |
| 127 | msg.Dir(true); |
| 128 | EXPECT_TRUE(msg.Dir()); |
| 129 | |
| 130 | const uint8_t source_addr[6] = {1,2,3,4,5,6}; |
| 131 | const uint8_t* source_temp = source_addr; |
| 132 | msg.Source(source_temp); |
| 133 | const auto& source = msg.Source(); |
| 134 | for (size_t index1 = 0; index1 < 6; ++index1) { |
| 135 | EXPECT_EQ(source[index1], source_addr[index1]); |
| 136 | } |
| 137 | |
| 138 | const uint8_t dest_addr[6] = {2,3,4,5,6,7}; |
| 139 | const uint8_t* dest_temp = dest_addr; |
| 140 | msg.Destination(dest_temp); |
| 141 | const auto& dest = msg.Destination(); |
| 142 | for (size_t index2 = 0; index2 < 6; ++index2) { |
| 143 | EXPECT_EQ(dest[index2], dest_addr[index2]); |
| 144 | } |
| 145 | |
| 146 | msg.ReceivedDataByteCount(8); |
| 147 | EXPECT_EQ(msg.ReceivedDataByteCount(), 8); |
| 148 | |
| 149 | msg.DataLength(7); |
| 150 | EXPECT_EQ(msg.DataLength(), 7); |
| 151 | |
| 152 | std::vector<uint8_t> data = {0,1,2,3,4,5}; |
| 153 | msg.DataBytes(data); |
| 154 | EXPECT_EQ(msg.DataBytes(), data); |
| 155 | EXPECT_EQ(msg.DataLength(), 6); |
| 156 | |
| 157 | } |
| 158 | |
| 159 | TEST_F(TestEthLogger, Mdf4EthConfig) { |
| 160 | if (kSkipTest) { |
nothing calls this directly
no test coverage detected