ifw-daq
1.0.0
IFW Data Acquisition modules
|
Go to the documentation of this file.
8 #include <gtest/gtest.h>
9 #include <gmock/gmock.h>
14 using namespace ::testing;
42 EXPECT_EQ(State::NotStarted, s.
GetState()) <<
"Default state should be State::NotStarted";
43 EXPECT_FALSE(s.
GetError()) <<
"By default error flag should be false";
46 EXPECT_EQ(State::Starting, s.
GetState());
54 std::vector<DpPart> files1{{
"origin1",
"path1"}, {
"origin2",
"path2"} };
55 std::vector<DpPart> files2{{
"origin3",
"path3"}};
66 files3.insert(files3.end(), files2.begin(), files2.end());
85 EXPECT_EQ(v, s.
GetKeywords()) <<
"Expected both keywords to be there";
97 EXPECT_THAT(ss.str(), MatchesRegex(
"ObservableStatus\\(id='id', state=.*, error=false\\)"));
107 std::vector<DpPart> files = {{
"origin1",
"path1"}, {
"origin2",
"path2"}};
123 TEST(TestStatus, OstreamOperator) {
125 std::stringstream ss;
127 EXPECT_THAT(ss.str(), MatchesRegex(
"Status\\(id='id', state=.*, error=false\\)"));
State
Observable states of the data acquisition process.
ObservableStatus test fixture.
State GetState() const noexcept
boost::signals2::connection ConnectObserver(Observer o)
Connect observer that is invoked when state is modified.
TEST_F(TestSource, Constructors)
Stores data acquisition status and allows subscription to status changes.
BasicKeyword< EsoKeywordTraits > EsoKeyword
ESO hiearchical keyword.
TEST(TestStatus, OstreamOperator)
fits::KeywordVector const & GetKeywords() const noexcept
A type safe version of FormattedKeyword that consist of the three basic components of a FITS keyword ...
Contains declaration for Status and ObservableStatus.
Simple observer used for testing.
void SetError(bool error) noexcept
Set error flag for data acquisition.
void AddFiles(std::vector< DpPart > const &files)
Records that a file has been produced for this data acquisition.
void UpdateKeywords(fits::KeywordVector const &) noexcept
Updates (adds or replaces) Primary HDU keywords.
Non observable status object that keeps stores status of data acquisition.
void SetState(State s) noexcept
Set state of data acquisition.
std::vector< KeywordVariant > KeywordVector
Vector of keywords.
std::vector< DpPart > const & GetFiles() const noexcept
bool GetError() const noexcept