ChimeraTK-DeviceAccess  03.18.00
testTransferElement.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "DeviceBackendImpl.h"
#include "NDRegisterAccessor.h"
#include "NDRegisterAccessorDecorator.h"
#include "TransferElementTestAccessor.h"
#include <boost/make_shared.hpp>
+ Include dependency graph for testTransferElement.cpp:

Go to the source code of this file.

Macros

#define BOOST_TEST_DYN_LINK
 
#define BOOST_TEST_MODULE   TransferElementTest
 
#define TEST_TRANSFER_SEQUENCE(transferElement, expectedType, expectTransferExecution)
 Helper macro for test_B_4 to avoid code duplication. More...
 

Functions

 BOOST_AUTO_TEST_CASE (B_3_1_2_4)
 Test the return values of readNonBlocking()/readLatest() for synchronous reads. More...
 
 BOOST_AUTO_TEST_CASE (test_B_3_1_3_1)
 Test read() blocks until data available. More...
 
 BOOST_AUTO_TEST_CASE (test_B_3_1_3_2)
 Test readNonBlocking() returns data availability. More...
 
 BOOST_AUTO_TEST_CASE (B_3_1_4)
 Test the convenience function readLatest(). More...
 
 BOOST_AUTO_TEST_CASE (test_B_4)
 Test order of stages in high-level functions. More...
 
 BOOST_AUTO_TEST_CASE (test_B_4_1)
 Test preXxx. More...
 
 BOOST_AUTO_TEST_CASE (test_B_4_2_1)
 Test readTransfer() More...
 
 BOOST_AUTO_TEST_CASE (test_B_4_2_2)
 Test readTransferNonBlocking() More...
 
 BOOST_AUTO_TEST_CASE (test_B_4_2_3)
 Test writeTransfer()/writeTransferDestructively() More...
 
 BOOST_AUTO_TEST_CASE (test_B_4_3)
 Test postXxx. More...
 
 BOOST_AUTO_TEST_CASE (B_4_3_2)
 Test that the current VersionNumber is updated in postWrite. More...
 
 BOOST_AUTO_TEST_CASE (test_B_5_1)
 Test pre/post paring for exceptions. More...
 
 BOOST_AUTO_TEST_CASE (test_B_5_2)
 Test that duplicate calls to preXxx/postXxx are ignored. More...
 
 BOOST_AUTO_TEST_CASE (test_B_6_1)
 Test skipping transfer if exception in preXxx() More...
 
 BOOST_AUTO_TEST_CASE (test_B_6_2)
 Test xxxYyy() catches exceptions, not preXxx()/xxxTransferYyy() (outermost decorator sees exception) More...
 
 BOOST_AUTO_TEST_CASE (test_B_7_2)
 Test return of writeTransfer and writeTransferDestructively. More...
 
 BOOST_AUTO_TEST_CASE (test_B_7_3)
 Test updateBuffer argument in postRead without exceptions. More...
 
 BOOST_AUTO_TEST_CASE (test_B_7_4)
 Test postRead updateDataBuffer argument in case of exceptions. More...
 
 BOOST_AUTO_TEST_CASE (B_8_2)
 Test the _readQueue access in read()/readNonBlocking() More...
 
 BOOST_AUTO_TEST_CASE (B_8_2_2)
 Test the DiscadValueException in async read operations. More...
 
 BOOST_AUTO_TEST_CASE (B_8_3)
 Test exceptions on _readQueue in readTransfer()/readTransferNonBlocking() More...
 
 BOOST_AUTO_TEST_CASE (B_8_6_1)
 Test interrupt() places boost::thread_interrupted exception onto _readQueue. More...
 
 BOOST_AUTO_TEST_CASE (B_8_6_2)
 Test interrupt() interrupts any read operation. More...
 
 BOOST_AUTO_TEST_CASE (test_B_8_6_3)
 Test pre/post paring for interrupt() More...
 
 BOOST_AUTO_TEST_CASE (test_B_8_6_4)
 Test normal functioning after interrupt() More...
 
 BOOST_AUTO_TEST_CASE (test_B_11_3)
 Test getVersionNumber() More...
 
 BOOST_AUTO_TEST_CASE (B_11_4_1)
 Test write with older version number throws. More...
 
 BOOST_AUTO_TEST_CASE (B_11_4_2)
 Test VersionNumber argument of doPreWrite and doWriteTransfer. More...
 
 BOOST_AUTO_TEST_CASE (test_B_11_5)
 Test getVersionNumber() does not change under exception in a write opreration (for reads this must be checked in the UnifiedBackendTest). More...
 
 BOOST_AUTO_TEST_CASE (test_B_11_6)
 Test value after construction for the version number. More...
 
 BOOST_AUTO_TEST_CASE (test_B_15_2)
 Test getAccessModeFlags() More...
 
 BOOST_AUTO_TEST_CASE (test_B_15_3)
 Test access mode flags via constructor. More...
 
 BOOST_AUTO_TEST_CASE (test_B_15_3_1)
 Test TransferElement has no default constructor. More...
 
 BOOST_AUTO_TEST_CASE (test_B_16_1)
 Test _activeException. More...
 
 BOOST_AUTO_TEST_CASE (test_B_16_2)
 Test exception rethrowing in postXxx() More...
 
 BOOST_AUTO_TEST_CASE (test_B_16_3)
 Test setActiveException() More...
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 19 of file testTransferElement.cpp.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   TransferElementTest

