ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Files | Classes | Functions

OCM data acquisition library tests. More...

Files

file  dpmClient.cpp
 daq::DpmClient
 
file  dpmClient.hpp
 daq::DpmClient
 
file  dpmClientMock.hpp
 daq::DpmClient
 
file  statusObserver.hpp
 
file  testAsyncOpAbort.cpp
 Unit test for op::AbortAsync.
 
file  testAsyncOpAwaitPrim.cpp
 Unit test for op::AwaitPrimAsync.
 
file  testAsyncOpAwaitState.cpp
 Unit test for op::AwaitStateAsync.
 
file  testAsyncOpBase.cpp
 Definition of TestAsyncOpBase.
 
file  testAsyncOpBase.hpp
 Contains declaration for async operations shared base class.
 
file  testAsyncOpStart.cpp
 Unit test for op::StartAsync.
 
file  testAsyncOpStop.cpp
 Unit test for daq::op::StopAsync.
 
file  testConfigManager.cpp
 Test log4cplus helpers.
 
file  testDaqContext.cpp
 Test daq::Status and daq::ObservableStatus.
 
file  testDpmDaqController.cpp
 Unit test for daq::DpmDaqController
 
file  testDpPart.cpp
 Unit test for daq::DpPart
 
file  testEventLog.cpp
 Unit test for types declared in daq/event.hpp.
 
file  testEventLogObserver.cpp
 Unit test for types declared in daq/eventLogObserverLogger.hpp.
 
file  testException.cpp
 Exception test.
 
file  testLog4cplus.cpp
 Test log4cplus helpers.
 
file  testManager.cpp
 daq::ManagerImpl tests
 
file  testOcmDaqController.cpp
 Unit test for daq::OcmDaqController
 
file  testPendingReplies.cpp
 Tests for PendingReplies and related.
 
file  testSource.cpp
 Test daq::Source and related.
 
file  testState.cpp
 Test State functions.
 
file  testStatus.cpp
 Test daq::Status and daq::ObservableStatus.
 
file  utils.hpp
 Defines shared test utilities.
 

Classes

struct  StatusObserverMock
 Simple observer used for testing. More...
 
struct  TestAsyncOpAbort
 
struct  TestAsyncOpAwaitPrim
 
struct  TestAsyncOpAwaitState
 
struct  TestAsyncOpBase
 Base fixture for async operation tests. More...
 
struct  TestAsyncOpStart
 
struct  TestAsyncOpStop
 Note: TestAsyncOpBase set. More...
 
class  daq::TestDpmDaqController
 Fixture for daq::DaqController life cycle tests. More...
 
class  TestManagerImplLifecycle
 
class  TestManagerImpl
 
class  TestOcmDaqControllerLifeCycle
 Fixture for daq::DaqController life cycle tests. More...
 
struct  TestState
 Developer notes: OcmDaqController use boost::when_all to compose futures. More...
 
class  TestPendingReplies
 Test fixture for PendingReplies tests. More...
 
class  daq::TestSource
 Test fixture for source tests. More...
 
class  TestObservableStatus
 ObservableStatus test fixture. More...
 

Functions

template<class Future = void>
void MakeTestProgress (boost::asio::io_context &io_ctx, Future *fut=nullptr)
 Test helper that progress the test by executing pending jobs and optionally wait for a future to be ready. More...
 
template<class Future = void>
void daq::test::MakeTestProgress (boost::asio::io_context &io_ctx, Future *fut=nullptr)
 Test helper that progress the test by executing pending jobs and optionally wait for a future to be ready. More...
 

Detailed Description

OCM data acquisition library tests.


Class Documentation

◆ StatusObserverMock

struct StatusObserverMock

Simple observer used for testing.

Definition at line 22 of file statusObserver.hpp.

Public Member Functions

 MOCK_METHOD1 (CallOperator, void(daq::ObservableStatus const &))
 
void operator() (daq::ObservableStatus const &s)
 

Member Function Documentation

◆ MOCK_METHOD1()

StatusObserverMock::MOCK_METHOD1 ( CallOperator  ,
void(daq::ObservableStatus const &)   
)

◆ operator()()

void StatusObserverMock::operator() ( daq::ObservableStatus const &  s)
inline

Definition at line 24 of file statusObserver.hpp.

◆ TestAsyncOpAbort

struct TestAsyncOpAbort

Definition at line 27 of file testAsyncOpAbort.cpp.

+ Inheritance diagram for TestAsyncOpAbort:

Additional Inherited Members

- Public Member Functions inherited from TestAsyncOpBase
 TestAsyncOpBase ()
 
