1 /* 2 * Copyright (c) 2025 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 #include <gtest/gtest.h> 17 #include "battery_hookmgr.h" 18 #include "battery_log.h" 19 20 namespace OHOS { 21 namespace PowerMgr { 22 namespace Test { 23 using namespace testing::ext; 24 class BatteryHookMgrTest : public testing::Test {}; 25 26 /** 27 * @tc.name: BatteryHookMgrTest001 28 * @tc.desc: test GetBatteryHookMgr 29 * @tc.type: FUNC 30 */ 31 HWTEST_F(BatteryHookMgrTest, BatteryHookMgrTest001, TestSize.Level1) 32 { 33 BATTERY_HILOGI(LABEL_TEST, "BatteryHookMgrTest001 function start!"); 34 HOOK_MGR* testHookMgr = GetBatteryHookMgr(); 35 EXPECT_NE(testHookMgr, nullptr); 36 BATTERY_HILOGI(LABEL_TEST, "BatteryHookMgrTest001 function end!"); 37 } 38 } // namespace Test 39 } // namespace PowerMgr 40 } // namespace OHOS