9 #define BOOST_TEST_DYN_LINK
10 #define BOOST_TEST_MODULE RebotHeartbeatCountTest
12 #include <boost/test/unit_test.hpp>
13 using namespace boost::unit_test_framework;
19 #include <boost/bind/bind.hpp>
20 #include <boost/thread.hpp>
22 using namespace boost::unit_test_framework;
27 BOOST_AUTO_TEST_SUITE(RebotHeartbeatCountTestSuite)
33 boost::thread serverThread(boost::bind(&RebotDummyServer::start, boost::ref(rebotServer)));
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;
105 RebotSleepSynchroniser::_lock.unlock();
119 BOOST_AUTO_TEST_SUITE_END()