Brandon Wyman | a1830a8 | 2021-03-12 16:03:55 -0600 | [diff] [blame] | 1 | #include "mock.hpp" |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 2 | |
| 3 | namespace phosphor |
| 4 | { |
| 5 | namespace pmbus |
| 6 | { |
| 7 | |
| 8 | std::unique_ptr<PMBusBase> createPMBus(std::uint8_t /*bus*/, |
| 9 | const std::string& /*address*/) |
| 10 | { |
| 11 | return std::make_unique<MockedPMBus>(); |
| 12 | } |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 13 | } // namespace pmbus |
Brandon Wyman | a1830a8 | 2021-03-12 16:03:55 -0600 | [diff] [blame] | 14 | |
| 15 | namespace power |
| 16 | { |
| 17 | namespace psu |
| 18 | { |
| 19 | static std::unique_ptr<MockedUtil> util; |
| 20 | |
| 21 | const UtilBase& getUtils() |
| 22 | { |
| 23 | if (!util) |
| 24 | { |
| 25 | util = std::make_unique<MockedUtil>(); |
| 26 | } |
| 27 | return *util; |
| 28 | } |
| 29 | |
| 30 | void freeUtils() |
| 31 | { |
| 32 | util.reset(); |
| 33 | } |
| 34 | |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 35 | std::unique_ptr<GPIOInterface> createGPIO(const std::string& /*namedGpio*/) |
| 36 | { |
| 37 | return std::make_unique<MockedGPIOReader>(); |
| 38 | } |
| 39 | |
Brandon Wyman | a1830a8 | 2021-03-12 16:03:55 -0600 | [diff] [blame] | 40 | } // namespace psu |
| 41 | } // namespace power |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 42 | } // namespace phosphor |