blob: c1f89865db4209121599b4aea7343a03eb3f6f30 [file] [log] [blame]
Brandon Wyman3f1242f2020-01-28 13:11:25 -06001#pragma once
2
3#include "pmbus.hpp"
4#include "util_base.hpp"
5
6#include <gmock/gmock.h>
7
8namespace phosphor
9{
10namespace pmbus
11{
12class MockedPMBus : public PMBusBase
13{
14
15 public:
16 virtual ~MockedPMBus() = default;
17
18 MOCK_METHOD(uint64_t, read, (const std::string& name, Type type),
19 (override));
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050020 MOCK_METHOD(std::string, readString, (const std::string& name, Type type),
21 (override));
Brandon Wyman59a35792020-06-04 12:37:40 -050022 MOCK_METHOD(void, writeBinary,
23 (const std::string& name, std::vector<uint8_t> data, Type type),
24 (override));
Brandon Wyman9564e942020-11-10 14:01:42 -060025 MOCK_METHOD(void, findHwmonDir, (), (override));
Brandon Wyman4176d6b2020-10-07 17:41:06 -050026 MOCK_METHOD(const fs::path&, path, (), (const, override));
Brandon Wyman3f1242f2020-01-28 13:11:25 -060027};
28} // namespace pmbus
29
30namespace power
31{
32namespace psu
33{
Brandon Wymana1830a82021-03-12 16:03:55 -060034
Brandon Wyman3f1242f2020-01-28 13:11:25 -060035class MockedUtil : public UtilBase
36{
37 public:
38 virtual ~MockedUtil() = default;
39
40 MOCK_METHOD(bool, getPresence,
41 (sdbusplus::bus::bus & bus, const std::string& invpath),
42 (const, override));
43};
44
Brandon Wymana1830a82021-03-12 16:03:55 -060045const UtilBase& getUtils();
Brandon Wyman3f1242f2020-01-28 13:11:25 -060046
Brandon Wymana1830a82021-03-12 16:03:55 -060047void freeUtils();
Brandon Wyman3f1242f2020-01-28 13:11:25 -060048
49} // namespace psu
50} // namespace power
51
52} // namespace phosphor