blob: a68628b6cd2c1b65ce1fc732e9f8a82a4462fb28 [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
35} // namespace psu
36} // namespace power
Brandon Wyman3f1242f2020-01-28 13:11:25 -060037} // namespace phosphor