43#include <boost/date_time/posix_time/posix_time.hpp>
44#include <boost/test/unit_test.hpp>
55#define N_SIZE uint32_t(10*1024/4)
56#define TIMEOUT_MULTIPLIER 50
63void job_multiple (
const std::string& connection,
const std::string&
id,
const size_t timeout )
74 uint32_t
x =
static_cast<uint32_t
> ( rand() );
77 std::vector<uint32_t>
xx;
79 for (
size_t i=0; i!=
N_SIZE; ++i )
81 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
100 std::vector<std::shared_ptr<std::thread>> jobs;
105 jobs.emplace_back (
new std::thread(
job_multiple, connectionFileURI, deviceId, timeout) );
124 uint32_t
x =
static_cast<uint32_t
> ( rand() );
127 std::vector<uint32_t>
xx;
129 for (
size_t i=0; i!=
N_SIZE; ++i )
131 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
150 std::vector<std::shared_ptr<std::thread>> jobs;
154 jobs.emplace_back (
new std::thread( [&
hw] () {job_single(
hw);} ) );
169 uint32_t
x =
static_cast<uint32_t
> ( rand() );
172 std::vector<uint32_t>
xx;
174 for (
size_t i=0; i!=
N_SIZE; ++i )
176 xx.push_back (
static_cast<uint32_t
> ( 0xDEADBEEF ) );
193 HwInterface
hw = getHwInterface();
194 std::vector<std::shared_ptr<std::thread>> jobs;
198 jobs.emplace_back (
new std::thread ( [
hw] () {job_single_copied(
hw);} ) );
A class to open and manage XML connection files and wrap up the interfaces to the NodeTreeBuilder and...
HwInterface getDevice(const std::string &aId)
Retrieves protocol, host, and port from the connection file to create an IPbus Client Retrieves the a...
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.
void setTimeoutPeriod(const uint32_t &aTimeoutPeriod)
A method to modify the timeout period for any pending or future transactions.
ValWord< uint32_t > read() const
Read a single, unmasked, unsigned word.
ValHeader writeBlock(const std::vector< uint32_t > &aValues) const
Write a block of data to a block of registers or a block-write port.
ValHeader write(const uint32_t &aValue) const
Write a single, unmasked word to a register.
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.
bool valid()
Return whether the Validated memory is marked as valid.
std::size_t size() const
Return the size of the underlying memory.
bool valid()
Return whether the Validated memory is marked as valid.
iterator iter(handle obj)
BOOST_CHECK_EQUAL(mem.size(), N)
BOOST_CHECK_NO_THROW(hw.getNode("REG").writeBlock(xx))
ValVector< uint32_t > mem
BOOST_CHECK(!mem.valid())
std::vector< uint32_t > xx
void job_multiple(const std::string &connection, const std::string &id, const size_t timeout)
_Integer< T, IntFmt<> > Integer(const T &aT)
Forward declare a function which creates an instance of the ultra-lightweight wrapper from an integer...
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
#define TIMEOUT_MULTIPLIER
#define UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(test_suite_name, test_case_name, test_fixture, test_case_contents)