blob: 94a4911018e2de7e55726c1041340bd227daae54 [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
Adriana Kobylak3ca062a2021-10-20 15:27:23 +000035std::unique_ptr<GPIOInterfaceBase> createGPIO(const std::string& /*namedGpio*/)
B. J. Wyman681b2a32021-04-20 22:31:22 +000036{
Adriana Kobylak3ca062a2021-10-20 15:27:23 +000037 return std::make_unique<MockedGPIOInterface>();
B. J. Wyman681b2a32021-04-20 22:31:22 +000038}
39
Brandon Wymana1830a82021-03-12 16:03:55 -060040} // namespace psu
41} // namespace power
Brandon Wyman3f1242f2020-01-28 13:11:25 -060042} // namespace phosphor