| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_amdpmautolegacy.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/pmautolegacy.h"cxx . . $ `<file>/src/core/components/controls/amd/pm/auto/pmautolegacy.h`/ |
| 9 | |
| 10 | namespace Testscxx . . $ Tests/::AMDcxx . . $ Tests/AMD/::PMAutoLegacycxx . . $ Tests/AMD/PMAutoLegacy/ { |
| 11 | |
| 12 | class PMAutoLegacyTestAdaptercxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter# : public ::AMDcxx . . $ AMD/::PMAutoLegacycxx . . $ AMD/PMAutoLegacy# |
| 13 | { |
| 14 | public: |
| 15 | using ::AMDcxx . . $ AMD/::PMAutoLegacycxx . . $ AMD/PMAutoLegacy#::PMAutoLegacycxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter#PMAutoLegacyTestAdapter(cceca32c77a8ca5b).; |
| 16 | |
| 17 | using ::AMDcxx . . $ AMD/::PMAutoLegacycxx . . $ AMD/PMAutoLegacy#::cleanControlcxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter#cleanControl(151e9138769f295e).; |
| 18 | using ::AMDcxx . . $ AMD/::PMAutoLegacycxx . . $ AMD/PMAutoLegacy#::syncControlcxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter#syncControl(151e9138769f295e).; |
| 19 | }; |
| 20 | |
| 21 | TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("AMD PMAutoLegacy tests", "[GPU][AMD][PM][PMAuto][Legacy]") |
| 22 | { |
| 23 | stdcxx . . $ std/::stringcxx . . $ std/string# const powerMethodPathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"power_method"}; |
| 24 | stdcxx . . $ std/::stringcxx . . $ std/string# const powerProfilePathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"power_profile"}; |
| 25 | CommandQueueStubcxx . . $ CommandQueueStub# ctlCmds; |
| 26 | |
| 27 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate clean control commands") |
| 28 | { |
| 29 | PMAutoLegacyTestAdaptercxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 30 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>()); |
| 31 | ts.cleanControlcxx . . $ AMD/PMAutoLegacy#cleanControl(151e9138769f295e).(ctlCmds); |
| 32 | |
| 33 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 34 | } |
| 35 | |
| 36 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands when is synced") |
| 37 | { |
| 38 | PMAutoLegacyTestAdaptercxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter# ts( |
| 39 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerMethodPath, "profile"), |
| 40 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerProfilePath, "auto")); |
| 41 | ts.syncControlcxx . . $ AMD/PMAutoLegacy#syncControl(151e9138769f295e).(ctlCmds); |
| 42 | |
| 43 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 44 | } |
| 45 | |
| 46 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate sync control commands when...") |
| 47 | { |
| 48 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("power_method is out of sync") |
| 49 | { |
| 50 | PMAutoLegacyTestAdaptercxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter# ts( |
| 51 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerMethodPath, "_other_"), |
| 52 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerProfilePath, "auto")); |
| 53 | ts.syncControlcxx . . $ AMD/PMAutoLegacy#syncControl(151e9138769f295e).(ctlCmds); |
| 54 | |
| 55 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 2); |
| 56 | |
| 57 | auto &[cmd0Path, cmd0Value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 58 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Path == powerMethodPath); |
| 59 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Value == "profile"); |
| 60 | |
| 61 | auto &[cmd1Path, cmd1Value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().backcxx . . $ std/vector#back(af0004c3ce7cab93).(); |
| 62 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Path == powerProfilePath); |
| 63 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Value == "auto"); |
| 64 | } |
| 65 | |
| 66 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("power_profile is out of sync") |
| 67 | { |
| 68 | PMAutoLegacyTestAdaptercxx . . $ Tests/AMD/PMAutoLegacy/PMAutoLegacyTestAdapter# ts( |
| 69 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerMethodPath, "profile"), |
| 70 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(powerProfilePath, "_other_")); |
| 71 | ts.syncControlcxx . . $ AMD/PMAutoLegacy#syncControl(151e9138769f295e).(ctlCmds); |
| 72 | |
| 73 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 2); |
| 74 | |
| 75 | auto &[cmd0Path, cmd0Value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 76 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Path == powerMethodPath); |
| 77 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Value == "profile"); |
| 78 | |
| 79 | auto &[cmd1Path, cmd1Value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().backcxx . . $ std/vector#back(af0004c3ce7cab93).(); |
| 80 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Path == powerProfilePath); |
| 81 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Value == "auto"); |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | } // namespace Tests::AMD::PMAutoLegacy |