Shawn McCarney | 4af83db | 2024-02-08 16:33:44 -0600 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2024 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
| 18 | #include "power_sequencer_device.hpp" |
| 19 | |
| 20 | #include <gmock/gmock.h> |
| 21 | |
| 22 | namespace phosphor::power::sequencer |
| 23 | { |
| 24 | |
| 25 | /** |
| 26 | * @class MockDevice |
| 27 | * |
| 28 | * Mock implementation of the PowerSequencerDevice interface. |
| 29 | */ |
| 30 | class MockDevice : public PowerSequencerDevice |
| 31 | { |
| 32 | public: |
| 33 | // Specify which compiler-generated methods we want |
| 34 | MockDevice() = default; |
| 35 | MockDevice(const MockDevice&) = delete; |
| 36 | MockDevice(MockDevice&&) = delete; |
| 37 | MockDevice& operator=(const MockDevice&) = delete; |
| 38 | MockDevice& operator=(MockDevice&&) = delete; |
| 39 | virtual ~MockDevice() = default; |
| 40 | |
| 41 | MOCK_METHOD(const std::string&, getName, (), (const, override)); |
Shawn McCarney | f47a7a7 | 2024-04-18 16:59:33 -0500 | [diff] [blame] | 42 | MOCK_METHOD(const std::vector<std::unique_ptr<Rail>>&, getRails, (), |
| 43 | (const, override)); |
Shawn McCarney | 4af83db | 2024-02-08 16:33:44 -0600 | [diff] [blame] | 44 | MOCK_METHOD(std::vector<int>, getGPIOValues, (), (override)); |
| 45 | MOCK_METHOD(uint16_t, getStatusWord, (uint8_t page), (override)); |
| 46 | MOCK_METHOD(uint8_t, getStatusVout, (uint8_t page), (override)); |
| 47 | MOCK_METHOD(double, getReadVout, (uint8_t page), (override)); |
| 48 | MOCK_METHOD(double, getVoutUVFaultLimit, (uint8_t page), (override)); |
Shawn McCarney | 4af83db | 2024-02-08 16:33:44 -0600 | [diff] [blame] | 49 | MOCK_METHOD(bool, hasPgoodFault, |
Shawn McCarney | f47a7a7 | 2024-04-18 16:59:33 -0500 | [diff] [blame] | 50 | (Services & services, const std::string& powerSupplyError, |
| 51 | std::string& error, |
Shawn McCarney | 2495659 | 2024-02-19 18:58:57 -0600 | [diff] [blame] | 52 | (std::map<std::string, std::string> & additionalData)), |
Shawn McCarney | 4af83db | 2024-02-08 16:33:44 -0600 | [diff] [blame] | 53 | (override)); |
| 54 | }; |
| 55 | |
| 56 | } // namespace phosphor::power::sequencer |