xref: /openbmc/phosphor-power/phosphor-power-sequencer/test/mock_gpio.hpp (revision e6d7f4cb088171139a2ca33e71137806d887da8d)
1*e6d7f4cbSShawn McCarney /**
2*e6d7f4cbSShawn McCarney  * Copyright © 2025 IBM Corporation
3*e6d7f4cbSShawn McCarney  *
4*e6d7f4cbSShawn McCarney  * Licensed under the Apache License, Version 2.0 (the "License");
5*e6d7f4cbSShawn McCarney  * you may not use this file except in compliance with the License.
6*e6d7f4cbSShawn McCarney  * You may obtain a copy of the License at
7*e6d7f4cbSShawn McCarney  *
8*e6d7f4cbSShawn McCarney  *     http://www.apache.org/licenses/LICENSE-2.0
9*e6d7f4cbSShawn McCarney  *
10*e6d7f4cbSShawn McCarney  * Unless required by applicable law or agreed to in writing, software
11*e6d7f4cbSShawn McCarney  * distributed under the License is distributed on an "AS IS" BASIS,
12*e6d7f4cbSShawn McCarney  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*e6d7f4cbSShawn McCarney  * See the License for the specific language governing permissions and
14*e6d7f4cbSShawn McCarney  * limitations under the License.
15*e6d7f4cbSShawn McCarney  */
16*e6d7f4cbSShawn McCarney #pragma once
17*e6d7f4cbSShawn McCarney 
18*e6d7f4cbSShawn McCarney #include "gpio.hpp"
19*e6d7f4cbSShawn McCarney 
20*e6d7f4cbSShawn McCarney #include <gmock/gmock.h>
21*e6d7f4cbSShawn McCarney 
22*e6d7f4cbSShawn McCarney namespace phosphor::power::sequencer
23*e6d7f4cbSShawn McCarney {
24*e6d7f4cbSShawn McCarney 
25*e6d7f4cbSShawn McCarney /**
26*e6d7f4cbSShawn McCarney  * @class MockGPIO
27*e6d7f4cbSShawn McCarney  *
28*e6d7f4cbSShawn McCarney  * Mock implementation of the GPIO interface.
29*e6d7f4cbSShawn McCarney  */
30*e6d7f4cbSShawn McCarney class MockGPIO : public GPIO
31*e6d7f4cbSShawn McCarney {
32*e6d7f4cbSShawn McCarney   public:
33*e6d7f4cbSShawn McCarney     MockGPIO() = default;
34*e6d7f4cbSShawn McCarney     MockGPIO(const MockGPIO&) = delete;
35*e6d7f4cbSShawn McCarney     MockGPIO(MockGPIO&&) = delete;
36*e6d7f4cbSShawn McCarney     MockGPIO& operator=(const MockGPIO&) = delete;
37*e6d7f4cbSShawn McCarney     MockGPIO& operator=(MockGPIO&&) = delete;
38*e6d7f4cbSShawn McCarney     virtual ~MockGPIO() = default;
39*e6d7f4cbSShawn McCarney 
40*e6d7f4cbSShawn McCarney     MOCK_METHOD(void, request, (RequestType type), (override));
41*e6d7f4cbSShawn McCarney     MOCK_METHOD(int, getValue, (), (override));
42*e6d7f4cbSShawn McCarney     MOCK_METHOD(void, setValue, (int value), (override));
43*e6d7f4cbSShawn McCarney     MOCK_METHOD(void, release, (), (override));
44*e6d7f4cbSShawn McCarney };
45*e6d7f4cbSShawn McCarney 
46*e6d7f4cbSShawn McCarney } // namespace phosphor::power::sequencer
47