diff options
| author | Patrick Venture <venture@google.com> | 2018-06-13 09:02:13 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2018-06-22 08:25:22 -0700 |
| commit | 0df7c0fb8010abebe2239ca997e8b0036ad4263b (patch) | |
| tree | 36c683e19f5686b769868b2f09f8c4105b2d30a6 /test | |
| parent | d0c75666312b276784cfd8e760cfdf806cf983cb (diff) | |
| download | phosphor-pid-control-0df7c0fb8010abebe2239ca997e8b0036ad4263b.tar.gz phosphor-pid-control-0df7c0fb8010abebe2239ca997e8b0036ad4263b.zip | |
dbus: transition to interface for testing
To make testing easier, the dbus objects now receive a
helper interface to use instead of calling into a helper module.
Tested: Ran on quanta-q71l board and it behaved as expected.
Change-Id: I2521d9c75aec76e92d2e26dc044d01011e44d552
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/dbushelper_mock.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/dbushelper_mock.hpp b/test/dbushelper_mock.hpp new file mode 100644 index 0000000..23dd81c --- /dev/null +++ b/test/dbushelper_mock.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include <gmock/gmock.h> +#include <sdbusplus/bus.hpp> +#include <string> + +#include "dbus/util.hpp" + +class DbusHelperMock : public DbusHelperInterface +{ + public: + virtual ~DbusHelperMock() = default; + + MOCK_METHOD3(GetService, std::string(sdbusplus::bus::bus&, + const std::string&, + const std::string&)); + MOCK_METHOD4(GetProperties, void(sdbusplus::bus::bus&, + const std::string&, + const std::string&, + struct SensorProperties*)); +}; |

