ifw-daq
1.0.0
IFW Data Acquisition modules
ocm
ocmifSupport
test
testConversion.cpp
Go to the documentation of this file.
1
/**
2
* @file
3
* @ingroup daq_ocm_ocmifsupport
4
* @copyright 2021 ESO - European Southern Observatory
5
*
6
* @brief ocmif:: conversion helper test
7
*/
8
#include <gtest/gtest.h>
9
10
#include <
daq/state.hpp
>
11
#include <
ocmif/conversion.hpp
>
12
13
using namespace
::testing;
14
15
TEST
(Conversion, MakeOcmIfSubState) {
16
EXPECT_EQ(
ocmif::MakeState
(daq::State::NotStarted), ocmif::NotStarted);
17
EXPECT_EQ(
ocmif::MakeState
(daq::State::Acquiring), ocmif::Acquiring);
18
EXPECT_EQ(
ocmif::MakeState
(daq::State::Stopping), ocmif::Stopping);
19
EXPECT_EQ(
ocmif::MakeState
(daq::State::Stopped), ocmif::Stopped);
20
EXPECT_EQ(
ocmif::MakeState
(daq::State::Aborting), ocmif::Aborting);
21
EXPECT_EQ(
ocmif::MakeState
(
daq::State::Aborted
), ocmif::Aborted);
22
}
23
24
TEST
(Conversion, MakeDaqState) {
25
EXPECT_EQ(
ocmif::MakeState
(ocmif::NotStarted), daq::State::NotStarted);
26
EXPECT_EQ(
ocmif::MakeState
(ocmif::Acquiring), daq::State::Acquiring);
27
EXPECT_EQ(
ocmif::MakeState
(ocmif::Stopping), daq::State::Stopping);
28
EXPECT_EQ(
ocmif::MakeState
(ocmif::Stopped), daq::State::Stopped);
29
EXPECT_EQ(
ocmif::MakeState
(ocmif::Aborting), daq::State::Aborting);
30
EXPECT_EQ(
ocmif::MakeState
(ocmif::Aborted),
daq::State::Aborted
);
31
32
EXPECT_THROW(
ocmif::MakeState
(
static_cast<
ocmif::DaqSubState
>
(-123)), std::invalid_argument);
33
}
34
conversion.hpp
Contains support functions for ocmif.
ocmif::MakeState
ocmif::DaqSubState MakeState(daq::State state) noexcept
Converts daq::State to DaqSubstate.
Definition:
conversion.cpp:32
TEST
TEST(Conversion, MakeOcmIfSubState)
Definition:
testConversion.cpp:15
state.hpp
Declares daq::State and related functions.
daq::State::NotStarted
@ NotStarted
Initial state of data acquisition.
Generated by
1.8.20