Definition at line 20 of file testTransferElement.cpp.

◆ TEST_TRANSFER_SEQUENCE

#define TEST_TRANSFER_SEQUENCE (   transferElement,
  expectedType,
  expectTransferExecution 
)

Helper macro for test_B_4 to avoid code duplication.

Do not use for other tests.

Definition at line 152 of file testTransferElement.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/36]

BOOST_AUTO_TEST_CASE ( B_11_4_1  )

Test write with older version number throws.

Definition at line 1210 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/36]

BOOST_AUTO_TEST_CASE ( B_11_4_2  )

Test VersionNumber argument of doPreWrite and doWriteTransfer.

Definition at line 1227 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/36]

BOOST_AUTO_TEST_CASE ( B_3_1_2_4  )

Test the return values of readNonBlocking()/readLatest() for synchronous reads.

Definition at line 39 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/36]

BOOST_AUTO_TEST_CASE ( B_3_1_4  )

Test the convenience function readLatest().

This tests the TransferElement specifications:

Definition at line 106 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/36]

BOOST_AUTO_TEST_CASE ( B_4_3_2  )

Test that the current VersionNumber is updated in postWrite.

Definition at line 445 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/36]

BOOST_AUTO_TEST_CASE ( B_8_2  )

Test the _readQueue access in read()/readNonBlocking()

Actually: this tests the access specifically in readTransfer()/readTransferNonBlocking(). The spec should be changed accordingly...

Definition at line 974 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/36]

BOOST_AUTO_TEST_CASE ( B_8_2_2  )

Test the DiscadValueException in async read operations.

Definition at line 1002 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/36]

BOOST_AUTO_TEST_CASE ( B_8_3  )

Test exceptions on _readQueue in readTransfer()/readTransferNonBlocking()

Definition at line 1033 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/36]

BOOST_AUTO_TEST_CASE ( B_8_6_1  )

Test interrupt() places boost::thread_interrupted exception onto _readQueue.

Definition at line 1074 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/36]

BOOST_AUTO_TEST_CASE ( B_8_6_2  )

Test interrupt() interrupts any read operation.

Definition at line 1087 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/36]

BOOST_AUTO_TEST_CASE ( test_B_11_3  )

Test getVersionNumber()

Definition at line 1176 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [12/36]

BOOST_AUTO_TEST_CASE ( test_B_11_5  )

Test getVersionNumber() does not change under exception in a write opreration (for reads this must be checked in the UnifiedBackendTest).

Definition at line 1253 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [13/36]

BOOST_AUTO_TEST_CASE ( test_B_11_6  )