void SetUp () override
 
void TearDown () override
 
template<class SourceType >
std::vector< daq::Source< SourceType > > MakeSources (std::vector< SourceType > sources)
 
daq::op::AsyncOpParams MakeParams ()
 
- Public Attributes inherited from TestAsyncOpBase
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client
 
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client2
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client2
 
boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
log4cplus::Logger m_logger
 
std::string m_id
 
StatusObserverMock m_observer
 
std::shared_ptr< daq::ObservableStatusm_status
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
daq::op::AlertState m_alerts
 
std::shared_ptr< daq::PendingRepliesm_pending_replies
 
std::vector< daq::Source< daq::PrimSource > > m_prim_sources
 
std::vector< daq::Source< daq::MetaSource > > m_meta_sources
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise1
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise2
 
boost::promise< std::string > m_string_promise1
 
boost::promise< std::string > m_string_promise2
 

◆ TestAsyncOpAwaitPrim

struct TestAsyncOpAwaitPrim

Definition at line 165 of file testAsyncOpAwaitPrim.cpp.

+ Inheritance diagram for TestAsyncOpAwaitPrim:

Public Member Functions

std::shared_ptr< recif::RecWaitStatus > MakeWaitNotCompletedStatus ()
 
std::shared_ptr< recif::RecWaitStatus > MakeWaitCompletedStatus ()
 
daq::op::AwaitOpParams MakeAwaitOpParams ()
 
- Public Member Functions inherited from TestAsyncOpBase
 TestAsyncOpBase ()
 
void SetUp () override
 
void TearDown () override
 
template<class SourceType >
std::vector< daq::Source< SourceType > > MakeSources (std::vector< SourceType > sources)
 
daq::op::AsyncOpParams MakeParams ()
 

Additional Inherited Members

- Public Attributes inherited from TestAsyncOpBase
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client
 
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client2
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client2
 
boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
log4cplus::Logger m_logger
 
std::string m_id
 
StatusObserverMock m_observer
 
std::shared_ptr< daq::ObservableStatusm_status
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
daq::op::AlertState m_alerts
 
std::shared_ptr< daq::PendingRepliesm_pending_replies
 
std::vector< daq::Source< daq::PrimSource > > m_prim_sources
 
std::vector< daq::Source< daq::MetaSource > > m_meta_sources
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise1
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise2
 
boost::promise< std::string > m_string_promise1
 
boost::promise< std::string > m_string_promise2
 

Member Function Documentation

◆ MakeAwaitOpParams()

daq::op::AwaitOpParams TestAsyncOpAwaitPrim::MakeAwaitOpParams ( )
inline

Definition at line 183 of file testAsyncOpAwaitPrim.cpp.

◆ MakeWaitCompletedStatus()

std::shared_ptr<recif::RecWaitStatus> TestAsyncOpAwaitPrim::MakeWaitCompletedStatus ( )
inline

Definition at line 173 of file testAsyncOpAwaitPrim.cpp.

◆ MakeWaitNotCompletedStatus()

std::shared_ptr<recif::RecWaitStatus> TestAsyncOpAwaitPrim::MakeWaitNotCompletedStatus ( )
inline

Definition at line 166 of file testAsyncOpAwaitPrim.cpp.

◆ TestAsyncOpAwaitState

struct TestAsyncOpAwaitState

Definition at line 28 of file testAsyncOpAwaitState.cpp.

+ Inheritance diagram for TestAsyncOpAwaitState:

Public Member Functions

 TestAsyncOpAwaitState ()=default
 
void SetUp () override
 
void TearDown () override
 

Public Attributes

boost::asio::io_context m_io_ctx
 
std::shared_ptr< daq::ObservableStatusm_status
 
log4cplus::Logger m_logger
 

Constructor & Destructor Documentation

◆ TestAsyncOpAwaitState()

TestAsyncOpAwaitState::TestAsyncOpAwaitState ( )
default

Member Function Documentation

◆ SetUp()

void TestAsyncOpAwaitState::SetUp ( )
inlineoverride

Definition at line 31 of file testAsyncOpAwaitState.cpp.

◆ TearDown()

void TestAsyncOpAwaitState::TearDown ( )
inlineoverride

Definition at line 35 of file testAsyncOpAwaitState.cpp.

Member Data Documentation

◆ m_io_ctx

boost::asio::io_context TestAsyncOpAwaitState::m_io_ctx

Definition at line 37 of file testAsyncOpAwaitState.cpp.

◆ m_logger

