Reorganized directory structure for tests and src

This commit is contained in:
Pavel Kirienko 2014-03-10 19:25:28 +04:00
parent 21fda96978
commit b86ea67563
43 changed files with 26 additions and 24 deletions

View File

@ -174,7 +174,7 @@ public:
UtcTime& operator=(const Timestamp& ts)
{
*this = UtcTime::fromUSec(ts.husec * Timestamp::USEC_PER_LSB);
*this = fromUSec(ts.husec * Timestamp::USEC_PER_LSB);
return *this;
}

View File

@ -5,7 +5,6 @@
#pragma once
#include <cassert>
#include <uavcan/can_driver.hpp>
#include <uavcan/system_clock.hpp>
#include <time.h>
#include <sys/time.h>
@ -83,14 +82,6 @@ public:
}
};
enum FrameType { STD, EXT };
static uavcan::CanFrame makeCanFrame(uint32_t id, const std::string& str_data, FrameType type)
{
id |= (type == EXT) ? uavcan::CanFrame::FlagEFF : 0;
return uavcan::CanFrame(id, reinterpret_cast<const uint8_t*>(str_data.c_str()), str_data.length());
}
static bool areTimestampsClose(int64_t a, int64_t b, int64_t precision_usec = 10000)
{
return std::abs(a - b) < precision_usec;

View File

@ -5,8 +5,8 @@
#include <gtest/gtest.h>
#include <uavcan/timer.hpp>
#include <uavcan/util/method_binder.hpp>
#include "../common.hpp"
#include "../transport/can/iface_mock.hpp"
#include "../../clock.hpp"
#include "../transport/can/can.hpp"
struct TimerCallCounter
{

View File

@ -4,12 +4,15 @@
#pragma once
#include <cassert>
#include <queue>
#include <vector>
#include <gtest/gtest.h>
#include <uavcan/internal/transport/can_io.hpp>
#include <uavcan/internal/transport/transfer.hpp>
#include "../../common.hpp"
#include <uavcan/can_driver.hpp>
#include <uavcan/system_clock.hpp>
#include "../../../clock.hpp"
class CanIfaceMock : public uavcan::ICanIface
@ -155,3 +158,10 @@ public:
uavcan::ICanIface* getIface(int iface_index) { return &ifaces.at(iface_index); }
int getNumIfaces() const { return ifaces.size(); }
};
enum FrameType { STD, EXT };
static uavcan::CanFrame makeCanFrame(uint32_t id, const std::string& str_data, FrameType type)
{
id |= (type == EXT) ? uavcan::CanFrame::FlagEFF : 0;
return uavcan::CanFrame(id, reinterpret_cast<const uint8_t*>(str_data.c_str()), str_data.length());
}

View File

@ -3,7 +3,7 @@
*/
#include <gtest/gtest.h>
#include "common.hpp"
#include "can.hpp"
#include <uavcan/can_driver.hpp>
TEST(CanFrame, FrameProperties)

View File

@ -3,7 +3,7 @@
*/
#include <gtest/gtest.h>
#include "iface_mock.hpp"
#include "can.hpp"
TEST(CanIOManager, CanDriverMock)
{

View File

@ -3,7 +3,7 @@
*/
#include <gtest/gtest.h>
#include "iface_mock.hpp"
#include "can.hpp"
static bool rxFrameEquals(const uavcan::CanRxFrame& rxframe, const uavcan::CanFrame& frame,

View File

@ -4,7 +4,7 @@
#include <gtest/gtest.h>
#include <uavcan/internal/transport/can_io.hpp>
#include "../../common.hpp"
#include "can.hpp"
static int getQueueLength(uavcan::CanTxQueue& queue)

View File

@ -5,7 +5,7 @@
#include <memory>
#include <gtest/gtest.h>
#include "transfer_test_helpers.hpp"
#include "can/iface_mock.hpp"
#include "can/can.hpp"
#include <uavcan/internal/transport/dispatcher.hpp>

View File

@ -5,7 +5,8 @@
#include <string>
#include <gtest/gtest.h>
#include <uavcan/internal/transport/transfer.hpp>
#include "../common.hpp"
#include "../../clock.hpp"
#include "can/can.hpp"
TEST(Transfer, TransferID)

View File

@ -5,7 +5,7 @@
#include <algorithm>
#include <gtest/gtest.h>
#include "transfer_test_helpers.hpp"
#include "can/iface_mock.hpp"
#include "can/can.hpp"
#include <uavcan/internal/transport/transfer_sender.hpp>

View File

@ -5,8 +5,8 @@
#include <gtest/gtest.h>
#include <uavcan/publisher.hpp>
#include <uavcan/mavlink/Message.hpp>
#include "common.hpp"
#include "transport/can/iface_mock.hpp"
#include "clock.hpp"
#include "internal/transport/can/can.hpp"
TEST(Publisher, Basic)

View File

@ -7,8 +7,8 @@
#include <uavcan/util/method_binder.hpp>
#include <uavcan/mavlink/Message.hpp>
#include <root_ns_a/EmptyMessage.hpp>
#include "common.hpp"
#include "transport/can/iface_mock.hpp"
#include "clock.hpp"
#include "internal/transport/can/can.hpp"
template <typename DataType>