4#define BOOST_TEST_DYN_LINK
5#define BOOST_TEST_MODULE RebotConnectionTimeoutTest
7#include <boost/test/unit_test.hpp>
8using namespace boost::unit_test_framework;
14#include <condition_variable>
25 std::this_thread::sleep_for(std::chrono::milliseconds(1));
40 uint32_t timeout_sec = 1;
41 auto accetable_completion_time = std::chrono::seconds(timeout_sec * 5);
43 "&map=mtcadummy_rebot.map&timeout=" +
std::to_string(timeout_sec) +
")");
47 auto begin = std::chrono::system_clock::now();
51 auto end = std::chrono::system_clock::now();
55 auto execution_duration = end - begin;
56 BOOST_CHECK(execution_duration < accetable_completion_time);
60 uint32_t timeout_sec = 1;
61 auto accetable_completion_time = std::chrono::seconds(timeout_sec * 5);
63 "&map=mtcadummy_rebot.map&timeout=" +
std::to_string(timeout_sec) +
")");
72 auto begin = std::chrono::system_clock::now();
76 auto end = std::chrono::system_clock::now();
80 auto execution_duration = end - begin;
81 BOOST_CHECK(execution_duration < accetable_completion_time);
85 uint32_t timeout_sec = 1;
86 auto accetable_completion_time = std::chrono::seconds(timeout_sec * 5);
88 "&map=mtcadummy_rebot.map&timeout=" +
std::to_string(timeout_sec) +
")");
95 auto begin = std::chrono::system_clock::now();
99 auto end = std::chrono::system_clock::now();
103 auto execution_duration = end - begin;
104 BOOST_CHECK(execution_duration < accetable_completion_time);
Class allows to read/write registers from device.
bool isFunctional() const
Return wether a device is working as intended, usually this means it is opened and does not have any ...
UserType read(const RegisterPath ®isterPathName, const AccessModeFlags &flags=AccessModeFlags({})) const
Inefficient convenience function to read a single-word register without obtaining an accessor.
void open(std::string const &aliasName)
Open a device by the given alias name from the DMAP file.
void write(const RegisterPath ®isterPathName, UserType value, const AccessModeFlags &flags=AccessModeFlags({}))
Inefficient convenience function to write a single-word register without obtaining an accessor.
Exception thrown when a runtime error has occured.
std::string to_string(const std::string &v)
RebotDummyServer rebotServer
boost::thread serverThread
BOOST_FIXTURE_TEST_CASE(testOpenConnection, F)