ifw-daq
3.0.0-pre2
IFW Data Acquisition modules
|
Unit test for daq::OcmDaqController
More...
#include <memory>
#include <stdexcept>
#include <thread>
#include <gtest/gtest.h>
#include <daq/daqController.hpp>
#include <daq/error.hpp>
#include <daq/op/abort.hpp>
#include <daq/op/awaitPrim.hpp>
#include <daq/op/initiate.hpp>
#include <daq/op/start.hpp>
#include <daq/op/stop.hpp>
#include "mock/metadaqifMock.hpp"
#include "mock/mockAsyncOperations.hpp"
#include "mock/recifMock.hpp"
#include "statusObserver.hpp"
#include "utils.hpp"
Go to the source code of this file.
Classes | |
class | TestOcmDaqControllerLifeCycle |
Fixture for daq::DaqController life cycle tests. More... | |
struct | TestState |
Developer notes: OcmDaqController use boost::when_all to compose futures. More... | |
struct | TestAwait |
struct | TestNotStarted |
struct | TestAcquiring |
struct | TestStopped |
struct | TestDaqControllerAwait |
Functions | |
template<class Iterator > | |
void | SetSourceState (Iterator begin, Iterator end, State state) |
void | SetAllSourceState (op::AsyncOpParams ¶ms, State state) |
TEST (TestBoost, Unwrap) | |
TEST_F (TestOcmDaqControllerLifeCycle, ConstructorFailsIfNoSourcesAreProvided) | |
TEST_F (TestOcmDaqControllerLifeCycle, ConstructorFailsObservableStatusIdDoesNotMatchDaqContextId) | |
TEST_F (TestOcmDaqControllerLifeCycle, ConstructorFailsIfAsyncOperationIsInvalid) | |
TEST_F (TestOcmDaqControllerLifeCycle, ConstructorSucceedsIfSingleMetadataSourceIsUsed) | |
TEST_F (TestOcmDaqControllerLifeCycle, DestructionAbortsAsyncWait) | |
TEST_F (TestState, NotStarted) | |
TEST_F (TestState, GetStatusReturnsSameStatusObject) | |
TEST_F (TestState, CannotStopStoppedOcmDaqController) | |
TEST_F (TestState, CannotAbortStoppedOcmDaqController) | |
TEST_F (TestState, StartingFailsToSendStartDaqWillAbortAndSetErrorFlagAndStayInStarting) | |
TEST_F (TestState, StartAsyncReturnsExceptionalFutureInStateStarting) | |
TEST_F (TestState, StopAsyncThrowsIfNotStarted) | |
It's possible to abort but not stop (and keep) More... | |
TEST_F (TestState, StopAsyncDoesNotThrowWithTolerantPolicy) | |
TEST_F (TestState, AbortAsyncIsOkIfNotStarted) | |
It should be possible to abort a data acquisition even if it's not started. More... | |
TEST_F (TestState, StopAsyncThrowsIfStarting) | |
It's possible to abort but not stop (and keep) if data acquisition is starting. More... | |
TEST_F (TestState, AbortingIsOkWhenStarting) | |
Test sequence: More... | |
TEST_F (TestState, StartAsyncCompletesSuccessfully) | |
TEST_F (TestState, AbortOcmDaqControllerInStateAborting) | |
TEST_F (TestState, AbortOcmDaqControllerInStateStarting) | |
TEST_F (TestState, AbortAsyncReturnsWithErrorInsteadOfExceptionForTolerantPolicy) | |
TEST_F (TestState, NewAbortSupersedesSuccessfulAbort) | |
It is possible to abort even though an abort operation has already been started. More... | |
TEST_F (TestState, NewAbortSupersedesFailedAbortWithStrictPolicy) | |
TEST_F (TestState, StopOcmDaqControllerSuccessfully) | |
TEST_F (TestAwait, AwaitNonExistantSourceFails) | |
TEST_F (TestAwait, AwaitTimeout) | |
TEST_F (TestAwait, AwaitStopSingleSourceIsOk) | |
TEST_F (TestAwait, AwaitAbortAllMetadataSources) | |
TEST_F (TestAwait, AwaitStopSingleSourceWhenConditionIsFulfilled) | |
TEST_F (TestNotStarted, CanUpdateKeywords) | |
TEST_F (TestStopped, CannotUpdateKeywordsInStopped) | |
TEST_F (TestDaqControllerAwait, StartWillAwait) | |
TEST_F (TestDaqControllerAwait, AutomaticStop) | |
Tests that DaqController automatically stops DAQ when the await-op completes. More... | |
Unit test for daq::OcmDaqController
Definition in file testOcmDaqController.cpp.
void SetAllSourceState | ( | op::AsyncOpParams & | params, |
State | state | ||
) |
Definition at line 78 of file testOcmDaqController.cpp.
void SetSourceState | ( | Iterator | begin, |
Iterator | end, | ||
State | state | ||
) |
Definition at line 71 of file testOcmDaqController.cpp.
TEST | ( | TestBoost | , |
Unwrap | |||
) |
Definition at line 284 of file testOcmDaqController.cpp.
TEST_F | ( | TestAwait | , |
AwaitAbortAllMetadataSources | |||
) |
Definition at line 798 of file testOcmDaqController.cpp.
TEST_F | ( | TestAwait | , |
AwaitNonExistantSourceFails | |||
) |
Definition at line 761 of file testOcmDaqController.cpp.
TEST_F | ( | TestAwait | , |
AwaitStopSingleSourceIsOk | |||
) |
Definition at line 777 of file testOcmDaqController.cpp.
TEST_F | ( | TestAwait | , |
AwaitStopSingleSourceWhenConditionIsFulfilled | |||
) |
Definition at line 819 of file testOcmDaqController.cpp.
TEST_F | ( | TestAwait | , |
AwaitTimeout | |||
) |
Definition at line 768 of file testOcmDaqController.cpp.
TEST_F | ( | TestDaqControllerAwait | , |
AutomaticStop | |||
) |
Tests that DaqController automatically stops DAQ when the await-op completes.
Definition at line 859 of file testOcmDaqController.cpp.
TEST_F | ( | TestDaqControllerAwait | , |
StartWillAwait | |||
) |
Definition at line 849 of file testOcmDaqController.cpp.
TEST_F | ( | TestNotStarted | , |
CanUpdateKeywords | |||
) |
Definition at line 833 of file testOcmDaqController.cpp.
TEST_F | ( | TestOcmDaqControllerLifeCycle | , |
ConstructorFailsIfAsyncOperationIsInvalid | |||
) |
Definition at line 313 of file testOcmDaqController.cpp.
TEST_F | ( | TestOcmDaqControllerLifeCycle | , |
ConstructorFailsIfNoSourcesAreProvided | |||
) |
Definition at line 298 of file testOcmDaqController.cpp.
TEST_F | ( | TestOcmDaqControllerLifeCycle | , |
ConstructorFailsObservableStatusIdDoesNotMatchDaqContextId | |||
) |
Definition at line 304 of file testOcmDaqController.cpp.
TEST_F | ( | TestOcmDaqControllerLifeCycle | , |
ConstructorSucceedsIfSingleMetadataSourceIsUsed | |||
) |
Definition at line 339 of file testOcmDaqController.cpp.
TEST_F | ( | TestOcmDaqControllerLifeCycle | , |
DestructionAbortsAsyncWait | |||
) |
Definition at line 345 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
AbortAsyncIsOkIfNotStarted | |||
) |
It should be possible to abort a data acquisition even if it's not started.
Definition at line 491 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
AbortAsyncReturnsWithErrorInsteadOfExceptionForTolerantPolicy | |||
) |
Definition at line 628 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
AbortingIsOkWhenStarting | |||
) |
Test sequence:
Definition at line 542 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
AbortOcmDaqControllerInStateAborting | |||
) |
Definition at line 601 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
AbortOcmDaqControllerInStateStarting | |||
) |
Definition at line 617 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
CannotAbortStoppedOcmDaqController | |||
) |
Definition at line 385 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
CannotStopStoppedOcmDaqController | |||
) |
Definition at line 372 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
GetStatusReturnsSameStatusObject | |||
) |
Definition at line 367 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
NewAbortSupersedesFailedAbortWithStrictPolicy | |||
) |
Definition at line 706 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
NewAbortSupersedesSuccessfulAbort | |||
) |
It is possible to abort even though an abort operation has already been started.
Nothing special happens in this case though.
Definition at line 662 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
NotStarted | |||
) |
Definition at line 363 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StartAsyncCompletesSuccessfully | |||
) |
Definition at line 595 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StartAsyncReturnsExceptionalFutureInStateStarting | |||
) |
Definition at line 419 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StartingFailsToSendStartDaqWillAbortAndSetErrorFlagAndStayInStarting | |||
) |
Definition at line 398 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StopAsyncDoesNotThrowWithTolerantPolicy | |||
) |
Definition at line 453 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StopAsyncThrowsIfNotStarted | |||
) |
It's possible to abort but not stop (and keep)
Definition at line 447 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StopAsyncThrowsIfStarting | |||
) |
It's possible to abort but not stop (and keep) if data acquisition is starting.
Definition at line 506 of file testOcmDaqController.cpp.
TEST_F | ( | TestState | , |
StopOcmDaqControllerSuccessfully | |||
) |
Definition at line 751 of file testOcmDaqController.cpp.
TEST_F | ( | TestStopped | , |
CannotUpdateKeywordsInStopped | |||
) |
Definition at line 842 of file testOcmDaqController.cpp.