ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
daqifMock.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 DpmDaqControlAsync
7  */
8 // GCOVR_EXCL_START
9 #ifndef OCM_DAQ_TEST_MOCK_DAQIF_ASYNC_MOCK_HPP
10 #define OCM_DAQ_TEST_MOCK_DAQIF_ASYNC_MOCK_HPP
11 #include <Daqif.hpp>
12 #include <daq/config.hpp>
13 #include <gmock/gmock.h>
14 
15 namespace daq {
16 
17 struct DpmDaqControlAsyncMock : daqif::DpmDaqControlAsync {
18  MOCK_METHOD(::elt::mal::future<std::shared_ptr<::daqif::DaqReply>>,
19  QueueDaq,
20  (const std::string& specification),
21  (override));
22  MOCK_METHOD(::elt::mal::future<std::shared_ptr<::daqif::DaqReply>>,
23  AbortDaq,
24  (const std::string& id),
25  (override));
27  ::elt::mal::future<std::shared_ptr<::daqif::DaqStatus>>,
28  GetDaqStatus,
29  (const std::string& id),
30  (override));
31  MOCK_METHOD(::elt::mal::future<std::vector<std::shared_ptr<::daqif::DaqStatus>>>,
32  GetActiveDaqs,
33  (),
34  (override));
35 
36  // mal API stuff
37  MOCK_METHOD(std::shared_ptr<::elt::mal::Mal>, getMal, (), (const, override));
38  MOCK_METHOD(::elt::mal::future<void>, asyncConnect, (), (override));
39  MOCK_METHOD(elt::mal::rr::ListenerRegistration,
40  registerConnectionListener,
41  (elt::mal::rr::ClientRrEntity::ConnectionListener),
42  (override));
43 };
44 #if 0
45 struct RecStatusMock : recif::RecStatus {
46 public:
47  MOCK_CONST_METHOD0(getId, std::string());
48  MOCK_METHOD1(setId, void(const std::string&));
49 
50  MOCK_CONST_METHOD0(getDpFiles, std::vector<std::string>());
51  MOCK_METHOD1(setDpFiles, void(const std::vector<std::string>&));
52 
53  MOCK_CONST_METHOD0(getEndTime, double());
54  MOCK_METHOD1(setEndTime, void(double end_time));
55 
56  MOCK_CONST_METHOD0(getFilesGenerated, int32_t());
57  MOCK_METHOD1(setFilesGenerated, void(int32_t files_generated));
58 
59  MOCK_CONST_METHOD0(getFramesProcessed, int32_t());
60  MOCK_METHOD1(setFramesProcessed, void(int32_t frames_recorded));
61 
62  MOCK_CONST_METHOD0(getFramesRemaining, int32_t());
63  MOCK_METHOD1(setFramesRemaining, void(int32_t frames_remaining));
64 
65  MOCK_CONST_METHOD0(getInfo, std::string());
66  MOCK_METHOD1(setInfo, void(std::string const&));
67 
68  MOCK_CONST_METHOD0(getRemainingTime, double());
69  MOCK_METHOD1(setRemainingTime, void(double remaining_time));
70 
71  MOCK_CONST_METHOD0(getSizeRecorded, int32_t());
72  MOCK_METHOD1(setSizeRecorded, void(int32_t size_recorded));
73 
74  MOCK_CONST_METHOD0(getStartTime, double());
75  MOCK_METHOD1(setStartTime, void(double start_time));
76 
77  MOCK_CONST_METHOD0(getStatus, ::recif::RecStatusNames());
78  MOCK_METHOD1(setStatus, void(::recif::RecStatusNames status));
79 
80  MOCK_CONST_METHOD0(getTimeElapsed, double());
81  MOCK_METHOD1(setTimeElapsed, void(double time_elapsed));
82 
83  // Mal stuff
84  std::unique_ptr<recif::RecStatus> clone() const override {
85  return {};
86  }
87  std::unique_ptr<recif::RecStatus> cloneKey() const override {
88  return {};
89  }
90  bool hasKey() const override {
91  return false;
92  };
93  bool keyEquals(const recif::RecStatus& other) const override {
94  return false;
95  }
96 };
97 #endif
98 } // namespace daq
99 #endif // #ifndef OCM_DAQ_TEST_MOCK_DAQIF_ASYNC_MOCK_HPP
100 // GCOVR_EXCL_STOP
MOCK_METHOD(::elt::mal::future< std::shared_ptr<::daqif::DaqReply >>, QueueDaq,(const std::string &specification),(override))
MOCK_METHOD(::elt::mal::future< std::vector< std::shared_ptr<::daqif::DaqStatus >>>, GetActiveDaqs,(),(override))
MOCK_METHOD(::elt::mal::future< std::shared_ptr<::daqif::DaqReply >>, AbortDaq,(const std::string &id),(override))
MOCK_METHOD(std::shared_ptr<::elt::mal::Mal >, getMal,(),(const, override))
MOCK_METHOD(::elt::mal::future< void >, asyncConnect,(),(override))
MOCK_METHOD(elt::mal::rr::ListenerRegistration, registerConnectionListener,(elt::mal::rr::ClientRrEntity::ConnectionListener),(override))
MOCK_METHOD(::elt::mal::future< std::shared_ptr<::daqif::DaqStatus >>, GetDaqStatus,(const std::string &id),(override))
bool hasKey() const override
Definition: recifMock.hpp:87
bool keyEquals(const recif::RecStatus &other) const override
Definition: recifMock.hpp:90
std::unique_ptr< recif::RecStatus > cloneKey() const override
Definition: recifMock.hpp:84
MOCK_CONST_METHOD0(getId, std::string())
std::unique_ptr< recif::RecStatus > clone() const override
Definition: recifMock.hpp:81
MOCK_METHOD1(setId, void(const std::string &))