9#define BOOST_TEST_DYN_LINK
10#define BOOST_TEST_MODULE RebotHeartbeatCountTest
12#include <boost/test/unit_test.hpp>
13using namespace boost::unit_test_framework;
19#include <boost/bind/bind.hpp>
20#include <boost/thread.hpp>
22using namespace boost::unit_test_framework;
27BOOST_AUTO_TEST_SUITE(RebotHeartbeatCountTestSuite)
36 d.
open(
"(rebot?ip=localhost&port=5001&map=mtcadummy_rebot.map)");
37 auto session = rebotServer.
session();
41 BOOST_CHECK_EQUAL(session->_helloCount, 1);
46 for(uint32_t i = 1; i < 5; ++i) {
47 d.
write(
"BOARD.WORD_USER", 42);
51 BOOST_CHECK_EQUAL(session->_helloCount, 1);
53 for(uint32_t i = 1; i < 5; ++i) {
55 BOOST_CHECK_EQUAL(session->_helloCount, i + 1);
58 for(uint32_t i = 1; i < 5; ++i) {
59 [[maybe_unused]]
auto result = d.
read<
int>(
"BOARD.WORD_USER");
63 BOOST_CHECK_EQUAL(session->_helloCount, 5);
65 for(uint32_t i = 1; i < 5; ++i) {
67 BOOST_CHECK_EQUAL(session->_helloCount, i + 5);
98 d.
open(
"(rebot?ip=localhost&port=5001&map=mtcadummy_rebot.map)");
104 std::cout <<
"test done" << std::endl;
119BOOST_AUTO_TEST_SUITE_END()
Class allows to read/write registers from device.
bool isOpened() const
Check if the device is currently opened.
void close()
Close the 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.
std::shared_ptr< RebotDummySession > session()
void waitForClientTestableMode()
void advance_until(boost::chrono::duration< Rep, Period > targetTimeRelativeMyEpoch)
BOOST_AUTO_TEST_CASE(testHeartbeat1)