blob: fc7d6586a977d50b1d033b48892096620835b145 [file] [log] [blame]
Brandon Wymana1830a82021-03-12 16:03:55 -06001#include "mock.hpp"
Brandon Wyman3f1242f2020-01-28 13:11:25 -06002
3namespace phosphor
4{
5namespace pmbus
6{
7
8std::unique_ptr<PMBusBase> createPMBus(std::uint8_t /*bus*/,
9 const std::string& /*address*/)
10{
11 return std::make_unique<MockedPMBus>();
12}
Brandon Wyman3f1242f2020-01-28 13:11:25 -060013} // namespace pmbus
Brandon Wymana1830a82021-03-12 16:03:55 -060014
15namespace power
16{
17namespace psu
18{
19static std::unique_ptr<MockedUtil> util;
20
21const UtilBase& getUtils()
22{
23 if (!util)
24 {
25 util = std::make_unique<MockedUtil>();
26 }
27 return *util;
28}
29
30void freeUtils()
31{
32 util.reset();
33}
34
B. J. Wyman681b2a32021-04-20 22:31:22 +000035std::unique_ptr<GPIOInterface> createGPIO(const std::string& /*namedGpio*/)
36{
37 return std::make_unique<MockedGPIOReader>();
38}
39
Brandon Wymana1830a82021-03-12 16:03:55 -060040} // namespace psu
41} // namespace power
Brandon Wyman3f1242f2020-01-28 13:11:25 -060042} // namespace phosphor