6 #include <gtest/gtest.h>
15 return sender.
send(
reinterpret_cast<const uint8_t*
>(data.c_str()),
unsigned(data.length()),
24 return sender.
send(
reinterpret_cast<const uint8_t*
>(data.c_str()),
unsigned(data.length()),
30 TEST(TransferSender, Basic)
41 ASSERT_TRUE(dispatcher_tx.
setNodeID(TX_NODE_ID));
42 ASSERT_TRUE(dispatcher_rx.
setNodeID(RX_NODE_ID));
59 static const std::string DATA[4] =
63 "The ships hung in the sky in much the same way that bricks don't.",
65 "Would it save you a lot of time if I just gave up and went mad now?",
67 "If there's anything more important than my ego around, I want it caught and shot now."
73 static const uint64_t TX_DEADLINE = 1000000;
107 ASSERT_EQ(0, driver.
ifaces.at(0).tx.front().flags);
115 std::cout <<
"Num frames: " << iface.
tx.size() << std::endl;
116 while (!iface.
tx.empty())
134 const int res = dispatcher_rx.
spin(
tsMono(0));
151 ASSERT_TRUE(sub_srv_req.
matchAndPop(TRANSFERS[4]));
152 ASSERT_TRUE(sub_srv_req.
matchAndPop(TRANSFERS[6]));
154 ASSERT_TRUE(sub_srv_resp.
matchAndPop(TRANSFERS[5]));
155 ASSERT_TRUE(sub_srv_resp.
matchAndPop(TRANSFERS[7]));
198 ASSERT_TRUE(dispatcher.
setNodeID(TX_NODE_ID));
215 ASSERT_EQ(0, listener.
count);
217 ASSERT_EQ(1, listener.
count);
239 static const uint8_t Payload[] = {1, 2, 3, 4, 5};
242 ASSERT_EQ(-uavcan::ErrPassiveMode,
254 ASSERT_EQ(-uavcan::ErrPassiveMode,
259 ASSERT_FALSE(driver.
ifaces.at(0).tx.empty());