ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
recifMock.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_test
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief Mockup of metadaqif classes
7  */
8 // GCOVR_EXCL_START
9 #ifndef OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
10 #define OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
11 #include <Recif.hpp>
12 #include <daq/config.hpp>
13 #include <gmock/gmock.h>
14 
15 namespace daq {
16 
17 struct RecCmdsAsyncMock : recif::RecCmdsAsync {
18  MOCK_METHOD1(RecStart,
19  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>(
20  const std::shared_ptr<::recif::RecProperties>&));
21  MOCK_METHOD0(RecContinue,
22  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
23  MOCK_METHOD0(RecStop,
24  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
25  MOCK_METHOD0(RecAbort, ::elt::mal::future<std::string>());
26  MOCK_METHOD0(RecPause,
27  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
28  MOCK_METHOD1(RecStatus,
29  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>(const std::string&));
30  MOCK_METHOD1(RecWait,
31  ::elt::mal::future<std::shared_ptr<::recif::RecWaitStatus>>(
32  const std::shared_ptr<recif::RecWaitSpec>&));
33 
34  // mal API stuff
35  MOCK_CONST_METHOD0(getMal, std::shared_ptr<::elt::mal::Mal>());
36  MOCK_METHOD0(asyncConnect, ::elt::mal::future<void>());
38  registerConnectionListener,
39  elt::mal::rr::ListenerRegistration(elt::mal::rr::ClientRrEntity::ConnectionListener));
40 };
41 
42 struct RecStatusMock : recif::RecStatus {
43 public:
44  MOCK_CONST_METHOD0(getId, std::string());
45  MOCK_METHOD1(setId, void(const std::string&));
46 
47  MOCK_CONST_METHOD0(getDpFiles, std::vector<std::string>());
48  MOCK_METHOD1(setDpFiles, void(const std::vector<std::string>&));
49 
50  MOCK_CONST_METHOD0(getEndTime, double());
51  MOCK_METHOD1(setEndTime, void(double end_time));
52 
53  MOCK_CONST_METHOD0(getFilesGenerated, int32_t());
54  MOCK_METHOD1(setFilesGenerated, void(int32_t files_generated));
55 
56  MOCK_CONST_METHOD0(getFramesProcessed, int32_t());
57  MOCK_METHOD1(setFramesProcessed, void(int32_t frames_recorded));
58 
59  MOCK_CONST_METHOD0(getFramesRemaining, int32_t());
60  MOCK_METHOD1(setFramesRemaining, void(int32_t frames_remaining));
61 
62  MOCK_CONST_METHOD0(getInfo, std::string());
63  MOCK_METHOD1(setInfo, void(std::string const&));
64 
65  MOCK_CONST_METHOD0(getRemainingTime, double());
66  MOCK_METHOD1(setRemainingTime, void(double remaining_time));
67 
68  MOCK_CONST_METHOD0(getSizeRecorded, int32_t());
69  MOCK_METHOD1(setSizeRecorded, void(int32_t size_recorded));
70 
71  MOCK_CONST_METHOD0(getStartTime, double());
72  MOCK_METHOD1(setStartTime, void(double start_time));
73 
74  MOCK_CONST_METHOD0(getStatus, ::recif::RecStatusNames());
75  MOCK_METHOD1(setStatus, void(::recif::RecStatusNames status));
76 
77  MOCK_CONST_METHOD0(getTimeElapsed, double());
78  MOCK_METHOD1(setTimeElapsed, void(double time_elapsed));
79 
80  // Mal stuff
81  std::unique_ptr<recif::RecStatus> clone() const override {
82  return {};
83  }
84  std::unique_ptr<recif::RecStatus> cloneKey() const override {
85  return {};
86  }
87  bool hasKey() const override {
88  return false;
89  };
90  bool keyEquals(const recif::RecStatus& other) const override {
91  return false;
92  }
93 };
94 
95 } // namespace daq
96 #endif // #ifndef OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
97 // GCOVR_EXCL_STOP
MOCK_METHOD1(RecStart, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>(const std::shared_ptr<::recif::RecProperties > &))
MOCK_METHOD1(registerConnectionListener, elt::mal::rr::ListenerRegistration(elt::mal::rr::ClientRrEntity::ConnectionListener))
MOCK_METHOD1(RecStatus, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>(const std::string &))
MOCK_METHOD0(RecAbort, ::elt::mal::future< std::string >())
MOCK_METHOD0(RecStop, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
MOCK_METHOD1(RecWait, ::elt::mal::future< std::shared_ptr<::recif::RecWaitStatus >>(const std::shared_ptr< recif::RecWaitSpec > &))
MOCK_METHOD0(asyncConnect, ::elt::mal::future< void >())
MOCK_METHOD0(RecPause, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
MOCK_CONST_METHOD0(getMal, std::shared_ptr<::elt::mal::Mal >())
MOCK_METHOD0(RecContinue, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
MOCK_CONST_METHOD0(getTimeElapsed, double())
MOCK_CONST_METHOD0(getFilesGenerated, int32_t())
bool hasKey() const override
Definition: recifMock.hpp:87
bool keyEquals(const recif::RecStatus &other) const override
Definition: recifMock.hpp:90
MOCK_CONST_METHOD0(getDpFiles, std::vector< std::string >())
MOCK_METHOD1(setSizeRecorded, void(int32_t size_recorded))
MOCK_METHOD1(setFramesRemaining, void(int32_t frames_remaining))
MOCK_METHOD1(setEndTime, void(double end_time))
MOCK_CONST_METHOD0(getStatus, ::recif::RecStatusNames())
std::unique_ptr< recif::RecStatus > cloneKey() const override
Definition: recifMock.hpp:84
MOCK_CONST_METHOD0(getId, std::string())
MOCK_METHOD1(setTimeElapsed, void(double time_elapsed))
MOCK_METHOD1(setStatus, void(::recif::RecStatusNames status))
MOCK_CONST_METHOD0(getEndTime, double())
MOCK_CONST_METHOD0(getInfo, std::string())
MOCK_METHOD1(setFilesGenerated, void(int32_t files_generated))
MOCK_CONST_METHOD0(getFramesProcessed, int32_t())
std::unique_ptr< recif::RecStatus > clone() const override
Definition: recifMock.hpp:81
MOCK_CONST_METHOD0(getSizeRecorded, int32_t())
MOCK_CONST_METHOD0(getFramesRemaining, int32_t())
MOCK_METHOD1(setDpFiles, void(const std::vector< std::string > &))
MOCK_CONST_METHOD0(getRemainingTime, double())
MOCK_METHOD1(setRemainingTime, void(double remaining_time))
MOCK_CONST_METHOD0(getStartTime, double())
MOCK_METHOD1(setInfo, void(std::string const &))
MOCK_METHOD1(setId, void(const std::string &))
MOCK_METHOD1(setFramesProcessed, void(int32_t frames_recorded))
MOCK_METHOD1(setStartTime, void(double start_time))