| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "core/components/controls/amd/pm/handlers/ippdpmhandler.h" |
| 7 | #include <catch2/catch_all.hpp> |
| 8 | #include <catch2/trompeloeil.hpp> |
| 9 | |
| 10 | extern template struct trompeloeil::reporter<trompeloeil::specialized>; |
| 11 | |
| 12 | namespace Tests::AMD { |
| 13 | |
| 14 | class PpDpmHandlerMock : public ::AMD::IPpDpmHandler |
| 15 | { |
| 16 | public: |
| 17 | PpDpmHandlerMock( |
| 18 | std::vector<std::pair<unsigned int, units::frequency::megahertz_t>> states = |
| 19 | {}) |
| 20 | : states_(std::move(states)) |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | std::vector<std::pair<unsigned int, units::frequency::megahertz_t>> const & |
| 25 | states() const override |
| 26 | { |
| 27 | return states_; |
| 28 | } |
| 29 | |
| 30 | MAKE_CONST_MOCK0(active, std::vector<unsigned int> const &(), override); |
| 31 | MAKE_MOCK1(activate, void(std::vector<unsigned int> const &), override); |
| 32 | MAKE_MOCK0(saveState, void(), override); |
| 33 | MAKE_MOCK1(restoreState, void(ICommandQueue &), override); |
| 34 | MAKE_MOCK1(reset, void(ICommandQueue &), override); |
| 35 | MAKE_MOCK1(sync, void(ICommandQueue &), override); |
| 36 | |
| 37 | private: |
| 38 | std::vector<std::pair<unsigned int, units::frequency::megahertz_t>> const states_; |
| 39 | }; |
| 40 | |
| 41 | } // namespace Tests::AMD |