log4cplus::Logger TestAsyncOpAwaitState::m_logger

Definition at line 39 of file testAsyncOpAwaitState.cpp.

◆ m_status

std::shared_ptr<daq::ObservableStatus> TestAsyncOpAwaitState::m_status

Definition at line 38 of file testAsyncOpAwaitState.cpp.

◆ TestAsyncOpBase

struct TestAsyncOpBase

Base fixture for async operation tests.

Definition at line 38 of file testAsyncOpBase.hpp.

+ Inheritance diagram for TestAsyncOpBase:

Public Member Functions

 TestAsyncOpBase ()
 
void SetUp () override
 
void TearDown () override
 
template<class SourceType >
std::vector< daq::Source< SourceType > > MakeSources (std::vector< SourceType > sources)
 
daq::op::AsyncOpParams MakeParams ()
 

Public Attributes

std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client
 
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client2
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client2
 
boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
log4cplus::Logger m_logger
 
std::string m_id
 
StatusObserverMock m_observer
 
std::shared_ptr< daq::ObservableStatusm_status
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
daq::op::AlertState m_alerts
 
std::shared_ptr< daq::PendingRepliesm_pending_replies
 
std::vector< daq::Source< daq::PrimSource > > m_prim_sources
 
std::vector< daq::Source< daq::MetaSource > > m_meta_sources
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise1
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise2
 
boost::promise< std::string > m_string_promise1
 
boost::promise< std::string > m_string_promise2
 

Constructor & Destructor Documentation

◆ TestAsyncOpBase()

TestAsyncOpBase::TestAsyncOpBase ( )

Definition at line 13 of file testAsyncOpBase.cpp.

Member Function Documentation

◆ MakeParams()

op::AsyncOpParams TestAsyncOpBase::MakeParams ( )

Definition at line 50 of file testAsyncOpBase.cpp.

◆ MakeSources()

template<class SourceType >
std::vector<daq::Source<SourceType> > TestAsyncOpBase::MakeSources ( std::vector< SourceType >  sources)
inline

Definition at line 69 of file testAsyncOpBase.hpp.

◆ SetUp()

void TestAsyncOpBase::SetUp ( )
override

Definition at line 23 of file testAsyncOpBase.cpp.

◆ TearDown()

void TestAsyncOpBase::TearDown ( )
override

Definition at line 43 of file testAsyncOpBase.cpp.

Member Data Documentation

◆ m_alerts

daq::op::AlertState TestAsyncOpBase::m_alerts

Definition at line 52 of file testAsyncOpBase.hpp.

◆ m_event_log

std::shared_ptr<daq::ObservableEventLog> TestAsyncOpBase::m_event_log

Definition at line 51 of file testAsyncOpBase.hpp.

◆ m_executor

rad::IoExecutor TestAsyncOpBase::m_executor

Definition at line 46 of file testAsyncOpBase.hpp.

◆ m_id

std::string TestAsyncOpBase::m_id

Definition at line 48 of file testAsyncOpBase.hpp.

◆ m_io_ctx

boost::asio::io_context TestAsyncOpBase::m_io_ctx

Definition at line 45 of file testAsyncOpBase.hpp.

◆ m_logger

log4cplus::Logger TestAsyncOpBase::m_logger

Definition at line 47 of file testAsyncOpBase.hpp.

◆ m_meta_rr_client

std::shared_ptr<daq::MetaDaqAsyncMock> TestAsyncOpBase::m_meta_rr_client

Definition at line 41 of file testAsyncOpBase.hpp.

◆ m_meta_rr_client2

std::shared_ptr<daq::MetaDaqAsyncMock> TestAsyncOpBase::m_meta_rr_client2

Definition at line 42 of file testAsyncOpBase.hpp.

◆ m_meta_sources

std::vector<daq::Source<daq::MetaSource> > TestAsyncOpBase::m_meta_sources

Definition at line 55 of file testAsyncOpBase.hpp.

◆ m_observer

StatusObserverMock TestAsyncOpBase::m_observer

Definition at line 49 of file testAsyncOpBase.hpp.

◆ m_pending_replies

std::shared_ptr<daq::PendingReplies> TestAsyncOpBase::m_pending_replies

Definition at line 53 of file testAsyncOpBase.hpp.

◆ m_prim_rr_client

std::shared_ptr<daq::RecCmdsAsyncMock> TestAsyncOpBase::m_prim_rr_client

Definition at line 39 of file testAsyncOpBase.hpp.

◆ m_prim_rr_client2

std::shared_ptr<daq::RecCmdsAsyncMock> TestAsyncOpBase::m_prim_rr_client2

