| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_amdpmautor600.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include <catch2/catch_all.hpp> |
| 5 | |
| 6 | #include "common/commandqueuestub.h"cxx . . $ `<file>/tests/src/common/commandqueuestub.h`/ |
| 7 | #include "common/stringdatasourcestub.h"cxx . . $ `<file>/tests/src/common/stringdatasourcestub.h`/ |
| 8 | #include "core/components/controls/amd/pm/auto/pmautor600.h"cxx . . $ `<file>/src/core/components/controls/amd/pm/auto/pmautor600.h`/ |
| 9 | |
| 10 | namespace Testscxx . . $ Tests/::AMDcxx . . $ Tests/AMD/::PMAutoR600cxx . . $ Tests/AMD/PMAutoR600/ { |
| 11 | |
| 12 | class PMAutoR600TestAdaptercxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter# : public ::AMDcxx . . $ AMD/::PMAutoR600cxx . . $ AMD/PMAutoR600# |
| 13 | { |
| 14 | public: |
| 15 | using ::AMDcxx . . $ AMD/::PMAutoR600cxx . . $ AMD/PMAutoR600#::PMAutoR600cxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter#PMAutoR600TestAdapter(6b11c6427b3e4d1b).; |
| 16 | |
| 17 | using ::AMDcxx . . $ AMD/::PMAutoR600cxx . . $ AMD/PMAutoR600#::cleanControlcxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter#cleanControl(151e9138769f295e).; |
| 18 | using ::AMDcxx . . $ AMD/::PMAutoR600cxx . . $ AMD/PMAutoR600#::syncControlcxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter#syncControl(151e9138769f295e).; |
| 19 | }; |
| 20 | |
| 21 | TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("AMD PMAutoR600 tests", "[GPU][AMD][PM][PMAuto][R600]") |
| 22 | { |
| 23 | stdcxx . . $ std/::stringcxx . . $ std/string# const perfLevelPathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"power_dpm_force_performance_level"}; |
| 24 | CommandQueueStubcxx . . $ CommandQueueStub# ctlCmds; |
| 25 | |
| 26 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate clean control commands") |
| 27 | { |
| 28 | PMAutoR600TestAdaptercxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>()); |
| 29 | ts.cleanControlcxx . . $ AMD/PMAutoR600#cleanControl(151e9138769f295e).(ctlCmds); |
| 30 | |
| 31 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 32 | } |
| 33 | |
| 34 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands when is synced") |
| 35 | { |
| 36 | PMAutoR600TestAdaptercxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter# ts( |
| 37 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(perfLevelPath, "auto")); |
| 38 | ts.syncControlcxx . . $ AMD/PMAutoR600#syncControl(151e9138769f295e).(ctlCmds); |
| 39 | |
| 40 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 41 | } |
| 42 | |
| 43 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate sync control commands when is out of sync") |
| 44 | { |
| 45 | PMAutoR600TestAdaptercxx . . $ Tests/AMD/PMAutoR600/PMAutoR600TestAdapter# ts( |
| 46 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(perfLevelPath, "_other_")); |
| 47 | ts.syncControlcxx . . $ AMD/PMAutoR600#syncControl(151e9138769f295e).(ctlCmds); |
| 48 | |
| 49 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1); |
| 50 | auto &[path, value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 51 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(path == perfLevelPath); |
| 52 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(value == "auto"); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | } // namespace Tests::AMD::PMAutoR600 |