ChimeraTK-DeviceAccess 03.27.00
Loading...
Searching...
No Matches
testSubdeviceBackendRegisterWindow.cpp File Reference
#include "Device.h"
#include "DummyBackend.h"
#include "DummyRegisterAccessor.h"
#include <boost/thread/barrier.hpp>
#include <thread>
#include <boost/test/unit_test.hpp>
+ Include dependency graph for testSubdeviceBackendRegisterWindow.cpp:

Go to the source code of this file.

Macros

#define BOOST_TEST_DYN_LINK
 
#define BOOST_TEST_MODULE   SubdeviceBackendTest
 
#define BOOST_NO_EXCEPTIONS
 
#define CHECK_TIMEOUT(execPreCheck, condition, maxMilliseconds)
 

Functions

 BOOST_AUTO_TEST_CASE (test3regsScalar)
 
 BOOST_AUTO_TEST_CASE (test3regsArray)
 
 BOOST_AUTO_TEST_CASE (test3regsByteOffset1)
 
 BOOST_AUTO_TEST_CASE (test2regsScalar)
 
 BOOST_AUTO_TEST_CASE (TestMutex)
 Test that the mutual exclusion is working on accessors from two different backend instances which both use the same busy register.
 

Macro Definition Documentation

◆ BOOST_NO_EXCEPTIONS

#define BOOST_NO_EXCEPTIONS

Definition at line 14 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 12 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   SubdeviceBackendTest

Definition at line 13 of file testSubdeviceBackendRegisterWindow.cpp.

◆ CHECK_TIMEOUT

#define CHECK_TIMEOUT (   execPreCheck,
  condition,
  maxMilliseconds 
)
Value:
{ \
std::chrono::steady_clock::time_point t0 = std::chrono::steady_clock::now(); \
execPreCheck while(!(condition)) { \
bool timeout_reached = (std::chrono::steady_clock::now() - t0) > std::chrono::milliseconds(maxMilliseconds); \
BOOST_CHECK(!timeout_reached); \
if(timeout_reached) break; \
usleep(1000); \
execPreCheck \
} \
}

Definition at line 21 of file testSubdeviceBackendRegisterWindow.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( test2regsScalar  )

Definition at line 228 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( test3regsArray  )
Todo:
Make a proper test with a custom backend, to make sure all elements of the array are properly written

Definition at line 85 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( test3regsByteOffset1  )

Definition at line 126 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( test3regsScalar  )

Definition at line 37 of file testSubdeviceBackendRegisterWindow.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( TestMutex  )

Test that the mutual exclusion is working on accessors from two different backend instances which both use the same busy register.

Definition at line 296 of file testSubdeviceBackendRegisterWindow.cpp.