Definition at line 40 of file testAsyncOpBase.hpp.

◆ m_prim_sources

std::vector<daq::Source<daq::PrimSource> > TestAsyncOpBase::m_prim_sources

Definition at line 54 of file testAsyncOpBase.hpp.

◆ m_recstatus_promise1

boost::promise<std::shared_ptr<recif::RecStatus> > TestAsyncOpBase::m_recstatus_promise1

Definition at line 58 of file testAsyncOpBase.hpp.

◆ m_recstatus_promise2

boost::promise<std::shared_ptr<recif::RecStatus> > TestAsyncOpBase::m_recstatus_promise2

Definition at line 59 of file testAsyncOpBase.hpp.

◆ m_status

std::shared_ptr<daq::ObservableStatus> TestAsyncOpBase::m_status

Definition at line 50 of file testAsyncOpBase.hpp.

◆ m_string_promise1

boost::promise<std::string> TestAsyncOpBase::m_string_promise1

Definition at line 60 of file testAsyncOpBase.hpp.

◆ m_string_promise2

boost::promise<std::string> TestAsyncOpBase::m_string_promise2

Definition at line 61 of file testAsyncOpBase.hpp.

◆ TestAsyncOpStart

struct TestAsyncOpStart

Definition at line 28 of file testAsyncOpStart.cpp.

+ Inheritance diagram for TestAsyncOpStart:

Additional Inherited Members

- Public Member Functions inherited from TestAsyncOpBase
 TestAsyncOpBase ()
 
void SetUp () override
 
void TearDown () override
 
template<class SourceType >
std::vector< daq::Source< SourceType > > MakeSources (std::vector< SourceType > sources)
 
daq::op::AsyncOpParams MakeParams ()
 
- Public Attributes inherited from TestAsyncOpBase
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client
 
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client2
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client2
 
boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
log4cplus::Logger m_logger
 
std::string m_id
 
StatusObserverMock m_observer
 
std::shared_ptr< daq::ObservableStatusm_status
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
daq::op::AlertState m_alerts
 
std::shared_ptr< daq::PendingRepliesm_pending_replies
 
std::vector< daq::Source< daq::PrimSource > > m_prim_sources
 
std::vector< daq::Source< daq::MetaSource > > m_meta_sources
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise1
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise2
 
boost::promise< std::string > m_string_promise1
 
boost::promise< std::string > m_string_promise2
 

◆ TestAsyncOpStop

struct TestAsyncOpStop

Note: TestAsyncOpBase set.

Definition at line 30 of file testAsyncOpStop.cpp.

+ Inheritance diagram for TestAsyncOpStop:

Public Member Functions

void SetUp () override
 
- Public Member Functions inherited from TestAsyncOpBase
 TestAsyncOpBase ()
 
void SetUp () override
 
void TearDown () override
 
template<class SourceType >
std::vector< daq::Source< SourceType > > MakeSources (std::vector< SourceType > sources)
 
daq::op::AsyncOpParams MakeParams ()
 

Public Attributes

std::string m_keywords
 
std::string m_empty
 
- Public Attributes inherited from TestAsyncOpBase
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client
 
std::shared_ptr< daq::RecCmdsAsyncMockm_prim_rr_client2
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< daq::MetaDaqAsyncMockm_meta_rr_client2
 
boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
log4cplus::Logger m_logger
 
std::string m_id
 
StatusObserverMock m_observer
 
std::shared_ptr< daq::ObservableStatusm_status
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
daq::op::AlertState m_alerts
 
std::shared_ptr< daq::PendingRepliesm_pending_replies
 
std::vector< daq::Source< daq::PrimSource > > m_prim_sources
 
std::vector< daq::Source< daq::MetaSource > > m_meta_sources
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise1
 
boost::promise< std::shared_ptr< recif::RecStatus > > m_recstatus_promise2
 
boost::promise< std::string > m_string_promise1
 
boost::promise< std::string > m_string_promise2
 

Member Function Documentation

◆ SetUp()

void TestAsyncOpStop::SetUp ( )
inlineoverride

Definition at line 31 of file testAsyncOpStop.cpp.

Member Data Documentation

◆ m_empty

std::string TestAsyncOpStop::m_empty

Definition at line 50 of file testAsyncOpStop.cpp.

◆ m_keywords

std::string TestAsyncOpStop::m_keywords

Definition at line 49 of file testAsyncOpStop.cpp.

◆ daq::TestDpmDaqController

class daq::TestDpmDaqController

