1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16
17 #include "thermal_action_report_test.h"
18
19 #include "securec.h"
20 #include <fcntl.h>
21 #include <string>
22 #include <unistd.h>
23
24 #include "battery_srv_client.h"
25 #include "battery_stats_client.h"
26 #include "mock_thermal_mgr_client.h"
27 #include "power_mgr_client.h"
28 #include "thermal_config_file_parser.h"
29 #include "thermal_mgr_client.h"
30
31 using namespace testing::ext;
32 using namespace OHOS::PowerMgr;
33 using namespace OHOS;
34 using namespace std;
35
36 namespace {
37 static std::shared_ptr<ThermalConfigFileParser> g_configParser = nullptr;
38 static std::vector<std::string> g_dumpArgs;
39 static std::string g_sceneState;
40 static const std::string policyCfgName = "base_safe";
41 constexpr int32_t NUM_ZERO = 0;
42 constexpr uint32_t MAX_PATH = 256;
43 constexpr int32_t THERMAL_RATIO_BEGIN = 0;
44 constexpr int32_t THERMAL_RATIO_LENGTH = 4;
45 constexpr const char* BATTERY_TEMP_PATH = "/data/service/el0/thermal/sensor/battery/temp";
46 constexpr const char* CONFIG_LEVEL_PATH = "/data/service/el0/thermal/config/configLevel";
47 constexpr const char* VENDOR_CONFIG = "/vendor/etc/thermal_config/thermal_service_config.xml";
48 constexpr const char* SIMULATION_TEMP_DIR = "/data/service/el0/thermal/sensor/%s/temp";
49 }
50
ParserThermalSrvConfigFile()51 void ThermalActionReportTest::ParserThermalSrvConfigFile()
52 {
53 if (g_configParser == nullptr) {
54 g_configParser = std::make_shared<ThermalConfigFileParser>();
55 if (!g_configParser->Init()) {
56 THERMAL_HILOGE(LABEL_TEST, "Thermal service config file parser initialization failed");
57 }
58 }
59 }
60
WriteFile(const std::string & path,const std::string & buf,size_t size)61 int32_t ThermalActionReportTest::WriteFile(const std::string& path, const std::string& buf, size_t size)
62 {
63 FILE* stream = fopen(path.c_str(), "w+");
64 if (stream == nullptr) {
65 return ERR_INVALID_VALUE;
66 }
67 size_t ret = fwrite(buf.c_str(), strlen(buf.c_str()), 1, stream);
68 if (ret == ERR_OK) {
69 THERMAL_HILOGE(LABEL_TEST, "ret=%{public}zu", ret);
70 }
71 int32_t state = fseek(stream, 0, SEEK_SET);
72 if (state != ERR_OK) {
73 fclose(stream);
74 return state;
75 }
76 state = fclose(stream);
77 if (state != ERR_OK) {
78 return state;
79 }
80 return ERR_OK;
81 }
82
ReadFile(const char * path,char * buf,size_t size)83 int32_t ThermalActionReportTest::ReadFile(const char* path, char* buf, size_t size)
84 {
85 int32_t ret = ReadSysfsFile(path, buf, size);
86 if (ret != NUM_ZERO) {
87 THERMAL_HILOGD(LABEL_TEST, "failed to read file");
88 return ret;
89 }
90 return ERR_OK;
91 }
92
ReadSysfsFile(const char * path,char * buf,size_t size)93 int32_t ThermalActionReportTest::ReadSysfsFile(const char* path, char* buf, size_t size)
94 {
95 int32_t readSize;
96 int fd = open(path, O_RDONLY, S_IRUSR | S_IRGRP | S_IROTH);
97 if (fd < NUM_ZERO) {
98 THERMAL_HILOGE(LABEL_TEST, "failed to open file node");
99 return ERR_INVALID_VALUE;
100 }
101
102 readSize = read(fd, buf, size - 1);
103 if (readSize < NUM_ZERO) {
104 THERMAL_HILOGE(LABEL_TEST, "failed to read file");
105 close(fd);
106 return ERR_INVALID_VALUE;
107 }
108
109 buf[readSize] = '\0';
110 Trim(buf);
111 close(fd);
112
113 return ERR_OK;
114 }
115
ConvertInt(const std::string & value)116 int32_t ThermalActionReportTest::ConvertInt(const std::string& value)
117 {
118 if (IsNumericStr(value)) {
119 return std::stoi(value);
120 }
121 return -1;
122 }
123
Trim(char * str)124 void ThermalActionReportTest::Trim(char* str)
125 {
126 if (str == nullptr) {
127 return;
128 }
129
130 str[strcspn(str, "\n")] = 0;
131 }
132
InitNode()133 int32_t ThermalActionReportTest::InitNode()
134 {
135 char bufTemp[MAX_PATH] = {0};
136 int32_t ret = -1;
137 std::map<std::string, int32_t> sensor;
138 sensor["battery"] = 0;
139 sensor["charger"] = 0;
140 sensor["pa"] = 0;
141 sensor["ap"] = 0;
142 sensor["ambient"] = 0;
143 sensor["cpu"] = 0;
144 sensor["soc"] = 0;
145 sensor["shell"] = 0;
146 for (auto iter : sensor) {
147 ret = snprintf_s(bufTemp, MAX_PATH, sizeof(bufTemp) - 1, SIMULATION_TEMP_DIR, iter.first.c_str());
148 if (ret < EOK) {
149 return ret;
150 }
151 std::string temp = std::to_string(iter.second);
152 WriteFile(bufTemp, temp, temp.length());
153 }
154 return ERR_OK;
155 }
156
SetScene(const std::string & scene)157 void ThermalActionReportTest::SetScene(const std::string& scene)
158 {
159 g_sceneState = scene;
160 auto& thermalMgrClient = ThermalMgrClient::GetInstance();
161 thermalMgrClient.SetScene(g_sceneState);
162 }
163
SetCondition(int32_t value,const std::string & scene)164 int32_t ThermalActionReportTest::SetCondition(int32_t value, const std::string& scene)
165 {
166 THERMAL_HILOGD(LABEL_TEST, "battery = %{public}d, scene = %{public}s", value, scene.c_str());
167 int32_t ret = -1;
168 char batteryTempBuf[MAX_PATH] = {0};
169 ret = snprintf_s(batteryTempBuf, MAX_PATH, sizeof(batteryTempBuf) - 1, BATTERY_TEMP_PATH);
170 EXPECT_EQ(true, ret >= EOK);
171 std::string strTemp = to_string(value) + "\n";
172 ret = WriteFile(batteryTempBuf, strTemp, strTemp.length());
173 EXPECT_EQ(true, ret == ERR_OK);
174 SetScene(scene);
175 return ret;
176 }
177
GetThermalLevel(int32_t expectValue)178 int32_t ThermalActionReportTest::GetThermalLevel(int32_t expectValue)
179 {
180 int32_t ret = -1;
181 char levelBuf[MAX_PATH] = {0};
182 char levelValue[MAX_PATH] = {0};
183 ret = snprintf_s(levelBuf, MAX_PATH, sizeof(levelBuf) - 1, CONFIG_LEVEL_PATH);
184 EXPECT_EQ(true, ret >= EOK);
185 ret = ReadFile(levelBuf, levelValue, sizeof(levelValue));
186 EXPECT_EQ(true, ret == ERR_OK);
187 std::string level = levelValue;
188 int32_t value = ConvertInt(level);
189 THERMAL_HILOGD(LABEL_TEST, "value: %{public}d", value);
190 EXPECT_EQ(true, value == expectValue) << "Thermal action policy failed";
191 return value;
192 }
193
GetActionValue(const std::string & actionName,uint32_t level)194 std::string ThermalActionReportTest::GetActionValue(const std::string& actionName, uint32_t level)
195 {
196 THERMAL_HILOGD(LABEL_TEST, "action name = %{public}s, level = %{public}d", actionName.c_str(), level);
197 std::string value = "0";
198 std::vector<PolicyAction> vAction;
199 if (!g_configParser->GetActionPolicy(policyCfgName, level, vAction)) {
200 THERMAL_HILOGD(LABEL_TEST, "Get policy failed name = %{public}s, return", policyCfgName.c_str());
201 return value;
202 }
203 return ActionDecision(actionName, vAction);
204 }
205
ActionDecision(const std::string & actionName,std::vector<PolicyAction> & vAction)206 std::string ThermalActionReportTest::ActionDecision(const std::string& actionName, std::vector<PolicyAction>& vAction)
207 {
208 THERMAL_HILOGD(LABEL_TEST, "action name = %{public}s", actionName.c_str());
209 if (actionName == LCD_ACTION_NAME) {
210 return LcdValueDecision(actionName, vAction);
211 } else {
212 return ActionValueDecision(actionName, vAction);
213 }
214 }
215
ActionValueDecision(const std::string & actionName,std::vector<PolicyAction> & vAction)216 std::string ThermalActionReportTest::ActionValueDecision(const std::string& actionName,
217 std::vector<PolicyAction>& vAction)
218 {
219 THERMAL_HILOGD(LABEL_TEST, "action name = %{public}s", actionName.c_str());
220 int32_t value = -1;
221 std::vector<uint32_t> valueList;
222 for (auto actionIter : vAction) {
223 if (actionIter.actionName == actionName) {
224 if (actionIter.isProp) {
225 if (StateDecision(actionIter.mActionProp)) {
226 valueList.push_back(stoi(actionIter.actionValue));
227 }
228 } else {
229 valueList.push_back(stoi(actionIter.actionValue));
230 }
231 }
232 }
233
234 bool strict = g_configParser->GetActionStrict(actionName);
235 if (valueList.empty()) {
236 value = 0;
237 } else {
238 if (strict) {
239 value = *max_element(valueList.begin(), valueList.end());
240 } else {
241 value = *min_element(valueList.begin(), valueList.end());
242 }
243 }
244 std::string strValue = to_string(value);
245 return strValue;
246 }
247
LcdValueDecision(const std::string & actionName,std::vector<PolicyAction> & vAction)248 std::string ThermalActionReportTest::LcdValueDecision(const std::string& actionName,
249 std::vector<PolicyAction>& vAction)
250 {
251 THERMAL_HILOGD(LABEL_TEST, "action name = %{public}s", actionName.c_str());
252 float value = -1.0;
253 std::vector<float> valueList;
254 std::map<std::string, std::string> sceneMap;
255 for (auto actionIter : vAction) {
256 if (actionIter.actionName == actionName) {
257 if (actionIter.isProp) {
258 if (StateDecision(actionIter.mActionProp)) {
259 valueList.push_back(stof(actionIter.actionValue));
260 sceneMap.emplace(std::pair(actionIter.mActionProp.begin()->second, actionIter.actionValue));
261 }
262 } else {
263 valueList.push_back(stof(actionIter.actionValue));
264 }
265 }
266 }
267
268 for (auto sceneIter : sceneMap) {
269 if (g_sceneState == sceneIter.first) {
270 return sceneIter.second.c_str();
271 }
272 }
273
274 bool strict = g_configParser->GetActionStrict(actionName);
275 if (valueList.empty()) {
276 value = 0;
277 } else {
278 if (strict) {
279 value = *max_element(valueList.begin(), valueList.end());
280 } else {
281 value = *min_element(valueList.begin(), valueList.end());
282 }
283 }
284 std::string strValue = to_string(value).substr(THERMAL_RATIO_BEGIN, THERMAL_RATIO_LENGTH);
285 return strValue;
286 }
287
StateDecision(std::map<std::string,std::string> & actionPropMap)288 bool ThermalActionReportTest::StateDecision(std::map<std::string, std::string>& actionPropMap)
289 {
290 bool ret = true;
291 std::map<std::string, std::string> stateMap;
292 GetStateMap(stateMap);
293 for (auto prop : actionPropMap) {
294 auto stateIter = stateMap.find(prop.first);
295 THERMAL_HILOGD(LABEL_TEST, "state = %{public}s, value = %{public}s",
296 prop.first.c_str(), prop.second.c_str());
297 THERMAL_HILOGD(LABEL_TEST, "state iter = %{public}s, iter value = %{public}s",
298 stateIter->first.c_str(), stateIter->second.c_str());
299 if (stateIter != stateMap.end()) {
300 if (stateIter->second.compare(prop.second) == 0) {
301 continue;
302 } else {
303 ret = false;
304 break;
305 }
306 }
307 }
308 return ret;
309 }
310
GetScreenState()311 std::string ThermalActionReportTest::GetScreenState()
312 {
313 std::string state = "0";
314 auto& powerMgrClient = PowerMgrClient::GetInstance();
315 if (powerMgrClient.IsScreenOn()) {
316 state = "1";
317 }
318 return state;
319 }
320
GetChargeState()321 std::string ThermalActionReportTest::GetChargeState()
322 {
323 std::string state = "";
324 auto& batterySrvClient = BatterySrvClient::GetInstance();
325 BatteryChargeState chargeState = batterySrvClient.GetChargingStatus();
326 if (chargeState == BatteryChargeState::CHARGE_STATE_ENABLE) {
327 state = "1";
328 } else if (chargeState == BatteryChargeState::CHARGE_STATE_NONE) {
329 state = "0";
330 }
331 return state;
332 }
333
GetStateMap(std::map<std::string,std::string> & stateMap)334 void ThermalActionReportTest::GetStateMap(std::map<std::string, std::string>& stateMap)
335 {
336 std::vector<StateItem> stateItem = g_configParser->GetStateItem();
337 for (auto stateIter : stateItem) {
338 std::string state = "";
339 if (stateIter.name == "scene") {
340 state = g_sceneState;
341 } else if (stateIter.name == "screen") {
342 state = GetScreenState();
343 } else if (stateIter.name == "charge") {
344 state = GetChargeState();
345 }
346 stateMap.emplace(std::pair(stateIter.name, state));
347 }
348 for (auto iter : stateMap) {
349 THERMAL_HILOGD(LABEL_TEST, "stateMap name = %{public}s, value = %{public}s",
350 iter.first.c_str(), iter.second.c_str());
351 }
352 }
353
ThermalActionTriggered(const std::string & actionName,int32_t level,const std::string & dumpInfo)354 void ThermalActionReportTest::ThermalActionTriggered(const std::string& actionName, int32_t level,
355 const std::string& dumpInfo)
356 {
357 bool enableEvent = g_configParser->GetActionEnableEvent(actionName);
358 THERMAL_HILOGD(LABEL_TEST, "action name = %{public}s, event flag = %{public}d", actionName.c_str(), enableEvent);
359 if (!enableEvent) {
360 GTEST_LOG_(INFO) << __func__ << " action name: " << actionName <<" enalbe event flag is false, return";
361 return;
362 }
363 std::string value = GetActionValue(actionName, level);
364 std::string expectedDumpInfo;
365 std::string valueLabel = " Value = ";
366 if (actionName == LCD_ACTION_NAME) {
367 valueLabel = " Ratio = ";
368 }
369 expectedDumpInfo.append("Additional debug info: ")
370 .append("Event name = THERMAL_ACTION_TRIGGERED")
371 .append(" Action name = ")
372 .append(actionName)
373 .append(valueLabel)
374 .append(value);
375 THERMAL_HILOGD(LABEL_TEST, "value: %{public}s", value.c_str());
376 GTEST_LOG_(INFO) << __func__ << " action name: " << actionName <<" expected debug info: " << expectedDumpInfo;
377 auto index = dumpInfo.find(expectedDumpInfo);
378 EXPECT_TRUE(index != string::npos) << " Thermal action fail due to not found related debug info."
379 << " action name = " << actionName;
380 }
381
SetUpTestCase()382 void ThermalActionReportTest::SetUpTestCase()
383 {
384 ParserThermalSrvConfigFile();
385 g_dumpArgs.push_back("-batterystats");
386 }
387
TearDownTestCase()388 void ThermalActionReportTest::TearDownTestCase()
389 {
390 }
391
SetUp()392 void ThermalActionReportTest::SetUp()
393 {
394 InitNode();
395 MockThermalMgrClient::GetInstance().GetThermalInfo();
396 }
397
TearDown()398 void ThermalActionReportTest::TearDown()
399 {
400 auto& thermalMgrClient = ThermalMgrClient::GetInstance();
401 thermalMgrClient.SetScene("");
402 MockThermalMgrClient::GetInstance().GetThermalInfo();
403 }
404
405 namespace {
406 /**
407 * @tc.name: ThermalActionReportTest001
408 * @tc.desc: test dump info when thermal action is triggered
409 * @tc.type: FEATURE
410 * @tc.cond: Set battery temp = 40100, scence = cam
411 * @tc.result battery stats dump info
412 */
413 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest001, TestSize.Level0)
414 {
415 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.001 start");
416 auto& statsClient = BatteryStatsClient::GetInstance();
417 statsClient.Reset();
418
419 int32_t ret = -1;
420 int32_t batteryTemp = 40100;
421 std::string sceneState = "cam";
422 int32_t expectLevel = 1;
423 ret = SetCondition(batteryTemp, sceneState);
424 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
425
426 if (access(VENDOR_CONFIG, 0) != 0) {
427 MockThermalMgrClient::GetInstance().GetThermalInfo();
428 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
429 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
430 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
431 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
432 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
433 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
434 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
435 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
436 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
437 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
438 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
439 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
440 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
441 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
442 }
443 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.001 end");
444 }
445
446 /**
447 * @tc.name: ThermalActionReportTest002
448 * @tc.desc: test dump info when thermal action is triggered
449 * @tc.type: FEATURE
450 * @tc.cond: Set battery temp = 40100, scence = call
451 * @tc.result battery stats dump info
452 */
453 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest002, TestSize.Level0)
454 {
455 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.002 start");
456 auto& statsClient = BatteryStatsClient::GetInstance();
457 statsClient.Reset();
458
459 int32_t ret = -1;
460 int32_t batteryTemp = 40100;
461 std::string sceneState = "call";
462 int32_t expectLevel = 1;
463 ret = SetCondition(batteryTemp, sceneState);
464 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
465
466 if (access(VENDOR_CONFIG, 0) != 0) {
467 MockThermalMgrClient::GetInstance().GetThermalInfo();
468 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
469 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
470 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
471 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
472 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
473 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
474 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
475 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
476 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
477 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
478 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
479 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
480 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
481 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
482 }
483 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.002 end");
484 }
485
486 /**
487 * @tc.name: ThermalActionReportTest003
488 * @tc.desc: test dump info when thermal action is triggered
489 * @tc.type: FEATURE
490 * @tc.cond: Set battery temp = 40100, scence = game
491 * @tc.result battery stats dump info
492 */
493 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest003, TestSize.Level0)
494 {
495 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.003 start");
496 auto& statsClient = BatteryStatsClient::GetInstance();
497 statsClient.Reset();
498
499 int32_t ret = -1;
500 int32_t batteryTemp = 40100;
501 std::string sceneState = "game";
502 int32_t expectLevel = 1;
503 ret = SetCondition(batteryTemp, sceneState);
504 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
505
506 if (access(VENDOR_CONFIG, 0) != 0) {
507 MockThermalMgrClient::GetInstance().GetThermalInfo();
508 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
509 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
510 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
511 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
512 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
513 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
514 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
515 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
516 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
517 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
518 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
519 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
520 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
521 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
522 }
523 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.003 end");
524 }
525
526 /**
527 * @tc.name: ThermalActionReportTest004
528 * @tc.desc: test dump info when thermal action is triggered
529 * @tc.type: FEATURE
530 * @tc.cond: Set battery temp = 40100, scence = ""
531 * @tc.result battery stats dump info
532 */
533 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest004, TestSize.Level0)
534 {
535 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.004 start");
536 auto& statsClient = BatteryStatsClient::GetInstance();
537 statsClient.Reset();
538
539 int32_t ret = -1;
540 int32_t batteryTemp = 40100;
541 std::string sceneState = "";
542 int32_t expectLevel = 1;
543 ret = SetCondition(batteryTemp, sceneState);
544 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
545
546 if (access(VENDOR_CONFIG, 0) != 0) {
547 MockThermalMgrClient::GetInstance().GetThermalInfo();
548 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
549 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
550 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
551 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
552 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
553 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
554 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
555 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
556 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
557 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
558 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
559 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
560 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
561 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
562 }
563 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.004 end");
564 }
565
566 /**
567 * @tc.name: ThermalActionReportTest005
568 * @tc.desc: test dump info when thermal action is triggered
569 * @tc.type: FEATURE
570 * @tc.cond: Set battery temp = 43100, scence = cam
571 * @tc.result battery stats dump info
572 */
573 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest005, TestSize.Level0)
574 {
575 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.005 start");
576 auto& statsClient = BatteryStatsClient::GetInstance();
577 statsClient.Reset();
578
579 int32_t ret = -1;
580 int32_t batteryTemp = 43100;
581 std::string sceneState = "cam";
582 int32_t expectLevel = 2;
583 ret = SetCondition(batteryTemp, sceneState);
584 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
585
586 if (access(VENDOR_CONFIG, 0) != 0) {
587 MockThermalMgrClient::GetInstance().GetThermalInfo();
588 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
589 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
590 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
591 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
592 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
593 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
594 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
595 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
596 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
597 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
598 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
599 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
600 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
601 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
602 }
603 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.005 end");
604 }
605
606 /**
607 * @tc.name: ThermalActionReportTest006
608 * @tc.desc: test dump info when thermal action is triggered
609 * @tc.type: FEATURE
610 * @tc.cond: Set battery temp = 43100, scence = call
611 * @tc.result battery stats dump info
612 */
613 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest006, TestSize.Level0)
614 {
615 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.006 start");
616 auto& statsClient = BatteryStatsClient::GetInstance();
617 statsClient.Reset();
618
619 int32_t ret = -1;
620 int32_t batteryTemp = 43100;
621 std::string sceneState = "call";
622 int32_t expectLevel = 2;
623 ret = SetCondition(batteryTemp, sceneState);
624 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
625
626 if (access(VENDOR_CONFIG, 0) != 0) {
627 MockThermalMgrClient::GetInstance().GetThermalInfo();
628 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
629 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
630 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
631 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
632 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
633 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
634 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
635 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
636 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
637 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
638 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
639 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
640 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
641 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
642 }
643 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.006 end");
644 }
645
646 /**
647 * @tc.name: ThermalActionReportTest007
648 * @tc.desc: test dump info when thermal action is triggered
649 * @tc.type: FEATURE
650 * @tc.cond: Set battery temp = 43100, scence = game
651 * @tc.result battery stats dump info
652 */
653 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest007, TestSize.Level0)
654 {
655 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.007 start");
656 auto& statsClient = BatteryStatsClient::GetInstance();
657 statsClient.Reset();
658
659 int32_t ret = -1;
660 int32_t batteryTemp = 43100;
661 std::string sceneState = "game";
662 int32_t expectLevel = 2;
663 ret = SetCondition(batteryTemp, sceneState);
664 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
665
666 if (access(VENDOR_CONFIG, 0) != 0) {
667 MockThermalMgrClient::GetInstance().GetThermalInfo();
668 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
669 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
670 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
671 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
672 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
673 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
674 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
675 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
676 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
677 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
678 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
679 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
680 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
681 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
682 }
683 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.007 end");
684 }
685
686 /**
687 * @tc.name: ThermalActionReportTest008
688 * @tc.desc: test dump info when thermal action is triggered
689 * @tc.type: FEATURE
690 * @tc.cond: Set battery temp = 43100, scence = ""
691 * @tc.result battery stats dump info
692 */
693 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest008, TestSize.Level0)
694 {
695 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.008 start");
696 auto& statsClient = BatteryStatsClient::GetInstance();
697 statsClient.Reset();
698
699 int32_t ret = -1;
700 int32_t batteryTemp = 43100;
701 std::string sceneState = "";
702 int32_t expectLevel = 2;
703 ret = SetCondition(batteryTemp, sceneState);
704 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
705
706 if (access(VENDOR_CONFIG, 0) != 0) {
707 MockThermalMgrClient::GetInstance().GetThermalInfo();
708 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
709 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
710 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
711 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
712 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
713 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
714 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
715 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
716 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
717 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
718 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
719 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
720 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
721 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
722 }
723 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.008 end");
724 }
725
726 /**
727 * @tc.name: ThermalActionReportTest009
728 * @tc.desc: test dump info when thermal action is triggered
729 * @tc.type: FEATURE
730 * @tc.cond: Set battery temp = 46100, scence = cam
731 * @tc.result battery stats dump info
732 */
733 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest009, TestSize.Level0)
734 {
735 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.009 start");
736 auto& statsClient = BatteryStatsClient::GetInstance();
737 statsClient.Reset();
738
739 int32_t ret = -1;
740 int32_t batteryTemp = 46100;
741 std::string sceneState = "cam";
742 int32_t expectLevel = 3;
743 ret = SetCondition(batteryTemp, sceneState);
744 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
745
746 if (access(VENDOR_CONFIG, 0) != 0) {
747 MockThermalMgrClient::GetInstance().GetThermalInfo();
748 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
749 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
750 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
751 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
752 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
753 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
754 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
755 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
756 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
757 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
758 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
759 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
760 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
761 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
762 ThermalActionReportTest::ThermalActionTriggered(SHUTDOWN_ACTION_NAME, level, actualDumpInfo);
763 }
764 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.009 end");
765 }
766
767 /**
768 * @tc.name: ThermalActionReportTest010
769 * @tc.desc: test dump info when thermal action is triggered
770 * @tc.type: FEATURE
771 * @tc.cond: Set battery temp = 46100, scence = call
772 * @tc.result battery stats dump info
773 */
774 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest010, TestSize.Level0)
775 {
776 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.010 start");
777 auto& statsClient = BatteryStatsClient::GetInstance();
778 statsClient.Reset();
779
780 int32_t ret = -1;
781 int32_t batteryTemp = 46100;
782 std::string sceneState = "call";
783 int32_t expectLevel = 3;
784 ret = SetCondition(batteryTemp, sceneState);
785 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
786
787 if (access(VENDOR_CONFIG, 0) != 0) {
788 MockThermalMgrClient::GetInstance().GetThermalInfo();
789 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
790 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
791 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
792 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
793 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
794 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
795 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
796 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
797 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
798 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
799 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
800 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
801 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
802 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
803 ThermalActionReportTest::ThermalActionTriggered(SHUTDOWN_ACTION_NAME, level, actualDumpInfo);
804 }
805 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.010 end");
806 }
807
808 /**
809 * @tc.name: ThermalActionReportTest011
810 * @tc.desc: test dump info when thermal action is triggered
811 * @tc.type: FEATURE
812 * @tc.cond: Set battery temp = 46100, scence = game
813 * @tc.result battery stats dump info
814 */
815 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest011, TestSize.Level0)
816 {
817 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.011 start");
818 auto& statsClient = BatteryStatsClient::GetInstance();
819 statsClient.Reset();
820
821 int32_t ret = -1;
822 int32_t batteryTemp = 46100;
823 std::string sceneState = "game";
824 int32_t expectLevel = 3;
825 ret = SetCondition(batteryTemp, sceneState);
826 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
827
828 if (access(VENDOR_CONFIG, 0) != 0) {
829 MockThermalMgrClient::GetInstance().GetThermalInfo();
830 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
831 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
832 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
833 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
834 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
835 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
836 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
837 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
838 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
839 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
840 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
841 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
842 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
843 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
844 ThermalActionReportTest::ThermalActionTriggered(SHUTDOWN_ACTION_NAME, level, actualDumpInfo);
845 }
846 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.011 end");
847 }
848
849 /**
850 * @tc.name: ThermalActionReportTest012
851 * @tc.desc: test dump info when thermal action is triggered
852 * @tc.type: FEATURE
853 * @tc.cond: Set battery temp = 46100, scence = ""
854 * @tc.result battery stats dump info
855 */
856 HWTEST_F (ThermalActionReportTest, ThermalActionReportTest012, TestSize.Level0)
857 {
858 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.012 start");
859 auto& statsClient = BatteryStatsClient::GetInstance();
860 statsClient.Reset();
861
862 int32_t ret = -1;
863 int32_t batteryTemp = 46100;
864 std::string sceneState = "";
865 int32_t expectLevel = 3;
866 ret = SetCondition(batteryTemp, sceneState);
867 EXPECT_EQ(true, ret == ERR_OK) << " Thermal action fail due to set condition error";
868
869 if (access(VENDOR_CONFIG, 0) != 0) {
870 MockThermalMgrClient::GetInstance().GetThermalInfo();
871 int32_t level = ThermalActionReportTest::GetThermalLevel(expectLevel);
872 std::string actualDumpInfo = statsClient.Dump(g_dumpArgs);
873 GTEST_LOG_(INFO) << __func__ << ": actual dump info: " << actualDumpInfo;
874 ThermalActionReportTest::ThermalActionTriggered(CPU_BIG_ACTION_NAME, level, actualDumpInfo);
875 ThermalActionReportTest::ThermalActionTriggered(CPU_MED_ACTION_NAME, level, actualDumpInfo);
876 ThermalActionReportTest::ThermalActionTriggered(CPU_LIT_ACTION_NAME, level, actualDumpInfo);
877 ThermalActionReportTest::ThermalActionTriggered(GPU_ACTION_NAME, level, actualDumpInfo);
878 ThermalActionReportTest::ThermalActionTriggered(LCD_ACTION_NAME, level, actualDumpInfo);
879 ThermalActionReportTest::ThermalActionTriggered(PROCESS_ACTION_NAME, level, actualDumpInfo);
880 ThermalActionReportTest::ThermalActionTriggered(THERMAL_LEVEL_NAME, level, actualDumpInfo);
881 ThermalActionReportTest::ThermalActionTriggered(CURRENT_SC_ACTION_NAME, level, actualDumpInfo);
882 ThermalActionReportTest::ThermalActionTriggered(CURRENT_BUCK_ACTION_NAME, level, actualDumpInfo);
883 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_SC_ACTION_NAME, level, actualDumpInfo);
884 ThermalActionReportTest::ThermalActionTriggered(VOLATAGE_BUCK_ACTION_NAME, level, actualDumpInfo);
885 ThermalActionReportTest::ThermalActionTriggered(SHUTDOWN_ACTION_NAME, level, actualDumpInfo);
886 }
887 THERMAL_HILOGD(LABEL_TEST, "Thermal action report test No.012 end");
888 }
889 }
890
891