#include "uhal/uhal.hpp"
#include "uhal/tests/definitions.hpp"
#include "uhal/tests/fixtures.hpp"
#include "uhal/tests/tools.hpp"
#include "uhal/log/log.hpp"
#include <boost/thread.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <cstdlib>
#include <typeinfo>
#include <sys/time.h>
Go to the source code of this file.
|
void | uhal::tests::job_multiple (const std::string &connection, const std::string &id, const size_t timeout) |
|
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, multiple_hwinterfaces, DummyHardwareFixture, { std::vector< boost::thread * > jobs;for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs.push_back(new boost::thread(job_multiple, connectionFileURI, deviceId, timeout));} for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs[i]->join();delete jobs[i];} log(Warning(), ThisLocation());}) void job_single(HwInterface &hw) |
|
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, single_hwinterface, DummyHardwareFixture, { for(size_t iter=0;iter!=N_ITERATIONS ;++iter) { HwInterface hw=getHwInterface();std::vector< boost::thread * > jobs;for(size_t i=0;i!=N_THREADS;++i) { jobs.push_back(new boost::thread(job_single, hw));} for(size_t i=0;i!=N_THREADS;++i) { jobs[i]->join();delete jobs[i];} } }) void job_single_copied(HwInterface hw) |
|
◆ N_ITERATIONS
◆ N_SIZE
#define N_SIZE uint32_t(10*1024/4) |
◆ N_THREADS
◆ TIMEOUT_MULTIPLIER
#define TIMEOUT_MULTIPLIER 50 |