Fixture for daq::DaqController life cycle tests.

Definition at line 26 of file testDpmDaqController.cpp.

+ Inheritance diagram for daq::TestDpmDaqController:

Public Member Functions

 TestDpmDaqController ()
 
void SetUp () override
 
void PostSetUp ()
 

Public Attributes

boost::asio::io_context m_io_ctx
 
std::shared_ptr< ObservableStatusm_status
 
std::shared_ptr< ObservableEventLogm_event_log
 
DaqContext m_props
 
std::shared_ptr< DpmClientMockm_dpm_client
 
Status m_dpm_status = Status("id", "fileid")
 Fake status update sample from DPM. More...
 
std::shared_ptr< DpmDaqControllerm_controller
 

Constructor & Destructor Documentation

◆ TestDpmDaqController()

daq::TestDpmDaqController::TestDpmDaqController ( )
inline

Definition at line 28 of file testDpmDaqController.cpp.

Member Function Documentation

◆ PostSetUp()

void daq::TestDpmDaqController::PostSetUp ( )
inline

Definition at line 47 of file testDpmDaqController.cpp.

◆ SetUp()

void daq::TestDpmDaqController::SetUp ( )
inlineoverride

Definition at line 42 of file testDpmDaqController.cpp.

Member Data Documentation

◆ m_controller

std::shared_ptr<DpmDaqController> daq::TestDpmDaqController::m_controller

Definition at line 62 of file testDpmDaqController.cpp.

◆ m_dpm_client

std::shared_ptr<DpmClientMock> daq::TestDpmDaqController::m_dpm_client

Definition at line 56 of file testDpmDaqController.cpp.

◆ m_dpm_status

Status daq::TestDpmDaqController::m_dpm_status = Status("id", "fileid")

Fake status update sample from DPM.

Definition at line 60 of file testDpmDaqController.cpp.

◆ m_event_log

std::shared_ptr<ObservableEventLog> daq::TestDpmDaqController::m_event_log

Definition at line 54 of file testDpmDaqController.cpp.

◆ m_io_ctx

boost::asio::io_context daq::TestDpmDaqController::m_io_ctx

Definition at line 52 of file testDpmDaqController.cpp.

◆ m_props

DaqContext daq::TestDpmDaqController::m_props

Definition at line 55 of file testDpmDaqController.cpp.

◆ m_status

std::shared_ptr<ObservableStatus> daq::TestDpmDaqController::m_status

Definition at line 53 of file testDpmDaqController.cpp.

◆ TestManagerImplLifecycle

class TestManagerImplLifecycle

Definition at line 48 of file testManager.cpp.

+ Inheritance diagram for TestManagerImplLifecycle:

Public Member Functions

void SetUp () override
 
void TearDown () override
 
- Public Member Functions inherited from FixtureBase
template<class T >
ExpectNoException (boost::future< T > &f)
 

Additional Inherited Members

- Public Attributes inherited from FixtureBase
ManagerParams m_params = {"INS"}
 

Member Function Documentation

◆ SetUp()

void TestManagerImplLifecycle::SetUp ( )
inlineoverride

Definition at line 50 of file testManager.cpp.

◆ TearDown()

void TestManagerImplLifecycle::TearDown ( )
inlineoverride

Definition at line 52 of file testManager.cpp.

◆ TestManagerImpl

class TestManagerImpl

Definition at line 59 of file testManager.cpp.

+ Inheritance diagram for TestManagerImpl:

Public Member Functions

 TestManagerImpl ()
 
void SetUp () override
 Creates manager and adds two data acquisitions. More...
 
auto StartDaq1 () -> boost::future< State >
 
void TearDown () override
 
- Public Member Functions inherited from FixtureBase
template<class T >
ExpectNoException (boost::future< T > &f)
 

Public Attributes

boost::asio::io_context m_io_ctx
 
rad::IoExecutor m_executor
 
MockWorkspace m_workspace
 
std::shared_ptr< daq::ObservableEventLogm_event_log
 
std::string m_daq_id_1
 
std::string m_daq_id_2
 
DaqContext m_daq_ctx_1
 
DaqContext m_daq_ctx_2
 
std::shared_ptr< DaqControllerMockm_daq1
 
std::shared_ptr< DaqControllerMockm_daq2
 
std::shared_ptr< DaqControllerMockm_dpm_daq1
 
std::shared_ptr< DaqControllerMockm_dpm_daq2
 
std::shared_ptr< ObservableStatusm_daq1_status
 
std::shared_ptr< ObservableStatusm_daq2_status
 
