ifw-daq  3.0.1
IFW Data Acquisition modules
Classes | Namespaces | Functions | Variables
testStartDaqV2.cpp File Reference
#include <daq/json/startDaqV2.hpp>
#include <gtest/gtest.h>

Go to the source code of this file.

Classes

class  daq::json::TestParseStartDaqV2Spec
 

Namespaces

 daq
 
 daq::json
 

Functions

 daq::json::TEST_F (TestParseStartDaqV2Spec, RoundTripParsing)
 
 daq::json::TEST_F (TestParseStartDaqV2Spec, SuccessfulTemplate)
 
 EXPECT_EQ (meta.rr_uri, "zpb.rr://meta")
 
 EXPECT_EQ (meta.source_name, "metadata")
 
 EXPECT_EQ (meta.initial_keywords, InitialKeywords::User)
 
 ASSERT_EQ (meta.keyword_rules.size(), 1u)
 
 ASSERT_EQ (transform.selection_patterns.size(), 1u)
 
 EXPECT_EQ (transform.selection_patterns[0], "+e INS1 *")
 
 EXPECT_EQ (transform.regex, "INS1 ")
 
 EXPECT_EQ (transform.format, "INS2 ")
 
 EXPECT_EQ (kws.source_name, "keywords")
 
 EXPECT_EQ (file.source_name, "file")
 
 ASSERT_TRUE (std::holds_alternative< OlasReceiver >(spec.receivers[0]))
 
 EXPECT_EQ (olas_receiver.host, "1.2.3.4")
 
 EXPECT_EQ (olas_receiver.path, "/absolute/path/")
 
 TEST_F (TestParseStartDaqV2Spec, EmptyKeywordRulesModelledAsEmptyOptional)
 
 TEST_F (TestParseStartDaqV2Spec, NoIdIsModelledAsEmptyString)
 
 TEST_F (TestParseStartDaqV2Spec, EmptydIsAllowed)
 
 TEST_F (TestParseStartDaqV2Spec, AwaitCompletionIntervalIsOptional)
 
 TEST_F (TestParseStartDaqV2Spec, AwaitCompletionIntervalAcceptsIntegers)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetWithoutSourceIsInvalid)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetMatchingMultipleSourcesIsInvalid)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetWithoutCorrespondingSourceIsInvalid)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetMetadataIsValid)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetFitsfileIsValid)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetIsOptional)
 
 TEST_F (TestParseStartDaqV2Spec, MergeTargetWithKeywordsSourceIsInvalid)
 
 TEST_F (TestParseStartDaqV2Spec, AwaitCompletionIntervalMustBePositive)
 
 TEST_F (TestParseStartDaqV2Spec, EmptyReceiversIsAllowed)
 
 TEST_F (TestParseStartDaqV2Spec, UndefinedReceiversIsAllowed)
 

Variables

daq::json::TestParseStartDaqV2Spec daq::json::_json
 
nlohmann::json daq::json::m_spec
 
auto const & transform = std::get<KeywordTransform>(meta.keyword_rules.at(0))
 
auto const & olas_receiver = std::get<OlasReceiver>(spec.receivers[0])
 

Detailed Description

Definition in file testStartDaqV2.cpp.

Function Documentation

◆ ASSERT_EQ() [1/2]

ASSERT_EQ ( meta.keyword_rules.  size(),
1u   
)

◆ ASSERT_EQ() [2/2]

ASSERT_EQ ( transform.selection_patterns.  size(),
1u   
)

◆ ASSERT_TRUE()

ASSERT_TRUE ( std::holds_alternative< OlasReceiver >  spec.receivers[0])

◆ EXPECT_EQ() [1/10]

EXPECT_EQ ( file.  source_name,
"file"   
)

◆ EXPECT_EQ() [2/10]

EXPECT_EQ ( kws.  source_name,
"keywords"   
)

◆ EXPECT_EQ() [3/10]

EXPECT_EQ ( meta.  initial_keywords,
InitialKeywords::User   
)

