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