std::shared_ptr< ObservableStatusm_daq1_dpm_status
 
std::shared_ptr< ObservableStatusm_daq2_dpm_status
 
DaqControllerFactoryFake m_daq_factory
 
ManagerImpl m_manager
 
- Public Attributes inherited from FixtureBase
ManagerParams m_params = {"INS"}
 

Constructor & Destructor Documentation

◆ TestManagerImpl()

TestManagerImpl::TestManagerImpl ( )
inline

Definition at line 61 of file testManager.cpp.

Member Function Documentation

◆ SetUp()

void TestManagerImpl::SetUp ( )
inlineoverride

Creates manager and adds two data acquisitions.

Definition at line 75 of file testManager.cpp.

◆ StartDaq1()

auto TestManagerImpl::StartDaq1 ( ) -> boost::future<State>
inline

Definition at line 137 of file testManager.cpp.

◆ TearDown()

void TestManagerImpl::TearDown ( )
inlineoverride

Definition at line 146 of file testManager.cpp.

Member Data Documentation

◆ m_daq1

std::shared_ptr<DaqControllerMock> TestManagerImpl::m_daq1

Definition at line 163 of file testManager.cpp.

◆ m_daq1_dpm_status

std::shared_ptr<ObservableStatus> TestManagerImpl::m_daq1_dpm_status

Definition at line 169 of file testManager.cpp.

◆ m_daq1_status

std::shared_ptr<ObservableStatus> TestManagerImpl::m_daq1_status

Definition at line 167 of file testManager.cpp.

◆ m_daq2

std::shared_ptr<DaqControllerMock> TestManagerImpl::m_daq2

Definition at line 164 of file testManager.cpp.

◆ m_daq2_dpm_status

std::shared_ptr<ObservableStatus> TestManagerImpl::m_daq2_dpm_status

Definition at line 170 of file testManager.cpp.

◆ m_daq2_status

std::shared_ptr<ObservableStatus> TestManagerImpl::m_daq2_status

Definition at line 168 of file testManager.cpp.

◆ m_daq_ctx_1

DaqContext TestManagerImpl::m_daq_ctx_1

Definition at line 161 of file testManager.cpp.

◆ m_daq_ctx_2

DaqContext TestManagerImpl::m_daq_ctx_2

Definition at line 162 of file testManager.cpp.

◆ m_daq_factory

DaqControllerFactoryFake TestManagerImpl::m_daq_factory

Definition at line 171 of file testManager.cpp.

◆ m_daq_id_1

std::string TestManagerImpl::m_daq_id_1

Definition at line 159 of file testManager.cpp.

◆ m_daq_id_2

std::string TestManagerImpl::m_daq_id_2

Definition at line 160 of file testManager.cpp.

◆ m_dpm_daq1

std::shared_ptr<DaqControllerMock> TestManagerImpl::m_dpm_daq1

Definition at line 165 of file testManager.cpp.

◆ m_dpm_daq2

std::shared_ptr<DaqControllerMock> TestManagerImpl::m_dpm_daq2

Definition at line 166 of file testManager.cpp.

◆ m_event_log

std::shared_ptr<daq::ObservableEventLog> TestManagerImpl::m_event_log

Definition at line 158 of file testManager.cpp.

◆ m_executor

rad::IoExecutor TestManagerImpl::m_executor

Definition at line 156 of file testManager.cpp.

◆ m_io_ctx

boost::asio::io_context TestManagerImpl::m_io_ctx

Definition at line 155 of file testManager.cpp.

◆ m_manager

ManagerImpl TestManagerImpl::m_manager

Definition at line 172 of file testManager.cpp.

◆ m_workspace

MockWorkspace TestManagerImpl::m_workspace

Definition at line 157 of file testManager.cpp.

◆ TestOcmDaqControllerLifeCycle

class TestOcmDaqControllerLifeCycle

Fixture for daq::DaqController life cycle tests.

Definition at line 38 of file testOcmDaqController.cpp.

+ Inheritance diagram for TestOcmDaqControllerLifeCycle:

Public Member Functions

 TestOcmDaqControllerLifeCycle ()
 

Public Attributes

boost::asio::io_context m_io_ctx
 
std::shared_ptr< ObservableStatusm_status
 
std::shared_ptr< ObservableEventLogm_event_log
 
std::shared_ptr< PrimSource::RrClientm_prim_rr_client
 
std::shared_ptr< MetaSource::RrClientm_meta_rr_client
 
OcmAsyncOperations m_ops
 
DaqContext m_context
 
DaqSources m_sources
 

Constructor & Destructor Documentation

