4 #define BOOST_TEST_DYN_LINK
5 #define BOOST_TEST_MODULE testRebotBackendCreation
6 #include <boost/test/unit_test.hpp>
7 using namespace boost::unit_test_framework;
27 std::string dmapPath{
"./dummies.dmap"};
28 if(framework::master_test_suite().argc > 1) {
29 dmapPath = framework::master_test_suite().argv[1];
32 std::string port{
"5001"};
33 if(framework::master_test_suite().argc > 2) {
34 port = framework::master_test_suite().argv[2];
47 rebotDevice.
open(
"mskrebot");
52 rebotDevice2.
open(
"mskrebot");
55 rebotDevice.
write<
double>(
"BOARD/WORD_USER", 48);
62 secondDevice.
open(
"(rebot?ip=localhost&port=" + port +
"&map=mtcadummy_rebot.map)");
63 BOOST_CHECK(secondDevice.
read<
double>(
"BOARD/WORD_USER") == 48);
68 thirdDevice.
open(
"(rebot?ip=localhost&port=" + port +
")");
80 fourthDevice.
open(
"REBOT_DOUBLEMAP");
81 BOOST_CHECK(fourthDevice.
read<
double>(
"BOARD/WORD_USER") == 48);
87 BOOST_AUTO_TEST_SUITE_END()
90 std::vector<int32_t> dataToWrite({2, 3, 100, 20});
95 BOOST_CHECK_EQUAL(rebotDevice.read<uint32_t>(
"BOARD/WORD_COMPILATION"), 0xDEADBEEF);
100 rebotDevice.write(
"ADC/WORD_CLK_MUX", dataToWrite);
101 BOOST_CHECK(rebotDevice.read<
int>(
"ADC/WORD_CLK_MUX", 4) == dataToWrite);
104 auto acc1 = rebotDevice.getScalarRegisterAccessor<int32_t>(
"ADC/WORD_CLK_MUX", 2);
106 BOOST_CHECK_EQUAL(dataToWrite[2],
static_cast<int32_t
>(acc1));
109 acc1 = dataToWrite[0];
113 BOOST_CHECK_EQUAL(dataToWrite[0],
static_cast<int32_t
>(acc1));
116 auto acc2 = rebotDevice.getOneDRegisterAccessor<int32_t>(
"ADC/WORD_CLK_MUX", 2, 1);
117 acc2 = std::vector<int32_t>({676, 9987});
119 acc2 = std::vector<int32_t>({0, 0});
121 BOOST_CHECK_EQUAL(acc2[0], 676);
122 BOOST_CHECK_EQUAL(acc2[1], 9987);
125 auto testArea = rebotDevice.getOneDRegisterAccessor<int32_t>(
"ADC/TEST_AREA");
126 for(
int i = 0; i < 10; ++i) {
131 for(
int i = 0; i < 10; ++i) {
132 BOOST_CHECK_EQUAL(testArea[i], i);