MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / TEST_F

Function TEST_F

lib/mdflib/mdflib_test/src/testethlogger.cpp:118–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118TEST_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
159TEST_F(TestEthLogger, Mdf4EthConfig) {
160 if (kSkipTest) {

Callers

nothing calls this directly

Calls 15

TimeStampToNsFunction · 0.85
ToolNameMethod · 0.80
PreTrigTimeMethod · 0.80
CompressDataMethod · 0.80
assignMethod · 0.80
EthTypeMethod · 0.80
ExpectedCrcMethod · 0.80
PaddingByteCountMethod · 0.80
BusChannelMethod · 0.45
DirMethod · 0.45
SourceMethod · 0.45

Tested by

no test coverage detected