1 /* 2 * Copyright (c) 2022-2023 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 /* This files contains faultlog config modules. */ 17 18 #ifndef THERMAL_FUZZER_TEST_H 19 #define THERMAL_FUZZER_TEST_H 20 21 #include <cstddef> 22 #include <cstdint> 23 #include <cstdio> 24 #include <cstdlib> 25 #include <ctime> 26 #include <fcntl.h> 27 #include <iostream> 28 #include <random> 29 #include <securec.h> 30 #include <string> 31 #include <thread> 32 33 #include "ithermal_action_callback.h" 34 #include "ithermal_level_callback.h" 35 #include "ithermal_temp_callback.h" 36 #include "securec.h" 37 #include "thermal_action_callback_stub.h" 38 #include "thermal_level_callback_stub.h" 39 #include "thermal_mgr_client.h" 40 #include "thermal_temp_callback_stub.h" 41 42 #define FUZZ_PROJECT_NAME "fault_fuzzer" 43 44 namespace OHOS { 45 namespace PowerMgr { 46 class ThermalFuzzerTest { 47 public: 48 class ThermalTempTestCallback : public ThermalTempCallbackStub { 49 public: ThermalTempTestCallback()50 ThermalTempTestCallback() {}; ~ThermalTempTestCallback()51 virtual ~ThermalTempTestCallback() {}; 52 bool OnThermalTempChanged(TempCallbackMap& tempCbMap) override; 53 }; 54 class ThermalLevelTestCallback : public ThermalLevelCallbackStub { 55 public: ThermalLevelTestCallback()56 ThermalLevelTestCallback() {}; ~ThermalLevelTestCallback()57 virtual ~ThermalLevelTestCallback() {}; 58 bool GetThermalLevel(ThermalLevel level) override; 59 }; 60 class ThermalActionTestCallback : public ThermalActionCallbackStub { 61 public: ThermalActionTestCallback()62 ThermalActionTestCallback() {}; ~ThermalActionTestCallback()63 virtual ~ThermalActionTestCallback() {}; 64 bool OnThermalActionChanged(ActionCallbackMap& actionCbMap) override; 65 }; 66 }; 67 } // namespace PowerMgr 68 } // namespace OHOS 69 #endif // THERMAL_FUZZER_TEST_H 70