◆ TestOcmDaqControllerLifeCycle()

TestOcmDaqControllerLifeCycle::TestOcmDaqControllerLifeCycle ( )
inline

Definition at line 40 of file testOcmDaqController.cpp.

Member Data Documentation

◆ m_context

DaqContext TestOcmDaqControllerLifeCycle::m_context

Definition at line 66 of file testOcmDaqController.cpp.

◆ m_event_log

std::shared_ptr<ObservableEventLog> TestOcmDaqControllerLifeCycle::m_event_log

Definition at line 62 of file testOcmDaqController.cpp.

◆ m_io_ctx

boost::asio::io_context TestOcmDaqControllerLifeCycle::m_io_ctx

Definition at line 60 of file testOcmDaqController.cpp.

◆ m_meta_rr_client

std::shared_ptr<MetaSource::RrClient> TestOcmDaqControllerLifeCycle::m_meta_rr_client

Definition at line 64 of file testOcmDaqController.cpp.

◆ m_ops

OcmAsyncOperations TestOcmDaqControllerLifeCycle::m_ops

Definition at line 65 of file testOcmDaqController.cpp.

◆ m_prim_rr_client

std::shared_ptr<PrimSource::RrClient> TestOcmDaqControllerLifeCycle::m_prim_rr_client

Definition at line 63 of file testOcmDaqController.cpp.

◆ m_sources

DaqSources TestOcmDaqControllerLifeCycle::m_sources

Definition at line 67 of file testOcmDaqController.cpp.

◆ m_status

std::shared_ptr<ObservableStatus> TestOcmDaqControllerLifeCycle::m_status

Definition at line 61 of file testOcmDaqController.cpp.

◆ TestState

struct TestState

Developer notes: OcmDaqController use boost::when_all to compose futures.

This does not support executors and will spawn a thread to perform the work. This means that the tests will either have to block indefinitely with future::get() or use a timeout.

Definition at line 92 of file testOcmDaqController.cpp.

+ Inheritance diagram for TestState:

Public Member Functions

 TestState ()
 
void SetUp () override
 
void TearDown () override
 
virtual void PreDaqControllerHook ()
 
virtual void PreStartAsyncHook ()
 
void StartDaq ()
 Executes a successful StartAsync() call. More...
 
void AbortDaq ()
 
void StopDaq ()
 

Public Attributes

std::shared_ptr< PrimSource::RrClientm_prim_rr_client
 
std::shared_ptr< MetaDaqAsyncMockm_meta_rr_client
 
std::shared_ptr< MetaDaqAsyncMockm_meta_rr_client2
 
std::unique_ptr< MockAsyncOperationsm_mock_ops
 
boost::asio::io_context m_io_ctx
 
StatusObserverMock m_observer
 
std::shared_ptr< ObservableStatusm_status
 
std::shared_ptr< ObservableEventLogm_event_log
 
std::shared_ptr< OcmDaqControllerm_daq
 
DaqContext m_context
 
DaqSources m_sources
 
std::vector< DpPartm_files
 
fits::KeywordVector m_keywords
 

Constructor & Destructor Documentation

◆ TestState()

TestState::TestState ( )
inline

Definition at line 108 of file testOcmDaqController.cpp.

Member Function Documentation

◆ AbortDaq()

void TestState::AbortDaq ( )
inline

Definition at line 189 of file testOcmDaqController.cpp.

◆ PreDaqControllerHook()

virtual void TestState::PreDaqControllerHook ( )
inlinevirtual

Reimplemented in TestDaqControllerAwait, TestStopped, and TestAcquiring.

Definition at line 154 of file testOcmDaqController.cpp.

◆ PreStartAsyncHook()

virtual void TestState::PreStartAsyncHook ( )
inlinevirtual

Reimplemented in TestDaqControllerAwait.

Definition at line 156 of file testOcmDaqController.cpp.

◆ SetUp()

void TestState::SetUp ( )
inlineoverride

Definition at line 114 of file testOcmDaqController.cpp.

◆ StartDaq()

void TestState::StartDaq ( )
inline

Executes a successful StartAsync() call.

Definition at line 162 of file testOcmDaqController.cpp.

◆ StopDaq()

void TestState::StopDaq ( )
inline

Definition at line 220 of file testOcmDaqController.cpp.

◆ TearDown()

void TestState::TearDown ( )
inlineoverride

Definition at line 147 of file testOcmDaqController.cpp.

Member Data Documentation

◆ m_context

DaqContext TestState::m_context

Definition at line 103 of file testOcmDaqController.cpp.

