41#include <boost/test/unit_test.hpp>
53#define N_1MB 1024*1024/4
54#define N_10MB 10*1024*1024/4
55#define N_200MB 100*1024*1024/4
63 std::vector<size_t> lDepths;
65 lDepths.push_back(
N_4B);
66 lDepths.push_back(
N_1kB);
67 lDepths.push_back(10 *
N_1kB);
68 lDepths.push_back(100 *
N_1kB);
69 lDepths.push_back(
N_1MB);
73 for (std::vector<size_t>::iterator lIt=lDepths.begin(); lIt != lDepths.end(); ) {
74 if ((*lIt) > aMaxSize)
75 lIt = lDepths.erase(lIt);
87 for(
size_t i=0; i<lDepths.size(); i++) {
88 const size_t N = lDepths.at(i);
89 BOOST_TEST_MESSAGE(
" N = " << N);
93 std::vector<uint32_t>
xx;
95 for (
size_t i=0; i!= N; ++i )
97 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
117 std::vector< uint32_t >::const_iterator
j=
xx.begin();
135 for(
size_t i=0; i<lDepths.size(); i++) {
136 const size_t N = lDepths.at(i);
137 BOOST_TEST_MESSAGE(
" N = " << N);
141 std::vector<uint32_t>
xx;
144 for (
size_t i=0; i!= N; ++i )
146 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
171 for(
size_t i=0; i<lDepths.size(); i++) {
172 const size_t N = lDepths.at(i);
173 BOOST_TEST_MESSAGE(
" N = " << N);
177 std::vector<uint32_t>
xx;
179 std::vector<uint32_t> yy;
181 for (
size_t i=0; i!= N; ++i )
183 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
184 yy.push_back (
static_cast<uint32_t
> ( rand() ) );
225 std::vector< uint32_t >::const_iterator
j=
xx.begin();
249 std::vector<uint32_t>
xx;
274 std::vector<uint32_t>
xx;
285 std::vector<uint32_t>
xx;
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
const Node & getNode() const
Retrieve the top-level node.
void dispatch()
Make the IPbus client issue a dispatch.
ValHeader writeBlockOffset(const std::vector< uint32_t > &aValues, const uint32_t &aOffset) const
Write a block of data to a block of registers or a block-write port.
ValHeader writeBlock(const std::vector< uint32_t > &aValues) const
Write a block of data to a block of registers or a block-write port.
ValVector< uint32_t > readBlockOffset(const uint32_t &aSize, const uint32_t &aOffset) const
Read a block of unsigned data from a block of registers or a block-read port.
ValVector< uint32_t > readBlock(const uint32_t &aSize) const
Read a block of unsigned data from a block of registers or a block-read port.
const_iterator begin() const
If the memory has previously been marked as valid, return a const iterator to the beginning of the un...
bool valid()
Return whether the Validated memory is marked as valid.
const T & at(std::size_t aIndex) const
If the memory has previously been marked as valid, give random access into memory.
const_iterator end() const
If the memory has previously been marked as valid, return a const iterator to the end (one past last ...
std::size_t size() const
Return the size of the underlying memory.
std::vector< T > value() const
Return the value of the validated memory with check on validity.
BOOST_CHECK_THROW(hw.getNode("REG").writeBlockOffset(xx, 0), uhal::exception::BulkTransferOffsetRequestedForSingleRegister)
BOOST_CHECK_EQUAL(mem.size(), N)
std::vector< uint32_t >::const_iterator j
block_access_type_violations
BOOST_CHECK_NO_THROW(hw.getNode("REG").writeBlock(xx))
ValVector< uint32_t > mem
BOOST_CHECK(!mem.valid())
block_offset_bigger_than_size_attribute
std::vector< uint32_t > xx
std::vector< size_t > getBlockUnitTestDepths(const size_t aMaxSize)
bool correct_block_write_read
#define UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(test_suite_name, test_case_name, test_fixture, test_case_contents)