summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-06-08 18:47:46 -0700
committerPatrick Venture <venture@google.com>2018-06-13 09:58:57 -0700
commit6246393df4181d3f689d762bdb7beecb39fcb56d (patch)
treeacb9a8adabb4f522a74324964830fefb250044bb /test
parent7a841b624997ecc17db7251b9170c210507dc373 (diff)
downloadphosphor-pid-control-6246393df4181d3f689d762bdb7beecb39fcb56d.tar.gz
phosphor-pid-control-6246393df4181d3f689d762bdb7beecb39fcb56d.zip
test: add read and write interface mocks
The pluggable sensor object receives a reader and writer interface. These are now mocked to enable some testing that involves Pluggable Sensors. Change-Id: If2d121ab47a2c044b0f3fd3465bfe45cf26c4f98 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/readinterface_mock.hpp11
-rw-r--r--test/writeinterface_mock.hpp14
2 files changed, 25 insertions, 0 deletions
diff --git a/test/readinterface_mock.hpp b/test/readinterface_mock.hpp
new file mode 100644
index 0000000..0735559
--- /dev/null
+++ b/test/readinterface_mock.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "interfaces.hpp"
+
+class ReadInterfaceMock : public ReadInterface
+{
+ public:
+ virtual ~ReadInterfaceMock() = default;
+
+ MOCK_METHOD0(read, ReadReturn());
+};
diff --git a/test/writeinterface_mock.hpp b/test/writeinterface_mock.hpp
new file mode 100644
index 0000000..4fab5fb
--- /dev/null
+++ b/test/writeinterface_mock.hpp
@@ -0,0 +1,14 @@
+#pragma once
+
+#include "interfaces.hpp"
+
+class WriteInterfaceMock : public WriteInterface
+{
+ public:
+ virtual ~WriteInterfaceMock() = default;
+
+ WriteInterfaceMock(int64_t min, int64_t max)
+ : WriteInterface(min, max) {}
+
+ MOCK_METHOD1(write, void(double));
+};
OpenPOWER on IntegriCloud