ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
daqifMock.hpp
Go to the documentation of this file.
1 #ifndef DAQ_OCM_SERVER_MOCK_OCM_SERVER_IF_HPP_
2 #define DAQ_OCM_SERVER_MOCK_OCM_SERVER_IF_HPP_
3 
4 #include <gmock/gmock.h>
5 #include <Daqif.hpp>
6 
7 namespace daqif {
8 
9 struct DaqReplyMock : DaqReply {
10  MOCK_CONST_METHOD0(getId, std::string());
11  MOCK_METHOD1(setId, void(std::string const&));
12 
13  bool hasKey() const {
14  return false;
15  }
16  bool keyEquals(const DaqReply& other) const {
17  return false;
18  }
19  std::unique_ptr<DaqReply> cloneKey() const {
20  return {};
21  }
22  std::unique_ptr<DaqReply> clone() const {
23  return {};
24  }
25  double getTimestamp() const { // NOLINT
26  return 0.0;
27  }
28  void setTimestamp(double) { // NOLINT
29  }
30 };
31 
32 struct DaqStatusMock : DaqStatus {
33  MOCK_CONST_METHOD0(getId, std::string());
34  MOCK_METHOD1(setId, void(std::string const&));
35  MOCK_CONST_METHOD0(getMessage, std::string());
36  MOCK_METHOD1(setMessage, void(std::string const&));
37  MOCK_CONST_METHOD0(getError, bool());
38  MOCK_METHOD1(setError, void(bool const&));
39  MOCK_CONST_METHOD0(getFiles, std::vector<std::string>());
40  MOCK_METHOD1(setFiles, void(std::vector<std::string> const&));
41  MOCK_CONST_METHOD0(getSubState, daqif::DaqSubState());
42  MOCK_METHOD1(setSubState, void(daqif::DaqSubState));
43  MOCK_CONST_METHOD0(getState, daqif::DaqState());
44  MOCK_METHOD1(setState, void(daqif::DaqState));
45 
46  bool hasKey() const {
47  return false;
48  }
49  bool keyEquals(const DaqStatus& other) const {
50  return false;
51  }
52  std::unique_ptr<DaqStatus> cloneKey() const {
53  return {};
54  }
55  std::unique_ptr<DaqStatus> clone() const {
56  return {};
57  }
58  double getTimestamp() const {
59  return 0.0;
60  }
61  void setTimestamp(double) {
62  }
63 };
64 
65 } // namespace daqif
66 #endif // #ifndef DAQ_OCM_SERVER_MOCK_OCM_SERVER_IF_HPP_
std::unique_ptr< DaqReply > clone() const
Definition: daqifMock.hpp:22
double getTimestamp() const
Definition: daqifMock.hpp:25
MOCK_CONST_METHOD0(getId, std::string())
void setTimestamp(double)
Definition: daqifMock.hpp:28
MOCK_METHOD1(setId, void(std::string const &))
bool keyEquals(const DaqReply &other) const
Definition: daqifMock.hpp:16
bool hasKey() const
Definition: daqifMock.hpp:13
std::unique_ptr< DaqReply > cloneKey() const
Definition: daqifMock.hpp:19
std::unique_ptr< DaqStatus > clone() const
Definition: daqifMock.hpp:55
MOCK_CONST_METHOD0(getMessage, std::string())
bool keyEquals(const DaqStatus &other) const
Definition: daqifMock.hpp:49
double getTimestamp() const
Definition: daqifMock.hpp:58
MOCK_METHOD1(setFiles, void(std::vector< std::string > const &))
MOCK_CONST_METHOD0(getError, bool())
void setTimestamp(double)
Definition: daqifMock.hpp:61
MOCK_CONST_METHOD0(getSubState, daqif::DaqSubState())
MOCK_METHOD1(setState, void(daqif::DaqState))
MOCK_METHOD1(setSubState, void(daqif::DaqSubState))
bool hasKey() const
Definition: daqifMock.hpp:46
MOCK_METHOD1(setError, void(bool const &))
MOCK_CONST_METHOD0(getState, daqif::DaqState())
MOCK_METHOD1(setMessage, void(std::string const &))
std::unique_ptr< DaqStatus > cloneKey() const
Definition: daqifMock.hpp:52
MOCK_CONST_METHOD0(getId, std::string())
MOCK_CONST_METHOD0(getFiles, std::vector< std::string >())
MOCK_METHOD1(setId, void(std::string const &))