◆ EXPECT_EQ() [4/10]

EXPECT_EQ ( meta.  rr_uri,
"zpb.rr://meta"   
)

◆ EXPECT_EQ() [5/10]

EXPECT_EQ ( meta.  source_name,
"metadata"   
)

◆ EXPECT_EQ() [6/10]

EXPECT_EQ ( olas_receiver.  host,
"1.2.3.4"   
)

◆ EXPECT_EQ() [7/10]

EXPECT_EQ ( olas_receiver.  path,
"/absolute/path/"   
)

◆ EXPECT_EQ() [8/10]

EXPECT_EQ ( transform.  format,
"INS2 "   
)

◆ EXPECT_EQ() [9/10]

EXPECT_EQ ( transform.  regex,
"INS1 "   
)

◆ EXPECT_EQ() [10/10]

EXPECT_EQ ( transform.  selection_patterns[0],
"+e INS1 *"   
)

◆ TEST_F() [1/15]

TEST_F ( TestParseStartDaqV2Spec  ,
AwaitCompletionIntervalAcceptsIntegers   
)

Definition at line 217 of file testStartDaqV2.cpp.

◆ TEST_F() [2/15]

TEST_F ( TestParseStartDaqV2Spec  ,
AwaitCompletionIntervalIsOptional   
)

Definition at line 210 of file testStartDaqV2.cpp.

◆ TEST_F() [3/15]

TEST_F ( TestParseStartDaqV2Spec  ,
AwaitCompletionIntervalMustBePositive   
)

Definition at line 260 of file testStartDaqV2.cpp.

◆ TEST_F() [4/15]

TEST_F ( TestParseStartDaqV2Spec  ,
EmptydIsAllowed   
)

Definition at line 204 of file testStartDaqV2.cpp.

◆ TEST_F() [5/15]

TEST_F ( TestParseStartDaqV2Spec  ,
EmptyKeywordRulesModelledAsEmptyOptional   
)

Definition at line 172 of file testStartDaqV2.cpp.

◆ TEST_F() [6/15]

TEST_F ( TestParseStartDaqV2Spec  ,
EmptyReceiversIsAllowed   
)

Definition at line 265 of file testStartDaqV2.cpp.

◆ TEST_F() [7/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetFitsfileIsValid   
)

Definition at line 244 of file testStartDaqV2.cpp.

◆ TEST_F() [8/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetIsOptional   
)

Definition at line 249 of file testStartDaqV2.cpp.

◆ TEST_F() [9/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetMatchingMultipleSourcesIsInvalid   
)

Definition at line 229 of file testStartDaqV2.cpp.

◆ TEST_F() [10/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetMetadataIsValid   
)

Definition at line 239 of file testStartDaqV2.cpp.

◆ TEST_F() [11/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetWithKeywordsSourceIsInvalid   
)

Definition at line 255 of file testStartDaqV2.cpp.

◆ TEST_F() [12/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetWithoutCorrespondingSourceIsInvalid   
)

Definition at line 234 of file testStartDaqV2.cpp.

◆ TEST_F() [13/15]

TEST_F ( TestParseStartDaqV2Spec  ,
MergeTargetWithoutSourceIsInvalid   
)

Definition at line 224 of file testStartDaqV2.cpp.

◆ TEST_F() [14/15]

TEST_F ( TestParseStartDaqV2Spec  ,
NoIdIsModelledAsEmptyString   
)

Definition at line 198 of file testStartDaqV2.cpp.

◆ TEST_F() [15/15]

TEST_F ( TestParseStartDaqV2Spec  ,
UndefinedReceiversIsAllowed   
)

Definition at line 271 of file testStartDaqV2.cpp.

Variable Documentation

◆ olas_receiver

auto const& olas_receiver = std::get<OlasReceiver>(spec.receivers[0])

Definition at line 166 of file testStartDaqV2.cpp.

◆ transform

auto const& transform = std::get<KeywordTransform>(meta.keyword_rules.at(0))

Definition at line 148 of file testStartDaqV2.cpp.