1 #pragma once 2 3 #include "pmbus.hpp" 4 #include "util_base.hpp" 5 6 #include <gmock/gmock.h> 7 8 namespace phosphor 9 { 10 namespace pmbus 11 { 12 class 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)); 20 MOCK_METHOD(std::string, readString, (const std::string& name, Type type), 21 (override)); 22 MOCK_METHOD(void, writeBinary, 23 (const std::string& name, std::vector<uint8_t> data, Type type), 24 (override)); 25 MOCK_METHOD(void, findHwmonDir, (), (override)); 26 MOCK_METHOD(const fs::path&, path, (), (const, override)); 27 }; 28 } // namespace pmbus 29 30 namespace power 31 { 32 namespace psu 33 { 34 35 class 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 45 const UtilBase& getUtils(); 46 47 void freeUtils(); 48 49 } // namespace psu 50 } // namespace power 51 52 } // namespace phosphor 53