Testing tooling fix

This commit is contained in:
Pavel Kirienko
2015-05-13 17:50:45 +03:00
parent a548d8311c
commit bc00899e70
3 changed files with 16 additions and 6 deletions
+5
View File
@@ -122,6 +122,11 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
return 1;
}
void pushRxToAllIfaces(const uavcan::CanFrame& can_frame)
{
read_queue.push(can_frame);
}
virtual uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
virtual uavcan::uint16_t getNumFilters() const { return 0; }
virtual uavcan::uint64_t getErrorCount() const { return error_count; }
+3 -6
View File
@@ -104,8 +104,8 @@ struct BackgroundSpinner : uavcan::TimerBase
}
};
template <typename MessageType>
static inline void emulateSingleFrameBroadcastTransfer(CanDriverMock& can, uavcan::NodeID node_id,
template <typename CanDriver, typename MessageType>
static inline void emulateSingleFrameBroadcastTransfer(CanDriver& can, uavcan::NodeID node_id,
const MessageType& message, uavcan::TransferID tid)
{
uavcan::StaticTransferBuffer<100> buffer;
@@ -126,8 +126,5 @@ static inline void emulateSingleFrameBroadcastTransfer(CanDriverMock& can, uavca
uavcan::CanFrame can_frame;
ASSERT_TRUE(frame.compile(can_frame));
for (uint8_t i = 0; i < can.getNumIfaces(); i++)
{
can.ifaces.at(i).pushRx(can_frame);
}
can.pushRxToAllIfaces(can_frame);
}
+8
View File
@@ -169,6 +169,14 @@ public:
, select_failure(false)
{ }
void pushRxToAllIfaces(const uavcan::CanFrame& can_frame)
{
for (uint8_t i = 0; i < getNumIfaces(); i++)
{
ifaces.at(i).pushRx(can_frame);
}
}
virtual uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime deadline)
{
assert(this);