| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_amdpmpowerprofile.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include <catch2/catch_all.hpp> |
| 5 | #include <catch2/trompeloeil.hpp> |
| 6 | |
| 7 | #include "common/commandqueuestub.h"cxx . . $ `<file>/tests/src/common/commandqueuestub.h`/ |
| 8 | #include "common/stringdatasourcestub.h"cxx . . $ `<file>/tests/src/common/stringdatasourcestub.h`/ |
| 9 | #include "core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofile.h"cxx . . $ `<file>/src/core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofile.h`/ |
| 10 | #include "core/idatasource.h"cxx . . $ `<file>/src/core/idatasource.h`/ |
| 11 | |
| 12 | extern template struct trompeloeil::reportercxx . . $ trompeloeil/reporter#<trompeloeilcxx . . $ trompeloeil/::specializedcxx . . $ trompeloeil/specialized#>; |
| 13 | |
| 14 | namespace Testscxx . . $ Tests/::AMDcxx . . $ Tests/AMD/::PMPowerProfilecxx . . $ Tests/AMD/PMPowerProfile/ { |
| 15 | |
| 16 | class PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# : public ::AMDcxx . . $ AMD/::PMPowerProfilecxx . . $ AMD/PMPowerProfile# |
| 17 | { |
| 18 | public: |
| 19 | using ::AMDcxx . . $ AMD/::PMPowerProfilecxx . . $ AMD/PMPowerProfile#::PMPowerProfilecxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#PMPowerProfileTestAdapter(5b391d6c516db30e).; |
| 20 | |
| 21 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::cleanControlcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#cleanControl(151e9138769f295e).; |
| 22 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::exportControlcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#exportControl(40299682ab9c8676).; |
| 23 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::importControlcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#importControl(4f796e3ecd5dcd94).; |
| 24 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::modecxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#mode(f4fff0029955a25f).; |
| 25 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::modescxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#modes(f5f2959be38ccc08).; |
| 26 | using PMPowerProfilecxx . . $ AMD/PMPowerProfile#::syncControlcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter#syncControl(151e9138769f295e).; |
| 27 | }; |
| 28 | |
| 29 | class PMPowerProfileImporterStubcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub# : public ::AMDcxx . . $ AMD/::PMPowerProfilecxx . . $ AMD/PMPowerProfile#::Importercxx . . $ AMD/PMPowerProfile#Importer# |
| 30 | { |
| 31 | public: |
| 32 | PMPowerProfileImporterStubcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#PMPowerProfileImporterStub(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# mode) |
| 33 | : mode_cxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#mode_.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(mode)) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<Importablecxx . . $ Importable#::Importercxx . . $ Importable#Importer#>> |
| 38 | provideImportercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#provideImporter(c13a3bcac0db4745).(Itemcxx . . $ Item# const &) override |
| 39 | { |
| 40 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 41 | } |
| 42 | |
| 43 | bool provideActivecxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#provideActive(50ce9a9e25b4a850).() const override |
| 44 | { |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | stdcxx . . $ std/::stringcxx . . $ std/string# const &providePMPowerProfileModecxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#providePMPowerProfileMode(f4fff0029955a25f).() const override |
| 49 | { |
| 50 | return mode_cxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#mode_.; |
| 51 | } |
| 52 | |
| 53 | private: |
| 54 | stdcxx . . $ std/::stringcxx . . $ std/string# mode_cxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#mode_.; |
| 55 | }; |
| 56 | |
| 57 | class PMPowerProfileExporterMockcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileExporterMock# : public ::AMDcxx . . $ AMD/::PMPowerProfilecxx . . $ AMD/PMPowerProfile#::Exportercxx . . $ AMD/PMPowerProfile#Exporter# |
| 58 | { |
| 59 | public: |
| 60 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takePMPowerProfileModes, void(std::vector<std::string> const &), |
| 61 | override); |
| 62 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takePMPowerProfileMode, void(std::string const &), override); |
| 63 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeActive, void(bool), override); |
| 64 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!( |
| 65 | provideExporter, |
| 66 | std::optional<std::reference_wrapper<Exportable::Exporter>>(Item const &), |
| 67 | override); |
| 68 | }; |
| 69 | |
| 70 | class OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub# : public IDataSourcecxx . . $ IDataSource#<stdcxx . . $ std/::optionalcxx . . $ std/optional#<int>> |
| 71 | { |
| 72 | public: |
| 73 | OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#OptionalIntDataSourceStub(a9d2b2372fa229c8).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# source = ""cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., |
| 74 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> data = stdcxx . . $ std/optional#optional(eb2253fdec8870b5).::nulloptcxx . . $ std/nullopt., |
| 75 | bool success = true) noexcept |
| 76 | : source_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#source_.(source) |
| 77 | , data_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#data_.(data) |
| 78 | , success_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#success_.(success) |
| 79 | { |
| 80 | } |
| 81 | |
| 82 | stdcxx . . $ std/::stringcxx . . $ std/string# sourcecxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#source(219584694fe2b248).() const override |
| 83 | { |
| 84 | return source_cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).; |
| 85 | } |
| 86 | |
| 87 | bool readcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#read(6cbfb13adddead80).(stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> &data) override |
| 88 | { |
| 89 | data =cxx . . $ std/optional#`operator=`(f6fa8f39d0f4a155). data_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#data_.; |
| 90 | return success_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#success_.; |
| 91 | } |
| 92 | |
| 93 | stdcxx . . $ std/::stringcxx . . $ std/string# const source_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#source_.; |
| 94 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<int> const data_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#data_.; |
| 95 | bool success_cxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#success_.; |
| 96 | }; |
| 97 | |
| 98 | TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("AMD PMPowerProfile tests", |
| 99 | "[GPU][AMD][PM][PMAdvanced][PMPowerProfile]") |
| 100 | { |
| 101 | CommandQueueStubcxx . . $ CommandQueueStub# ctlCmds; |
| 102 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<stdcxx . . $ std/::stringcxx . . $ std/string#, int>> modescxx . . $ std/vector#vector(9619226211e5a241).{ |
| 103 | stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).("3D_FULL_SCREEN", 0), stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).("POWER_SAVING", 1)}; |
| 104 | |
| 105 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has PMPowerProfile ID") |
| 106 | { |
| 107 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 108 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>(), |
| 109 | modes); |
| 110 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.ID() == ::AMD::PMPowerProfile::ItemID); |
| 111 | } |
| 112 | |
| 113 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Is active by default") |
| 114 | { |
| 115 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 116 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>(), |
| 117 | modes); |
| 118 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.active()); |
| 119 | } |
| 120 | |
| 121 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has first mode selected by default") |
| 122 | { |
| 123 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 124 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 125 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 126 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 127 | modes); |
| 128 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.mode() == "3D_FULL_SCREEN"); |
| 129 | } |
| 130 | |
| 131 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("mode ignores unknown modes") |
| 132 | { |
| 133 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 134 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 135 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 136 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 137 | modes); |
| 138 | |
| 139 | ts.modecxx . . $ AMD/PMPowerProfile#mode(9c546c94e5fcce4e).("UNKNOWN"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 140 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.mode() == "3D_FULL_SCREEN"); |
| 141 | } |
| 142 | |
| 143 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate pre-init control commands") |
| 144 | { |
| 145 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 146 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>(), |
| 147 | modes); |
| 148 | ts.preInitcxx . . $ AMD/PMPowerProfile#preInit(151e9138769f295e).(ctlCmds); |
| 149 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 150 | } |
| 151 | |
| 152 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate post-init control commands") |
| 153 | { |
| 154 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 155 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>(), |
| 156 | modes); |
| 157 | ts.postInitcxx . . $ AMD/PMPowerProfile#postInit(151e9138769f295e).(ctlCmds); |
| 158 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 159 | } |
| 160 | |
| 161 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Import its mode") |
| 162 | { |
| 163 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 164 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 165 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 166 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 167 | modes); |
| 168 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 169 | PMPowerProfileImporterStubcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub# icxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileImporterStub#PMPowerProfileImporterStub(8d4ab0a187bf9331).("POWER_SAVING"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 170 | ts.importControlcxx . . $ AMD/PMPowerProfile#importControl(4f796e3ecd5dcd94).(i); |
| 171 | |
| 172 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.mode() == "POWER_SAVING"); |
| 173 | } |
| 174 | |
| 175 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Export its mode and available modes") |
| 176 | { |
| 177 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 178 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(), |
| 179 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 180 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 181 | modes); |
| 182 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 183 | |
| 184 | trompeloeilcxx . . $ trompeloeil/::sequencecxx . . $ trompeloeil/sequence# seq; |
| 185 | PMPowerProfileExporterMockcxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileExporterMock# e; |
| 186 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takePMPowerProfileModes(trompeloeil::_)).IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 187 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takePMPowerProfileMode(trompeloeil::eq("3D_FULL_SCREEN"))) |
| 188 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 189 | |
| 190 | ts.exportControlcxx . . $ AMD/PMPowerProfile#exportControl(40299682ab9c8676).(e); |
| 191 | } |
| 192 | |
| 193 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Generate clean control commands...") |
| 194 | { |
| 195 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Including performance level command when its value is not manual") |
| 196 | { |
| 197 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 198 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>( |
| 199 | "power_dpm_force_performance_level", "auto"), |
| 200 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 201 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 202 | modes); |
| 203 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 204 | ts.cleanControlcxx . . $ AMD/PMPowerProfile#cleanControl(151e9138769f295e).(ctlCmds); |
| 205 | |
| 206 | auto &commands = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).(); |
| 207 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(commands.size() == 2); |
| 208 | |
| 209 | auto &[cmd0Path, cmd0Value] = commands[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]; |
| 210 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Path == "power_dpm_force_performance_level"); |
| 211 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Value == "manual"); |
| 212 | |
| 213 | auto &[cmd1Path, cmd1Value] = commands[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).1]; |
| 214 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Path == "pp_power_profile_mode"); |
| 215 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Value == "0"); |
| 216 | } |
| 217 | |
| 218 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Excluding performance level command when its value is manual") |
| 219 | { |
| 220 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 221 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>( |
| 222 | "power_dpm_force_performance_level", "manual"), |
| 223 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 224 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 225 | modes); |
| 226 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 227 | ts.cleanControlcxx . . $ AMD/PMPowerProfile#cleanControl(151e9138769f295e).(ctlCmds); |
| 228 | |
| 229 | auto &commands = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).(); |
| 230 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(commands.size() == 1); |
| 231 | |
| 232 | auto &[cmd0Path, cmd0Value] = commands[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]; |
| 233 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Path == "pp_power_profile_mode"); |
| 234 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Value == "0"); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands when is synced") |
| 239 | { |
| 240 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 241 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>( |
| 242 | "power_dpm_force_performance_level", "manual"), |
| 243 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 244 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(1)), |
| 245 | modes); |
| 246 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 247 | ts.modecxx . . $ AMD/PMPowerProfile#mode(9c546c94e5fcce4e).("POWER_SAVING"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 248 | ts.syncControlcxx . . $ AMD/PMPowerProfile#syncControl(151e9138769f295e).(ctlCmds); |
| 249 | |
| 250 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 251 | } |
| 252 | |
| 253 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate sync control commands when...") |
| 254 | { |
| 255 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("power_dpm_force_performance_level is out of sync") |
| 256 | { |
| 257 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 258 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>( |
| 259 | "power_dpm_force_performance_level", "auto"), |
| 260 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 261 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(0)), |
| 262 | modes); |
| 263 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 264 | ts.modecxx . . $ AMD/PMPowerProfile#mode(9c546c94e5fcce4e).("POWER_SAVING"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 265 | ts.syncControlcxx . . $ AMD/PMPowerProfile#syncControl(151e9138769f295e).(ctlCmds); |
| 266 | |
| 267 | auto &commands = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).(); |
| 268 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(commands.size() == 2); |
| 269 | |
| 270 | auto &[cmd0Path, cmd0Value] = commands[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]; |
| 271 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Path == "power_dpm_force_performance_level"); |
| 272 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd0Value == "manual"); |
| 273 | |
| 274 | auto &[cmd1Path, cmd1Value] = commands[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).1]; |
| 275 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Path == "pp_power_profile_mode"); |
| 276 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmd1Value == "1"); |
| 277 | } |
| 278 | |
| 279 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("pp_power_profile_mode is out of sync") |
| 280 | { |
| 281 | PMPowerProfileTestAdaptercxx . . $ Tests/AMD/PMPowerProfile/PMPowerProfileTestAdapter# ts( |
| 282 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>( |
| 283 | "power_dpm_force_performance_level", "manual"), |
| 284 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<OptionalIntDataSourceStubcxx . . $ Tests/AMD/PMPowerProfile/OptionalIntDataSourceStub#>("pp_power_profile_mode", |
| 285 | stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(e412eef0971c0904).(1)), |
| 286 | modes); |
| 287 | ts.initcxx . . $ AMD/PMPowerProfile#init(49f6e7a06ebc5aa8).(); |
| 288 | ts.syncControlcxx . . $ AMD/PMPowerProfile#syncControl(151e9138769f295e).(ctlCmds); |
| 289 | |
| 290 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1); |
| 291 | |
| 292 | auto &[cmdPath, cmdValue] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 293 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmdPath == "pp_power_profile_mode"); |
| 294 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(cmdValue == "0"); |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | } // namespace Tests::AMD::PMPowerProfile |