ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
testParsing.cpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_daqifsupport
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief daqif:: parsing test
7  */
8 #include <gtest/gtest.h>
9 
10 #include <daqif/parsing.hpp>
11 
12 using namespace ::testing;
13 
14 TEST(Parsing, ParseOcmIfSubState) {
15  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("NotStarted"), daqif::NotStarted);
16  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Starting"), daqif::Starting);
17  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Acquiring"), daqif::Acquiring);
18  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Stopping"), daqif::Stopping);
19  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Stopped"), daqif::Stopped);
20  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Aborting"), daqif::Aborting);
21  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Aborted"), daqif::Aborted);
22  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("NotScheduled"), daqif::NotScheduled);
23  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Scheduled"), daqif::Scheduled);
24  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Transferring"), daqif::Transferring);
25  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Merging"), daqif::Merging);
26  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Releasing"), daqif::Releasing);
27  EXPECT_EQ(daqif::FromString<daqif::DaqSubState>("Completed"), daqif::Completed);
28 
29  EXPECT_THROW(daqif::FromString<daqif::DaqSubState>("Not a state"), std::invalid_argument);
30 }
31 
32 TEST(Parsing, ParseDaqState) {
33  EXPECT_EQ(daqif::FromString<daqif::DaqState>("StateAcquiring"), daqif::StateAcquiring);
34  EXPECT_EQ(daqif::FromString<daqif::DaqState>("StateMerging"), daqif::StateMerging);
35  EXPECT_EQ(daqif::FromString<daqif::DaqState>("StateCompleted"), daqif::StateCompleted);
36 
37  EXPECT_THROW(daqif::FromString<daqif::DaqState>("Not a state"), std::invalid_argument);
38 }
39 
parsing.hpp
Contains parse functions for daqif.
TEST
TEST(Parsing, ParseOcmIfSubState)
Definition: testParsing.cpp:14