◆ m_daq

std::shared_ptr<OcmDaqController> TestState::m_daq

Definition at line 102 of file testOcmDaqController.cpp.

◆ m_event_log

std::shared_ptr<ObservableEventLog> TestState::m_event_log

Definition at line 101 of file testOcmDaqController.cpp.

◆ m_files

std::vector<DpPart> TestState::m_files

Definition at line 105 of file testOcmDaqController.cpp.

◆ m_io_ctx

boost::asio::io_context TestState::m_io_ctx

Definition at line 98 of file testOcmDaqController.cpp.

◆ m_keywords

fits::KeywordVector TestState::m_keywords

Definition at line 106 of file testOcmDaqController.cpp.

◆ m_meta_rr_client

std::shared_ptr<MetaDaqAsyncMock> TestState::m_meta_rr_client

Definition at line 94 of file testOcmDaqController.cpp.

◆ m_meta_rr_client2

std::shared_ptr<MetaDaqAsyncMock> TestState::m_meta_rr_client2

Definition at line 95 of file testOcmDaqController.cpp.

◆ m_mock_ops

std::unique_ptr<MockAsyncOperations> TestState::m_mock_ops

Definition at line 96 of file testOcmDaqController.cpp.

◆ m_observer

StatusObserverMock TestState::m_observer

Definition at line 99 of file testOcmDaqController.cpp.

◆ m_prim_rr_client

std::shared_ptr<PrimSource::RrClient> TestState::m_prim_rr_client

Definition at line 93 of file testOcmDaqController.cpp.

◆ m_sources

DaqSources TestState::m_sources

Definition at line 104 of file testOcmDaqController.cpp.

◆ m_status

std::shared_ptr<ObservableStatus> TestState::m_status

Definition at line 100 of file testOcmDaqController.cpp.

◆ TestPendingReplies

class TestPendingReplies

Test fixture for PendingReplies tests.

Definition at line 21 of file testPendingReplies.cpp.

+ Inheritance diagram for TestPendingReplies:

Public Member Functions

void SetUp () override
 
void TearDown () override
 

Protected Attributes

std::shared_ptr< PendingReplies > pending
 

Member Function Documentation

◆ SetUp()

void TestPendingReplies::SetUp ( )
inlineoverride

Definition at line 23 of file testPendingReplies.cpp.

◆ TearDown()

void TestPendingReplies::TearDown ( )
inlineoverride

Definition at line 26 of file testPendingReplies.cpp.

Member Data Documentation

◆ pending

std::shared_ptr<PendingReplies> TestPendingReplies::pending
protected

Definition at line 29 of file testPendingReplies.cpp.

◆ daq::TestSource

class daq::TestSource

Test fixture for source tests.

Definition at line 20 of file testSource.cpp.

+ Inheritance diagram for daq::TestSource:

Public Member Functions

void SetUp () override
 
void TearDown () override
 

Protected Attributes

std::shared_ptr< PrimSource::RrClientm_prim_rr_client
 
std::shared_ptr< MetaSource::RrClientm_meta_rr_client
 

Member Function Documentation

◆ SetUp()

void daq::TestSource::SetUp ( )
inlineoverride

Definition at line 22 of file testSource.cpp.

◆ TearDown()

void daq::TestSource::TearDown ( )
inlineoverride

Definition at line 27 of file testSource.cpp.

Member Data Documentation

◆ m_meta_rr_client

std::shared_ptr<MetaSource::RrClient> daq::TestSource::m_meta_rr_client
protected

Definition at line 31 of file testSource.cpp.

◆ m_prim_rr_client

std::shared_ptr<PrimSource::RrClient> daq::TestSource::m_prim_rr_client
protected

Definition at line 30 of file testSource.cpp.

◆ TestObservableStatus

class TestObservableStatus

ObservableStatus test fixture.

Definition at line 22 of file testStatus.cpp.

+ Inheritance diagram for TestObservableStatus:

Function Documentation

◆ MakeTestProgress() [1/2]

template<class Future = void>
void MakeTestProgress ( boost::asio::io_context &  io_ctx,
Future *  fut = nullptr 
)

Test helper that progress the test by executing pending jobs and optionally wait for a future to be ready.

Definition at line 42 of file utils.hpp.

◆ MakeTestProgress() [2/2]

template<class Future = void>
void daq::test::MakeTestProgress ( boost::asio::io_context &  io_ctx,
Future *  fut = nullptr 
)

Test helper that progress the test by executing pending jobs and optionally wait for a future to be ready.

Definition at line 47 of file progress.hpp.