Functions | Variables
transfer_buffer.cpp File Reference
#include <algorithm>
#include <gtest/gtest.h>
#include <memory>
#include <uavcan/transport/transfer_buffer.hpp>
Include dependency graph for transfer_buffer.cpp:

Go to the source code of this file.

Functions

template<typename T , unsigned Size>
static bool allEqual (const T(&a)[Size])
 
template<typename T , unsigned Size, typename R >
static void fill (T(&a)[Size], R value)
 
static int fillTestData (const std::string &data, uavcan::ITransferBuffer *tbb)
 
static bool matchAgainst (const std::string &data, const uavcan::ITransferBuffer &tbb, unsigned offset=0, int len=-1)
 
static bool matchAgainstTestData (const uavcan::ITransferBuffer &tbb, unsigned offset, int len=-1)
 
 TEST (StaticTransferBuffer, Basic)
 
 TEST (TransferBuffer, TestDataValidation)
 
 TEST (TransferBufferManager, Basic)
 
 TEST (TransferBufferManager, TestDataValidation)
 
 TEST (TransferBufferManagerEntry, Basic)
 

Variables

static const int MGR_MAX_BUFFER_SIZE = 100
 
static const std::string MGR_TEST_DATA [4]
 
static const int TEST_BUFFER_SIZE = 200
 
static const std::string TEST_DATA
 

Function Documentation

◆ allEqual()

template<typename T , unsigned Size>
static bool allEqual ( const T(&)  a[Size])
static

Definition at line 22 of file transfer_buffer.cpp.

◆ fill()

template<typename T , unsigned Size, typename R >
static void fill ( T(&)  a[Size],
value 
)
static

Definition at line 30 of file transfer_buffer.cpp.

◆ fillTestData()

static int fillTestData ( const std::string &  data,
uavcan::ITransferBuffer tbb 
)
static

Definition at line 225 of file transfer_buffer.cpp.

◆ matchAgainst()

static bool matchAgainst ( const std::string &  data,
const uavcan::ITransferBuffer tbb,
unsigned  offset = 0,
int  len = -1 
)
static

Definition at line 38 of file transfer_buffer.cpp.

◆ matchAgainstTestData()

static bool matchAgainstTestData ( const uavcan::ITransferBuffer tbb,
unsigned  offset,
int  len = -1 
)
static

Definition at line 73 of file transfer_buffer.cpp.

◆ TEST() [1/5]

TEST ( StaticTransferBuffer  ,
Basic   
)

Definition at line 88 of file transfer_buffer.cpp.

◆ TEST() [2/5]

TEST ( TransferBuffer  ,
TestDataValidation   
)

Definition at line 78 of file transfer_buffer.cpp.

◆ TEST() [3/5]

TEST ( TransferBufferManager  ,
Basic   
)

Definition at line 230 of file transfer_buffer.cpp.

◆ TEST() [4/5]

TEST ( TransferBufferManager  ,
TestDataValidation   
)

Definition at line 216 of file transfer_buffer.cpp.

◆ TEST() [5/5]

TEST ( TransferBufferManagerEntry  ,
Basic   
)

Definition at line 133 of file transfer_buffer.cpp.

Variable Documentation

◆ MGR_MAX_BUFFER_SIZE

const int MGR_MAX_BUFFER_SIZE = 100
static

Definition at line 214 of file transfer_buffer.cpp.

◆ MGR_TEST_DATA

const std::string MGR_TEST_DATA[4]
static
Initial value:
=
{
"I thought you would cry out again \'don\'t speak of it, leave off.\'\" Raskolnikov gave a laugh, but rather a "
"forced one. \"What, silence again?\" he asked a minute later. \"We must talk about something, you know. ",
"It would be interesting for me to know how you would decide a certain \'problem\' as Lebeziatnikov would say.\" "
"(He was beginning to lose the thread.) \"No, really, I am serious. Imagine, Sonia, that you had known all ",
"Luzhin\'s intentions beforehand. Known, that is, for a fact, that they would be the ruin of Katerina Ivanovna "
"and the children and yourself thrown in--since you don\'t count yourself for anything--Polenka too... for ",
"she\'ll go the same way. Well, if suddenly it all depended on your decision whether he or they should go on "
"living, that is whether Luzhin should go on living and doing wicked things, or Katerina Ivanovna should die? "
"How would you decide which of them was to die? I ask you?"
}

Definition at line 198 of file transfer_buffer.cpp.

◆ TEST_BUFFER_SIZE

const int TEST_BUFFER_SIZE = 200
static

Definition at line 86 of file transfer_buffer.cpp.

◆ TEST_DATA

const std::string TEST_DATA
static
Initial value:
=
"It was like this: I asked myself one day this question - what if Napoleon, for instance, had happened to be in my "
"place, and if he had not had Toulon nor Egypt nor the passage of Mont Blanc to begin his career with, but "
"instead of all those picturesque and monumental things, there had simply been some ridiculous old hag, a "
"pawnbroker, who had to be murdered too to get money from her trunk (for his career, you understand). "
"Well, would he have brought himself to that if there had been no other means?"

Definition at line 14 of file transfer_buffer.cpp.



uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:03