Test value after construction for the version number.

Notes:

  • B.11.6 might be screwed up by implementations and hence needs to be tested in the UnifiedBackendTest as well.

Definition at line 1299 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [14/36]

BOOST_AUTO_TEST_CASE ( test_B_15_2  )

Test getAccessModeFlags()

Definition at line 1310 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [15/36]

BOOST_AUTO_TEST_CASE ( test_B_15_3  )

Test access mode flags via constructor.

Definition at line 1332 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [16/36]

BOOST_AUTO_TEST_CASE ( test_B_15_3_1  )

Test TransferElement has no default constructor.

Definition at line 1357 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [17/36]

BOOST_AUTO_TEST_CASE ( test_B_16_1  )

Test _activeException.

Definition at line 1367 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/36]

BOOST_AUTO_TEST_CASE ( test_B_16_2  )

Test exception rethrowing in postXxx()

Definition at line 1440 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [19/36]

BOOST_AUTO_TEST_CASE ( test_B_16_3  )

Test setActiveException()

  • B.16.3 (only setActiveException())

Definition at line 1488 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [20/36]

BOOST_AUTO_TEST_CASE ( test_B_3_1_3_1  )

Test read() blocks until data available.

Definition at line 58 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [21/36]

BOOST_AUTO_TEST_CASE ( test_B_3_1_3_2  )

Test readNonBlocking() returns data availability.

Definition at line 81 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [22/36]

BOOST_AUTO_TEST_CASE ( test_B_4  )

Test order of stages in high-level functions.

  • B.4 (just the order of the stages)

Definition at line 211 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [23/36]

BOOST_AUTO_TEST_CASE ( test_B_4_1  )

Test preXxx.

Definition at line 260 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [24/36]

BOOST_AUTO_TEST_CASE ( test_B_4_2_1  )

Test readTransfer()

Definition at line 302 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [25/36]

BOOST_AUTO_TEST_CASE ( test_B_4_2_2  )

Test readTransferNonBlocking()

Definition at line 337 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [26/36]

BOOST_AUTO_TEST_CASE ( test_B_4_2_3  )

Test writeTransfer()/writeTransferDestructively()

Definition at line 370 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [27/36]

BOOST_AUTO_TEST_CASE ( test_B_4_3  )

Test postXxx.

Definition at line 399 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [28/36]

BOOST_AUTO_TEST_CASE ( test_B_5_1  )

Test pre/post paring for exceptions.

Definition at line 463 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [29/36]

BOOST_AUTO_TEST_CASE ( test_B_5_2  )

Test that duplicate calls to preXxx/postXxx are ignored.

Definition at line 593 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [30/36]

BOOST_AUTO_TEST_CASE ( test_B_6_1  )

Test skipping transfer if exception in preXxx()

Definition at line 630 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [31/36]

BOOST_AUTO_TEST_CASE ( test_B_6_2  )

Test xxxYyy() catches exceptions, not preXxx()/xxxTransferYyy() (outermost decorator sees exception)

Definition at line 716 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [32/36]

BOOST_AUTO_TEST_CASE ( test_B_7_2  )

Test return of writeTransfer and writeTransferDestructively.

Definition at line 837 of file testTransferElement.cpp.

◆ BOOST_AUTO_TEST_CASE() [33/36]

BOOST_AUTO_TEST_CASE ( test_B_7_3  )

Test updateBuffer argument in postRead without exceptions.

Definition at line 883 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [34/36]

BOOST_AUTO_TEST_CASE ( test_B_7_4  )

Test postRead updateDataBuffer argument in case of exceptions.

Definition at line 920 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [35/36]

BOOST_AUTO_TEST_CASE ( test_B_8_6_3  )

Test pre/post paring for interrupt()

Definition at line 1128 of file testTransferElement.cpp.

+ Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [36/36]

BOOST_AUTO_TEST_CASE ( test_B_8_6_4  )

Test normal functioning after interrupt()

Definition at line 1150 of file testTransferElement.cpp.

+ Here is the call graph for this function: